Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【WIP】Compatible With Taro #3122

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/action-sheet/action-sheet.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './action-sheet.less';
import { chunk } from '../common/utils';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
Expand Down
1 change: 1 addition & 0 deletions src/avatar-group/avatar-group.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './avatar-group.less';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import avatarGroupProps from './props';
Expand Down
1 change: 1 addition & 0 deletions src/avatar/avatar.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './avatar.less';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import avatarProps from './props';
Expand Down
1 change: 1 addition & 0 deletions src/back-top/back-top.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './back-top.less';
import { SuperComponent, RelationsOptions, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/badge/badge.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './badge.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/button/button.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './button.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/calendar/calendar.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './calendar.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/cascader/cascader.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './cascader.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/cell-group/cell-group.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './cell-group.less';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/cell/cell.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './cell.less';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/check-tag/check-tag.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './check-tag.less';
import { wxComponent, SuperComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/checkbox-group/checkbox-group.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './checkbox-group.less';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/checkbox/checkbox.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './checkbox.less';
import { SuperComponent, wxComponent, ComponentsOptionsType, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import Props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/col/col.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './col.less';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/collapse-panel/collapse-panel.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './collapse-panel.less';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/collapse/collapse.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './collapse.less';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/common/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const CONFIG_PREFIX = "t";
export default {
prefix: CONFIG_PREFIX,
};
Expand Down
1 change: 1 addition & 0 deletions src/count-down/count-down.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './count-down.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/date-time-picker/date-time-picker.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './date-time-picker.less';
import type { Dayjs } from 'dayjs';
import dayjs from 'dayjs';
import localeData from 'dayjs/plugin/localeData';
Expand Down
1 change: 1 addition & 0 deletions src/dialog/dialog.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './dialog.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/divider/divider.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './divider.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/drawer/drawer.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './drawer.less';
import { ComponentsOptionsType, SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/dropdown-item/dropdown-item.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './dropdown-item.less';
import { RelationsOptions, SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/dropdown-menu/dropdown-menu.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './dropdown-menu.less';
import { RelationsOptions, SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/empty/empty.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './empty.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import props from './props';
import config from '../common/config';
Expand Down
1 change: 1 addition & 0 deletions src/fab/fab.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './fab.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/footer/footer.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './footer.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/grid-item/grid-item.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './grid-item.less';
import { SuperComponent, wxComponent, isObject, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/grid/grid.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './grid.less';
import { isObject, SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
4 changes: 3 additions & 1 deletion src/icon/icon.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './icon.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down Expand Up @@ -31,7 +32,7 @@ export default class Icon extends SuperComponent {
},

setIconStyle() {
const { name, color, size } = this.properties;
const { name, color, size, prefix } = this.properties;
const isImage = name.indexOf('/') !== -1;
const sizeValue = addUnit(size);
const sizeStyle = isImage && sizeValue ? { width: sizeValue, height: sizeValue } : {};
Expand All @@ -44,6 +45,7 @@ export default class Icon extends SuperComponent {
...fontStyle,
...sizeStyle,
})}`,
iconClass: `${prefix || this.data.classPrefix}-${name}`,
});
},
};
Expand Down
2 changes: 1 addition & 1 deletion src/icon/icon.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
<view wx:if="{{ isImage }}" class="{{classPrefix}}--image">
<image src="{{ name }}" mode="aspectFit" class="{{classPrefix}}__image" />
</view>
<label wx:else class="{{ prefix ? prefix : classPrefix }}-{{ name }} {{ classPrefix }}-base"> </label>
<label wx:else class="{{ iconClass }} {{ classPrefix }}-base"> </label>
</view>
1 change: 1 addition & 0 deletions src/image-viewer/image-viewer.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './image-viewer.less';
import { styles, calcIcon } from '../common/utils';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
Expand Down
1 change: 1 addition & 0 deletions src/image/image.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './image.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import ImageProps from './props';
import config from '../common/config';
Expand Down
1 change: 1 addition & 0 deletions src/indexes-anchor/indexes-anchor.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './indexes-anchor.less';
import { RelationsOptions, SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/indexes/indexes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './indexes.less';
import { RelationsOptions, SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/input/input.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './input.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/link/link.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './link.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/loading/loading.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './loading.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/message-item/message-item.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './message-item.less';
import { SuperComponent, wxComponent, ComponentsOptionsType } from '../common/src/index';
import config from '../common/config';
import { MessageProps } from '../message/message.interface';
Expand Down
1 change: 1 addition & 0 deletions src/navbar/navbar.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './navbar.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/notice-bar/notice-bar.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './notice-bar.less';
import { SuperComponent, wxComponent, ComponentsOptionsType } from '../common/src/index';
import { getRect, getAnimationFrame, calcIcon } from '../common/utils';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/overlay/overlay.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './overlay.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import transition from '../mixins/transition';
Expand Down
1 change: 1 addition & 0 deletions src/picker-item/picker-item.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './picker-item.less';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/picker/picker.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './picker.less';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/popup/popup.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './popup.less';
import { TdPopupProps } from './type';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
Expand Down
1 change: 1 addition & 0 deletions src/progress/progress.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './progress.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/pull-down-refresh/pull-down-refresh.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './pull-down-refresh.less';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/radio-group/radio-group.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './radio-group.less';
import config from '../common/config';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/radio/radio.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './radio.less';
import config from '../common/config';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import Props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/rate/rate.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './rate.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/result/result.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './result.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import props from './props';
import config from '../common/config';
Expand Down
1 change: 1 addition & 0 deletions src/row/row.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './row.less';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/search/search.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './search.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/side-bar-item/side-bar-item.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './side-bar-item.less';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/side-bar/side-bar.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './side-bar.less';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/skeleton/skeleton.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './skeleton.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/slider/slider.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './slider.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import { trimSingleValue, trimValue } from './tool';
Expand Down
1 change: 1 addition & 0 deletions src/step-item/step-item.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './step-item.less';
import { wxComponent, SuperComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/stepper/stepper.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './stepper.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/steps/steps.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './steps.less';
import { wxComponent, SuperComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/sticky/sticky.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './sticky.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import props from './props';
import config from '../common/config';
Expand Down
1 change: 1 addition & 0 deletions src/swipe-cell/swipe-cell.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './swipe-cell.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/swiper-nav/swiper-nav.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './swiper-nav.less';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import { TdSwiperNavProps } from './type';
Expand Down
1 change: 1 addition & 0 deletions src/swiper/swiper.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './swiper.less';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/switch/switch.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './switch.less';
import { wxComponent, SuperComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/tab-bar-item/tab-bar-item.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './tab-bar-item.less';
import { wxComponent, SuperComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/tab-bar/tab-bar.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './tab-bar.less';
import { wxComponent, SuperComponent, RelationsOptions } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/tab-panel/tab-panel.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './tab-panel.less';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import props from './props';
import config from '../common/config';
Expand Down
1 change: 1 addition & 0 deletions src/tabs/tabs.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './tabs.less';
import { SuperComponent, wxComponent, RelationsOptions } from '../common/src/index';
import props from './props';
import config from '../common/config';
Expand Down
1 change: 1 addition & 0 deletions src/tag/tag.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './tag.less';
import { wxComponent, SuperComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/textarea/textarea.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './textarea.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/toast/toast.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './toast.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/transition/transition.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './transition.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import transition from '../mixins/transition';
import config from '../common/config';
Expand Down
1 change: 1 addition & 0 deletions src/tree-select/tree-select.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './tree-select.less';
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
Expand Down
1 change: 1 addition & 0 deletions src/upload/upload.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './upload.less';
import { isObject, SuperComponent, wxComponent } from '../common/src/index';
import props from './props';
import { UploadFile } from './type';
Expand Down