@tdesign/uniapp 0.8.1 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/dist/action-sheet/README.en-US.md +4 -3
- package/dist/action-sheet/README.md +4 -3
- package/dist/action-sheet/action-sheet.vue +16 -12
- package/dist/action-sheet/computed.js +1 -1
- package/dist/action-sheet/props.ts +5 -0
- package/dist/action-sheet/type.ts +6 -1
- package/dist/avatar/README.en-US.md +1 -1
- package/dist/avatar/README.md +1 -1
- package/dist/avatar/avatar.vue +10 -9
- package/dist/avatar-group/avatar-group.vue +4 -4
- package/dist/back-top/README.en-US.md +1 -1
- package/dist/back-top/README.md +1 -1
- package/dist/back-top/back-top.vue +5 -4
- package/dist/badge/README.en-US.md +2 -1
- package/dist/badge/README.md +2 -1
- package/dist/badge/badge.css +1 -1
- package/dist/badge/badge.vue +4 -2
- package/dist/button/README.en-US.md +1 -1
- package/dist/button/README.md +1 -1
- package/dist/button/button.vue +17 -11
- package/dist/calendar/README.en-US.md +1 -1
- package/dist/calendar/README.md +1 -1
- package/dist/calendar/calendar-header.vue +2 -1
- package/dist/calendar/calendar.vue +15 -9
- package/dist/calendar/template.vue +12 -9
- package/dist/cascader/README.en-US.md +1 -1
- package/dist/cascader/README.md +1 -1
- package/dist/cascader/cascader.vue +8 -8
- package/dist/cell/README.en-US.md +1 -1
- package/dist/cell/README.md +1 -1
- package/dist/cell/cell.vue +34 -36
- package/dist/cell-group/cell-group.vue +5 -3
- package/dist/check-tag/check-tag.vue +6 -3
- package/dist/checkbox/README.en-US.md +1 -1
- package/dist/checkbox/README.md +1 -1
- package/dist/checkbox/checkbox.vue +5 -4
- package/dist/checkbox-group/checkbox-group.vue +5 -3
- package/dist/col/col.vue +7 -3
- package/dist/collapse/README.en-US.md +1 -1
- package/dist/collapse/README.md +1 -1
- package/dist/collapse/collapse.vue +6 -4
- package/dist/collapse-panel/collapse-panel.vue +15 -6
- package/dist/color-picker/README.en-US.md +1 -1
- package/dist/color-picker/README.md +1 -1
- package/dist/color-picker/color-picker.vue +9 -7
- package/dist/color-picker/template.vue +2 -1
- package/dist/common/canvas/index.js +1 -1
- package/dist/common/shared/color-picker/color.js +1 -0
- package/dist/common/src/instantiationDecorator.js +1 -1
- package/dist/common/style/theme/index-light.css +282 -0
- package/dist/common/style/theme/index-light.less +9 -0
- package/dist/common/style/theme/raw/_components-light.less +8 -0
- package/dist/common/style/theme/raw/_light-only.less +181 -0
- package/dist/common/version.js +1 -1
- package/dist/config-provider/config-provider.vue +3 -1
- package/dist/count-down/README.en-US.md +1 -1
- package/dist/count-down/README.md +1 -1
- package/dist/count-down/count-down.vue +5 -3
- package/dist/date-time-picker/README.en-US.md +1 -1
- package/dist/date-time-picker/README.md +1 -1
- package/dist/date-time-picker/date-time-picker.vue +8 -6
- package/dist/date-time-picker/locale/dayjs.js +6 -6
- package/dist/demo-navbar/demo-navbar.vue +1 -1
- package/dist/dialog/README.en-US.md +1 -1
- package/dist/dialog/README.md +1 -1
- package/dist/dialog/dialog.vue +10 -7
- package/dist/dialog/index.js +2 -1
- package/dist/divider/README.en-US.md +1 -1
- package/dist/divider/README.md +1 -1
- package/dist/divider/divider.vue +4 -2
- package/dist/draggable/draggable.vue +5 -2
- package/dist/drawer/README.en-US.md +1 -1
- package/dist/drawer/README.md +1 -1
- package/dist/drawer/drawer.vue +7 -5
- package/dist/dropdown-item/dropdown-item.vue +16 -11
- package/dist/dropdown-menu/README.en-US.md +1 -1
- package/dist/dropdown-menu/README.md +1 -1
- package/dist/dropdown-menu/dropdown-menu.vue +11 -9
- package/dist/empty/README.en-US.md +1 -1
- package/dist/empty/README.md +1 -1
- package/dist/empty/empty.vue +5 -4
- package/dist/fab/README.en-US.md +1 -1
- package/dist/fab/README.md +1 -1
- package/dist/fab/fab.vue +9 -6
- package/dist/fab/props.ts +1 -1
- package/dist/fab/type.ts +1 -1
- package/dist/footer/README.en-US.md +1 -1
- package/dist/footer/README.md +1 -1
- package/dist/footer/footer.vue +8 -7
- package/dist/form/README.en-US.md +3 -1
- package/dist/form/README.md +3 -1
- package/dist/form/form.vue +4 -2
- package/dist/form/props.ts +9 -0
- package/dist/form/type.ts +5 -0
- package/dist/form-item/README.en-US.md +2 -1
- package/dist/form-item/README.md +2 -1
- package/dist/form-item/form-item.css +2 -2
- package/dist/form-item/form-item.vue +36 -27
- package/dist/form-item/props.ts +8 -0
- package/dist/form-item/type.ts +4 -0
- package/dist/grid/README.en-US.md +1 -1
- package/dist/grid/README.md +1 -1
- package/dist/grid/grid.vue +4 -3
- package/dist/grid-item/README.en-US.md +1 -1
- package/dist/grid-item/README.md +1 -1
- package/dist/grid-item/grid-item.vue +8 -6
- package/dist/guide/README.en-US.md +1 -1
- package/dist/guide/README.md +1 -1
- package/dist/guide/guide.vue +8 -7
- package/dist/icon/icon.vue +5 -2
- package/dist/image/README.en-US.md +1 -1
- package/dist/image/README.md +1 -1
- package/dist/image/image.vue +6 -5
- package/dist/image-viewer/README.en-US.md +4 -3
- package/dist/image-viewer/README.md +4 -3
- package/dist/image-viewer/image-viewer.css +12 -0
- package/dist/image-viewer/image-viewer.vue +84 -21
- package/dist/image-viewer/props.ts +5 -0
- package/dist/image-viewer/type.ts +6 -1
- package/dist/indexes/README.en-US.md +1 -1
- package/dist/indexes/README.md +1 -1
- package/dist/indexes/computed.js +6 -2
- package/dist/indexes/indexes.css +7 -2
- package/dist/indexes/indexes.vue +8 -5
- package/dist/indexes/props.ts +5 -0
- package/dist/indexes/type.ts +5 -0
- package/dist/indexes-anchor/README.en-US.md +1 -1
- package/dist/indexes-anchor/README.md +1 -1
- package/dist/indexes-anchor/indexes-anchor.vue +5 -3
- package/dist/input/README.en-US.md +1 -1
- package/dist/input/README.md +1 -1
- package/dist/input/input.vue +9 -7
- package/dist/link/README.en-US.md +1 -1
- package/dist/link/README.md +1 -1
- package/dist/link/link.vue +6 -3
- package/dist/loading/README.en-US.md +1 -1
- package/dist/loading/README.md +1 -1
- package/dist/loading/loading.vue +4 -2
- package/dist/message/index.js +2 -1
- package/dist/message/message.vue +4 -3
- package/dist/message-item/index.js +1 -1
- package/dist/message-item/message-item.vue +7 -5
- package/dist/mixins/page-scroll.js +1 -1
- package/dist/mixins/using-config.js +1 -1
- package/dist/mixins/using-custom-navbar.js +1 -1
- package/dist/navbar/README.en-US.md +1 -1
- package/dist/navbar/README.md +2 -2
- package/dist/navbar/navbar.vue +5 -4
- package/dist/notice-bar/README.en-US.md +1 -1
- package/dist/notice-bar/README.md +1 -1
- package/dist/notice-bar/notice-bar.vue +4 -3
- package/dist/overlay/README.en-US.md +1 -1
- package/dist/overlay/README.md +1 -1
- package/dist/overlay/overlay.vue +6 -3
- package/dist/picker/README.en-US.md +1 -1
- package/dist/picker/README.md +1 -1
- package/dist/picker/picker.vue +11 -9
- package/dist/picker-item/README.en-US.md +1 -1
- package/dist/picker-item/README.md +1 -1
- package/dist/picker-item/picker-item.vue +6 -5
- package/dist/popover/README.en-US.md +1 -1
- package/dist/popover/README.md +1 -1
- package/dist/popover/popover.vue +8 -5
- package/dist/popup/README.en-US.md +1 -1
- package/dist/popup/README.md +1 -1
- package/dist/popup/popup.vue +8 -5
- package/dist/progress/README.en-US.md +1 -1
- package/dist/progress/README.md +1 -1
- package/dist/progress/progress.vue +5 -4
- package/dist/pull-down-refresh/README.en-US.md +1 -1
- package/dist/pull-down-refresh/README.md +1 -1
- package/dist/pull-down-refresh/pull-down-refresh.vue +7 -5
- package/dist/qrcode/components/qrcode-canvas/qrcode-canvas.vue +8 -7
- package/dist/qrcode/components/qrcode-status/qrcode-status.vue +2 -1
- package/dist/qrcode/qrcode.vue +5 -3
- package/dist/radio/README.en-US.md +1 -1
- package/dist/radio/README.md +1 -1
- package/dist/radio/radio.vue +5 -4
- package/dist/radio-group/radio-group.vue +5 -4
- package/dist/rate/README.en-US.md +1 -1
- package/dist/rate/README.md +1 -1
- package/dist/rate/rate.vue +8 -5
- package/dist/result/README.en-US.md +1 -1
- package/dist/result/README.md +1 -1
- package/dist/result/result.vue +5 -4
- package/dist/row/row.vue +7 -3
- package/dist/scroll-view/scroll-view.vue +1 -1
- package/dist/search/README.en-US.md +1 -1
- package/dist/search/README.md +1 -1
- package/dist/search/search.css +5 -0
- package/dist/search/search.vue +21 -21
- package/dist/segmented/README.en-US.md +42 -0
- package/dist/segmented/README.md +75 -0
- package/dist/segmented/props.ts +31 -0
- package/dist/segmented/segmented.css +66 -0
- package/dist/segmented/segmented.vue +177 -0
- package/dist/segmented/type.ts +41 -0
- package/dist/side-bar/README.en-US.md +1 -1
- package/dist/side-bar/README.md +1 -1
- package/dist/side-bar/side-bar.vue +5 -3
- package/dist/side-bar-item/side-bar-item.vue +7 -6
- package/dist/skeleton/README.en-US.md +1 -1
- package/dist/skeleton/README.md +1 -1
- package/dist/skeleton/skeleton.vue +6 -3
- package/dist/slider/README.en-US.md +1 -1
- package/dist/slider/README.md +1 -1
- package/dist/slider/slider.vue +7 -5
- package/dist/step-item/step-item.vue +5 -4
- package/dist/stepper/README.en-US.md +1 -1
- package/dist/stepper/README.md +1 -1
- package/dist/stepper/stepper.vue +5 -3
- package/dist/steps/README.en-US.md +1 -1
- package/dist/steps/README.md +1 -1
- package/dist/steps/steps.vue +5 -3
- package/dist/sticky/sticky.vue +4 -3
- package/dist/swipe-cell/swipe-cell.vue +7 -5
- package/dist/swiper/README.en-US.md +1 -1
- package/dist/swiper/README.md +1 -1
- package/dist/swiper/swiper.vue +7 -5
- package/dist/swiper-nav/swiper-nav.vue +6 -3
- package/dist/switch/README.en-US.md +1 -1
- package/dist/switch/README.md +1 -1
- package/dist/switch/switch.vue +5 -4
- package/dist/tab-bar/README.en-US.md +1 -1
- package/dist/tab-bar/README.md +1 -1
- package/dist/tab-bar/tab-bar.vue +5 -3
- package/dist/tab-bar-item/tab-bar-item.vue +10 -10
- package/dist/tab-panel/tab-panel.vue +5 -3
- package/dist/table/README.en-US.md +72 -0
- package/dist/table/README.md +117 -0
- package/dist/table/base-table-props.ts +105 -0
- package/dist/table/props.ts +94 -0
- package/dist/table/table.css +251 -0
- package/dist/table/table.vue +582 -0
- package/dist/table/type.ts +180 -0
- package/dist/tabs/README.en-US.md +1 -1
- package/dist/tabs/README.md +1 -1
- package/dist/tabs/tabs.css +4 -0
- package/dist/tabs/tabs.vue +11 -9
- package/dist/tag/README.en-US.md +1 -1
- package/dist/tag/README.md +1 -1
- package/dist/tag/tag.vue +6 -3
- package/dist/textarea/README.en-US.md +1 -1
- package/dist/textarea/README.md +1 -1
- package/dist/textarea/textarea.vue +6 -3
- package/dist/theme-light.css +282 -0
- package/dist/theme-light.css.d.ts +2 -0
- package/dist/theme-light.less +1 -0
- package/dist/theme-light.less.d.ts +2 -0
- package/dist/toast/README.en-US.md +1 -1
- package/dist/toast/README.md +1 -1
- package/dist/toast/toast.vue +8 -7
- package/dist/transition/transition.vue +2 -2
- package/dist/tree-select/README.en-US.md +1 -1
- package/dist/tree-select/README.md +1 -1
- package/dist/tree-select/tree-select.vue +14 -9
- package/dist/types/action-sheet.d.ts +1 -1
- package/dist/types/avatar-group.d.ts +1 -1
- package/dist/types/avatar.d.ts +1 -1
- package/dist/types/back-top.d.ts +1 -1
- package/dist/types/badge.d.ts +1 -1
- package/dist/types/button.d.ts +1 -1
- package/dist/types/calendar.d.ts +1 -1
- package/dist/types/cascader.d.ts +1 -1
- package/dist/types/cell-group.d.ts +1 -1
- package/dist/types/cell.d.ts +1 -1
- package/dist/types/check-tag.d.ts +1 -1
- package/dist/types/checkbox-group.d.ts +1 -1
- package/dist/types/checkbox.d.ts +1 -1
- package/dist/types/col.d.ts +1 -1
- package/dist/types/collapse-panel.d.ts +1 -1
- package/dist/types/collapse.d.ts +1 -1
- package/dist/types/color-picker.d.ts +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/segmented.d.ts +7 -0
- package/dist/types/table.d.ts +7 -0
- package/dist/upload/README.en-US.md +1 -1
- package/dist/upload/README.md +1 -1
- package/dist/upload/upload.vue +32 -32
- package/dist/watermark/README.en-US.md +1 -1
- package/dist/watermark/README.md +1 -1
- package/dist/watermark/utils/generateBase64Url.js +6 -6
- package/dist/watermark/watermark.vue +4 -3
- package/global.d.ts +2 -0
- package/package.json +33 -9
- package/{dist/script → script}/postinstall.js +18 -2
package/dist/popup/popup.vue
CHANGED
|
@@ -67,15 +67,18 @@
|
|
|
67
67
|
</view>
|
|
68
68
|
</template>
|
|
69
69
|
<script>
|
|
70
|
-
import TOverlay from '../overlay/overlay';
|
|
71
|
-
import TIcon from '../icon/icon';
|
|
72
|
-
import { uniComponent } from '../common/src/index';
|
|
73
70
|
import { prefix } from '../common/config';
|
|
74
|
-
import
|
|
71
|
+
import { uniComponent } from '../common/src/index';
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
import tools from '../common/utils.wxs';
|
|
75
|
+
import TIcon from '../icon/icon';
|
|
75
76
|
import { transitionMixins } from '../mixins/transition';
|
|
76
77
|
import useCustomNavbar from '../mixins/using-custom-navbar';
|
|
77
|
-
import
|
|
78
|
+
import TOverlay from '../overlay/overlay';
|
|
79
|
+
|
|
78
80
|
import popup from './computed.js';
|
|
81
|
+
import props from './props';
|
|
79
82
|
|
|
80
83
|
delete props.visible;
|
|
81
84
|
|
|
@@ -33,7 +33,7 @@ t-class-label | \-
|
|
|
33
33
|
### CSS Variables
|
|
34
34
|
|
|
35
35
|
The component provides the following CSS variables, which can be used to customize styles.
|
|
36
|
-
Name | Default Value | Description
|
|
36
|
+
Name | Default Value | Description
|
|
37
37
|
-- | -- | --
|
|
38
38
|
--td-progress-info-dark-color | @text-color-primary | -
|
|
39
39
|
--td-progress-info-light-color | @text-color-anti | -
|
package/dist/progress/README.md
CHANGED
|
@@ -147,13 +147,12 @@
|
|
|
147
147
|
</view>
|
|
148
148
|
</template>
|
|
149
149
|
<script>
|
|
150
|
-
import TIcon from '../icon/icon';
|
|
151
|
-
import { uniComponent } from '../common/src/index';
|
|
152
150
|
import { prefix } from '../common/config';
|
|
153
|
-
import
|
|
154
|
-
|
|
151
|
+
import { uniComponent } from '../common/src/index';
|
|
152
|
+
|
|
155
153
|
import { unitConvert, isIOS as isIOSValidator } from '../common/utils';
|
|
156
154
|
import tools from '../common/utils.wxs';
|
|
155
|
+
import TIcon from '../icon/icon';
|
|
157
156
|
|
|
158
157
|
import {
|
|
159
158
|
STATUS,
|
|
@@ -168,6 +167,8 @@ import {
|
|
|
168
167
|
getIOSAriaLabel,
|
|
169
168
|
getAndroidAriaLabel,
|
|
170
169
|
} from './computed.js';
|
|
170
|
+
import props from './props';
|
|
171
|
+
import { getBackgroundColor } from './utils';
|
|
171
172
|
|
|
172
173
|
|
|
173
174
|
const name = `${prefix}-progress`;
|
|
@@ -55,6 +55,6 @@ t-class-text | \-
|
|
|
55
55
|
### CSS Variables
|
|
56
56
|
|
|
57
57
|
The component provides the following CSS variables, which can be used to customize styles.
|
|
58
|
-
Name | Default Value | Description
|
|
58
|
+
Name | Default Value | Description
|
|
59
59
|
-- | -- | --
|
|
60
60
|
--td-pull-down-refresh-color | @text-color-placeholder | -
|
|
@@ -60,17 +60,19 @@
|
|
|
60
60
|
</scroll-view>
|
|
61
61
|
</template>
|
|
62
62
|
<script>
|
|
63
|
-
import TLoading from '../loading/loading';
|
|
64
|
-
import { uniComponent } from '../common/src/index';
|
|
65
63
|
import { prefix } from '../common/config';
|
|
66
|
-
|
|
64
|
+
|
|
65
|
+
import { ParentMixin, RELATION_MAP } from '../common/relation';
|
|
66
|
+
import { uniComponent } from '../common/src/index';
|
|
67
67
|
import { getRect, systemInfo, unitConvert } from '../common/utils';
|
|
68
68
|
import tools from '../common/utils.wxs';
|
|
69
69
|
import { getObserver } from '../common/wechat';
|
|
70
|
-
import
|
|
70
|
+
import TLoading from '../loading/loading';
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
import usingConfig from '../mixins/using-config';
|
|
74
|
+
|
|
75
|
+
import props from './props';
|
|
74
76
|
const componentName = 'pull-down-refresh';
|
|
75
77
|
const name = `${prefix}-${componentName}`;
|
|
76
78
|
const defaultLoadingTexts = ['下拉刷新', '松手刷新', '正在刷新', '刷新完成'];
|
|
@@ -345,7 +347,7 @@ export default {
|
|
|
345
347
|
scrollToTop() {
|
|
346
348
|
let parsed = false;
|
|
347
349
|
|
|
348
|
-
// #ifdef APP
|
|
350
|
+
// #ifdef APP || MP
|
|
349
351
|
this.scrollTop = 0;
|
|
350
352
|
setTimeout(() => {
|
|
351
353
|
this.scrollTop = 0.01;
|
|
@@ -15,13 +15,14 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<script>
|
|
18
|
-
import
|
|
19
|
-
import
|
|
18
|
+
import { loadImage } from '../../../common/canvas/index';
|
|
19
|
+
import { prefix } from '../../../common/config';
|
|
20
20
|
import { DEFAULT_MINVERSION, excavateModules, isSupportPath2d, generatePath } from '../../../common/shared/qrcode/utils';
|
|
21
21
|
import { uniComponent } from '../../../common/src/index';
|
|
22
|
-
import { prefix } from '../../../common/config';
|
|
23
|
-
import { loadImage } from '../../../common/canvas/index';
|
|
24
22
|
import { getWindowInfo, nextTick } from '../../../common/utils';
|
|
23
|
+
import useQRCode from '../../hooks/useQRCode';
|
|
24
|
+
|
|
25
|
+
import props from './props';
|
|
25
26
|
|
|
26
27
|
export default {
|
|
27
28
|
...uniComponent({
|
|
@@ -63,7 +64,7 @@ export default {
|
|
|
63
64
|
},
|
|
64
65
|
size() {
|
|
65
66
|
let interval = 0;
|
|
66
|
-
// #ifdef APP
|
|
67
|
+
// #ifdef APP
|
|
67
68
|
interval = 33;
|
|
68
69
|
// #endif
|
|
69
70
|
setTimeout(() => {
|
|
@@ -239,7 +240,7 @@ export default {
|
|
|
239
240
|
canvas.height = canvasSize;
|
|
240
241
|
// 小程序环境:scale 计算方式(参考 TS 实现)
|
|
241
242
|
scale = canvasSize / qrData.numCells;
|
|
242
|
-
// #ifdef APP
|
|
243
|
+
// #ifdef APP
|
|
243
244
|
scale /= pixelRatio;
|
|
244
245
|
// #endif
|
|
245
246
|
// #endif
|
|
@@ -297,7 +298,7 @@ export default {
|
|
|
297
298
|
await this.drawIcon(qrData, pixelRatio);
|
|
298
299
|
}
|
|
299
300
|
|
|
300
|
-
// #ifdef APP
|
|
301
|
+
// #ifdef APP
|
|
301
302
|
ctx.draw();
|
|
302
303
|
// #endif
|
|
303
304
|
|
|
@@ -51,10 +51,11 @@
|
|
|
51
51
|
</template>
|
|
52
52
|
|
|
53
53
|
<script>
|
|
54
|
+
import { prefix } from '../../../common/config';
|
|
54
55
|
import TIcon from '../../../icon/icon';
|
|
55
56
|
import TLoading from '../../../loading/loading';
|
|
57
|
+
|
|
56
58
|
import props from './props';
|
|
57
|
-
import { prefix } from '../../../common/config';
|
|
58
59
|
|
|
59
60
|
const name = `${prefix}-qrcode`;
|
|
60
61
|
|
package/dist/qrcode/qrcode.vue
CHANGED
|
@@ -36,14 +36,16 @@
|
|
|
36
36
|
</template>
|
|
37
37
|
|
|
38
38
|
<script>
|
|
39
|
-
import QrcodeCanvas from './components/qrcode-canvas/qrcode-canvas.vue';
|
|
40
|
-
import QrcodeStatus from './components/qrcode-status/qrcode-status.vue';
|
|
41
39
|
import { prefix } from '../common/config';
|
|
42
|
-
|
|
40
|
+
|
|
43
41
|
import { uniComponent } from '../common/src/index';
|
|
44
42
|
import tools from '../common/utils.wxs';
|
|
45
43
|
|
|
46
44
|
import usingConfig from '../mixins/using-config';
|
|
45
|
+
|
|
46
|
+
import QrcodeCanvas from './components/qrcode-canvas/qrcode-canvas.vue';
|
|
47
|
+
import QrcodeStatus from './components/qrcode-status/qrcode-status.vue';
|
|
48
|
+
import props from './props';
|
|
47
49
|
const componentName = 'qrcode';
|
|
48
50
|
const name = `${prefix}-${componentName}`;
|
|
49
51
|
|
|
@@ -83,7 +83,7 @@ name | Description
|
|
|
83
83
|
### CSS Variables
|
|
84
84
|
|
|
85
85
|
The component provides the following CSS variables, which can be used to customize styles.
|
|
86
|
-
Name | Default Value | Description
|
|
86
|
+
Name | Default Value | Description
|
|
87
87
|
-- | -- | --
|
|
88
88
|
--td-radio-bg-color | @bg-color-container | -
|
|
89
89
|
--td-radio-border-color | @component-stroke | -
|
package/dist/radio/README.md
CHANGED
|
@@ -129,7 +129,7 @@ change | `(context: { value: RadioValue })` | 选中值发生变化时触发
|
|
|
129
129
|
### CSS Variables
|
|
130
130
|
|
|
131
131
|
组件提供了下列 CSS 变量,可用于自定义样式。
|
|
132
|
-
名称 | 默认值 | 描述
|
|
132
|
+
名称 | 默认值 | 描述
|
|
133
133
|
-- | -- | --
|
|
134
134
|
--td-radio-bg-color | @bg-color-container | -
|
|
135
135
|
--td-radio-border-color | @component-stroke | -
|
package/dist/radio/radio.vue
CHANGED
|
@@ -87,13 +87,14 @@
|
|
|
87
87
|
</view>
|
|
88
88
|
</template>
|
|
89
89
|
<script>
|
|
90
|
-
import TIcon from '../icon/icon';
|
|
91
90
|
import { prefix, ISOLATED_RELATION_KEY } from '../common/config';
|
|
92
|
-
import {
|
|
91
|
+
import { ChildrenMixin, RELATION_MAP } from '../common/relation';
|
|
93
92
|
import { uniComponent } from '../common/src/index';
|
|
94
|
-
import
|
|
93
|
+
import { coalesce } from '../common/utils';
|
|
95
94
|
import tools from '../common/utils.wxs';
|
|
96
|
-
import
|
|
95
|
+
import TIcon from '../icon/icon';
|
|
96
|
+
|
|
97
|
+
import props from './props';
|
|
97
98
|
|
|
98
99
|
|
|
99
100
|
const name = `${prefix}-radio`;
|
|
@@ -34,13 +34,14 @@
|
|
|
34
34
|
</view>
|
|
35
35
|
</template>
|
|
36
36
|
<script>
|
|
37
|
-
import TRadio from '../radio/radio';
|
|
38
37
|
import { prefix } from '../common/config';
|
|
39
|
-
import {
|
|
38
|
+
import { ParentMixin, RELATION_MAP } from '../common/relation';
|
|
40
39
|
import { uniComponent } from '../common/src/index';
|
|
41
|
-
import
|
|
40
|
+
import { coalesce } from '../common/utils';
|
|
42
41
|
import tools from '../common/utils.wxs';
|
|
43
|
-
import
|
|
42
|
+
import TRadio from '../radio/radio';
|
|
43
|
+
|
|
44
|
+
import props from './props';
|
|
44
45
|
|
|
45
46
|
|
|
46
47
|
const name = `${prefix}-radio-group`;
|
|
@@ -39,7 +39,7 @@ t-class-text | \-
|
|
|
39
39
|
### CSS Variables
|
|
40
40
|
|
|
41
41
|
The component provides the following CSS variables, which can be used to customize styles.
|
|
42
|
-
Name | Default Value | Description
|
|
42
|
+
Name | Default Value | Description
|
|
43
43
|
-- | -- | --
|
|
44
44
|
--td-rate-icon-scale | 1.33 | -
|
|
45
45
|
--td-rate-selected-color | @warning-color | -
|
package/dist/rate/README.md
CHANGED
package/dist/rate/rate.vue
CHANGED
|
@@ -110,17 +110,20 @@
|
|
|
110
110
|
</view>
|
|
111
111
|
</template>
|
|
112
112
|
<script>
|
|
113
|
-
import TIcon from '../icon/icon';
|
|
114
|
-
import { uniComponent } from '../common/src/index';
|
|
115
113
|
import { prefix } from '../common/config';
|
|
116
|
-
|
|
114
|
+
|
|
115
|
+
import { parseEventDynamicCode } from '../common/event/dynamic';
|
|
116
|
+
import { uniComponent } from '../common/src/index';
|
|
117
117
|
import { unitConvert, getRect, coalesce } from '../common/utils';
|
|
118
118
|
import tools from '../common/utils.wxs';
|
|
119
|
-
import
|
|
120
|
-
import { parseEventDynamicCode } from '../common/event/dynamic';
|
|
119
|
+
import TIcon from '../icon/icon';
|
|
121
120
|
|
|
122
121
|
|
|
123
122
|
import usingConfig from '../mixins/using-config';
|
|
123
|
+
|
|
124
|
+
import utils from './computed.js';
|
|
125
|
+
|
|
126
|
+
import props from './props';
|
|
124
127
|
const componentName = 'rate';
|
|
125
128
|
const name = `${prefix}-${componentName}`;
|
|
126
129
|
|
|
@@ -33,7 +33,7 @@ t-class-title | \-
|
|
|
33
33
|
### CSS Variables
|
|
34
34
|
|
|
35
35
|
The component provides the following CSS variables, which can be used to customize styles.
|
|
36
|
-
Name | Default Value | Description
|
|
36
|
+
Name | Default Value | Description
|
|
37
37
|
-- | -- | --
|
|
38
38
|
--td-result-description-color | @text-color-secondary | -
|
|
39
39
|
--td-result-description-font | @font-body-medium | -
|
package/dist/result/README.md
CHANGED
package/dist/result/result.vue
CHANGED
|
@@ -60,13 +60,14 @@
|
|
|
60
60
|
</template>
|
|
61
61
|
|
|
62
62
|
<script>
|
|
63
|
-
import TIcon from '../icon/icon';
|
|
64
|
-
import TImage from '../image/image';
|
|
65
|
-
import { uniComponent } from '../common/src/index';
|
|
66
|
-
import props from './props';
|
|
67
63
|
import { prefix } from '../common/config';
|
|
64
|
+
import { uniComponent } from '../common/src/index';
|
|
68
65
|
import { calcIcon } from '../common/utils';
|
|
69
66
|
import tools from '../common/utils.wxs';
|
|
67
|
+
import TIcon from '../icon/icon';
|
|
68
|
+
import TImage from '../image/image';
|
|
69
|
+
|
|
70
|
+
import props from './props';
|
|
70
71
|
|
|
71
72
|
|
|
72
73
|
const name = `${prefix}-result`;
|
package/dist/row/row.vue
CHANGED
|
@@ -7,12 +7,16 @@
|
|
|
7
7
|
</view>
|
|
8
8
|
</template>
|
|
9
9
|
<script>
|
|
10
|
-
import { uniComponent } from '../common/src/index';
|
|
11
10
|
import { prefix } from '../common/config';
|
|
12
|
-
import
|
|
11
|
+
import { ParentMixin, RELATION_MAP } from '../common/relation';
|
|
12
|
+
import { uniComponent } from '../common/src/index';
|
|
13
|
+
|
|
14
|
+
|
|
13
15
|
import tools from '../common/utils.wxs';
|
|
16
|
+
|
|
14
17
|
import { getRowStyles } from './computed.js';
|
|
15
|
-
import
|
|
18
|
+
import props from './props';
|
|
19
|
+
|
|
16
20
|
|
|
17
21
|
const name = `${prefix}-row`;
|
|
18
22
|
|
|
@@ -69,7 +69,7 @@ t-class-left | \-
|
|
|
69
69
|
### CSS Variables
|
|
70
70
|
|
|
71
71
|
The component provides the following CSS variables, which can be used to customize styles.
|
|
72
|
-
Name | Default Value | Description
|
|
72
|
+
Name | Default Value | Description
|
|
73
73
|
-- | -- | --
|
|
74
74
|
--td-search-action-color | @brand-color | -
|
|
75
75
|
--td-search-bg-color | @bg-color-secondarycontainer | -
|
package/dist/search/README.md
CHANGED
package/dist/search/search.css
CHANGED
|
@@ -67,6 +67,11 @@
|
|
|
67
67
|
:deep(.t-search__result-item--highLight) {
|
|
68
68
|
color: var(--td-search-result-high-light-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
|
|
69
69
|
}
|
|
70
|
+
.t-search__result-list {
|
|
71
|
+
max-height: 560rpx;
|
|
72
|
+
overflow-y: auto;
|
|
73
|
+
-webkit-overflow-scrolling: touch;
|
|
74
|
+
}
|
|
70
75
|
.t-search__result-list :deep(.t-search__result-item) {
|
|
71
76
|
padding-left: 0;
|
|
72
77
|
}
|
package/dist/search/search.vue
CHANGED
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
/>
|
|
78
78
|
</view>
|
|
79
79
|
<view
|
|
80
|
-
v-if="
|
|
80
|
+
v-if="isSearching && resultList.length > 0 && !isSelected"
|
|
81
81
|
:class="classPrefix + '__result-list'"
|
|
82
82
|
aria-role="listbox"
|
|
83
83
|
>
|
|
@@ -102,14 +102,17 @@
|
|
|
102
102
|
</view>
|
|
103
103
|
</template>
|
|
104
104
|
<script>
|
|
105
|
-
import TIcon from '../icon/icon';
|
|
106
105
|
import TCell from '../cell/cell';
|
|
107
|
-
import { uniComponent } from '../common/src/index';
|
|
108
106
|
import { prefix } from '../common/config';
|
|
109
|
-
import
|
|
107
|
+
import { uniComponent } from '../common/src/index';
|
|
108
|
+
|
|
109
|
+
|
|
110
110
|
import { getCharacterLength, nextTick } from '../common/utils';
|
|
111
111
|
import tools from '../common/utils.wxs';
|
|
112
|
+
import TIcon from '../icon/icon';
|
|
113
|
+
|
|
112
114
|
import { highLight } from './computed.js';
|
|
115
|
+
import props from './props';
|
|
113
116
|
// import { getInnerMaxLen } from '../input/utils';
|
|
114
117
|
|
|
115
118
|
const name = `${prefix}-search`;
|
|
@@ -142,8 +145,8 @@ export default {
|
|
|
142
145
|
return {
|
|
143
146
|
classPrefix: name,
|
|
144
147
|
prefix,
|
|
145
|
-
isShowResultList: false,
|
|
146
148
|
isSelected: false,
|
|
149
|
+
isSearching: false,
|
|
147
150
|
showClearIcon: false,
|
|
148
151
|
tools,
|
|
149
152
|
|
|
@@ -156,16 +159,8 @@ export default {
|
|
|
156
159
|
resultList: {
|
|
157
160
|
handler(val) {
|
|
158
161
|
const { isSelected } = this;
|
|
159
|
-
if (val.length) {
|
|
160
|
-
|
|
161
|
-
// 已选择
|
|
162
|
-
this.isShowResultList = false;
|
|
163
|
-
this.isSelected = false;
|
|
164
|
-
} else {
|
|
165
|
-
this.isShowResultList = true;
|
|
166
|
-
}
|
|
167
|
-
} else {
|
|
168
|
-
this.isShowResultList = false;
|
|
162
|
+
if (val.length && isSelected) {
|
|
163
|
+
this.isSelected = false;
|
|
169
164
|
}
|
|
170
165
|
},
|
|
171
166
|
immediate: true,
|
|
@@ -205,7 +200,10 @@ export default {
|
|
|
205
200
|
|
|
206
201
|
this.showClearIcon = value || String(clearTrigger) === 'always';
|
|
207
202
|
},
|
|
208
|
-
|
|
203
|
+
emitChange(data) {
|
|
204
|
+
this.$emit('update:value', data.value);
|
|
205
|
+
this.$emit('change', data);
|
|
206
|
+
},
|
|
209
207
|
onInput(e) {
|
|
210
208
|
let { value } = e.detail;
|
|
211
209
|
// this.rawValue = value;
|
|
@@ -221,7 +219,7 @@ export default {
|
|
|
221
219
|
|
|
222
220
|
nextTick().then(() => {
|
|
223
221
|
this.dataValue = value;
|
|
224
|
-
this
|
|
222
|
+
this.emitChange({
|
|
225
223
|
value,
|
|
226
224
|
trigger: 'input-change',
|
|
227
225
|
});
|
|
@@ -231,6 +229,7 @@ export default {
|
|
|
231
229
|
|
|
232
230
|
onFocus(e) {
|
|
233
231
|
const { value } = e.detail;
|
|
232
|
+
this.isSearching = true;
|
|
234
233
|
this.updateClearIconVisible(true);
|
|
235
234
|
this.$emit('focus', { value });
|
|
236
235
|
},
|
|
@@ -243,11 +242,12 @@ export default {
|
|
|
243
242
|
|
|
244
243
|
handleClear() {
|
|
245
244
|
this.dataValue = '';
|
|
246
|
-
this
|
|
247
|
-
this
|
|
245
|
+
this.isSearching = false;
|
|
246
|
+
this.emitChange({
|
|
248
247
|
value: '',
|
|
249
248
|
trigger: 'clear',
|
|
250
249
|
});
|
|
250
|
+
this.$emit('clear', { value: '' });
|
|
251
251
|
},
|
|
252
252
|
|
|
253
253
|
onConfirm(e) {
|
|
@@ -256,6 +256,7 @@ export default {
|
|
|
256
256
|
},
|
|
257
257
|
|
|
258
258
|
onActionClick() {
|
|
259
|
+
this.isSearching = false;
|
|
259
260
|
this.$emit('action-click');
|
|
260
261
|
},
|
|
261
262
|
|
|
@@ -263,8 +264,7 @@ export default {
|
|
|
263
264
|
const item = this.resultList[index];
|
|
264
265
|
this.dataValue = item;
|
|
265
266
|
this.isSelected = true;
|
|
266
|
-
|
|
267
|
-
this.$emit('change', {
|
|
267
|
+
this.emitChange({
|
|
268
268
|
value: item,
|
|
269
269
|
trigger: 'option-click',
|
|
270
270
|
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
:: BASE_DOC ::
|
|
2
|
+
|
|
3
|
+
## API
|
|
4
|
+
|
|
5
|
+
### Segmented Props
|
|
6
|
+
|
|
7
|
+
name | type | default | description | required
|
|
8
|
+
-- | -- | -- | -- | --
|
|
9
|
+
custom-style | Object | - | CSS(Cascading Style Sheets) | N
|
|
10
|
+
block | Boolean | false | \- | N
|
|
11
|
+
disabled | Boolean | - | \- | N
|
|
12
|
+
options | Object | [] | Typescript: `string[] \| number[] \| SegmentedItem[] ` `interface SegmentedItem { value: string \| number; label?: string; icon?: string \| object; disabled?: boolean }`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/segmented/type.ts) | N
|
|
13
|
+
value | String / Number | - | `v-model:value` is supported | N
|
|
14
|
+
default-value | String / Number | - | uncontrolled property | N
|
|
15
|
+
|
|
16
|
+
### Segmented Events
|
|
17
|
+
|
|
18
|
+
name | params | description
|
|
19
|
+
-- | -- | --
|
|
20
|
+
change | `(context: { value: string \| number, selectedOption: SegmentedItem })` | \-
|
|
21
|
+
|
|
22
|
+
### Segmented External Classes
|
|
23
|
+
|
|
24
|
+
className | Description
|
|
25
|
+
-- | --
|
|
26
|
+
t-class | \-
|
|
27
|
+
t-class-item | \-
|
|
28
|
+
t-class-thumb | \-
|
|
29
|
+
|
|
30
|
+
### CSS Variables
|
|
31
|
+
|
|
32
|
+
The component provides the following CSS variables, which can be used to customize styles.
|
|
33
|
+
Name | Default Value | Description
|
|
34
|
+
-- | -- | --
|
|
35
|
+
--td-font-size-m | 32rpx | -
|
|
36
|
+
--td-segmented-bg-color | @bg-color-component-disabled | -
|
|
37
|
+
--td-segmented-item-active-bg | @bg-color-container | -
|
|
38
|
+
--td-segmented-item-active-color | @brand-color | -
|
|
39
|
+
--td-segmented-item-color | @text-color-primary | -
|
|
40
|
+
--td-segmented-item-disabled-color | @text-color-disabled | -
|
|
41
|
+
--td-segmented-item-label-font | @font-body-medium | -
|
|
42
|
+
--td-segmented-transition | all @anim-duration-base @anim-time-fn-easing | -
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Segmented 分段控制器
|
|
3
|
+
description: 用于展示多个选项并允许用户选择其中单个选项。
|
|
4
|
+
spline: data
|
|
5
|
+
isComponent: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## 引入
|
|
10
|
+
|
|
11
|
+
推荐使用 easycom 模式引入组件,配置后无需手动 import 即可直接在模板中使用 `<t-segmented />`。详细配置请参考 [快速开始](../getting-started)。
|
|
12
|
+
|
|
13
|
+
如需手动引入:
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import TSegmented from '@tdesign/uniapp/segmented/segmented.vue';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### 组件类型
|
|
20
|
+
|
|
21
|
+
基础
|
|
22
|
+
|
|
23
|
+
{{ base }}
|
|
24
|
+
|
|
25
|
+
自适应宽度
|
|
26
|
+
|
|
27
|
+
{{ block }}
|
|
28
|
+
|
|
29
|
+
### 组件状态
|
|
30
|
+
|
|
31
|
+
控制器禁用态
|
|
32
|
+
|
|
33
|
+
{{ disabled }}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## API
|
|
37
|
+
|
|
38
|
+
### Segmented Props
|
|
39
|
+
|
|
40
|
+
名称 | 类型 | 默认值 | 描述 | 必传
|
|
41
|
+
-- | -- | -- | -- | --
|
|
42
|
+
custom-style | Object | - | 自定义样式 | N
|
|
43
|
+
block | Boolean | false | 是否撑满父元素宽度 | N
|
|
44
|
+
disabled | Boolean | - | 是否禁用 | N
|
|
45
|
+
options | Object | [] | 数据化配置选项内容。TS 类型:`string[] \| number[] \| SegmentedItem[] ` `interface SegmentedItem { value: string \| number; label?: string; icon?: string \| object; disabled?: boolean }`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/segmented/type.ts) | N
|
|
46
|
+
value | String / Number | - | 当前选中的值。支持语法糖 `v-model:value` | N
|
|
47
|
+
default-value | String / Number | - | 当前选中的值。非受控属性 | N
|
|
48
|
+
|
|
49
|
+
### Segmented Events
|
|
50
|
+
|
|
51
|
+
名称 | 参数 | 描述
|
|
52
|
+
-- | -- | --
|
|
53
|
+
change | `(context: { value: string \| number, selectedOption: SegmentedItem })` | 选项值发生变化时触发
|
|
54
|
+
|
|
55
|
+
### Segmented External Classes
|
|
56
|
+
|
|
57
|
+
类名 | 描述
|
|
58
|
+
-- | --
|
|
59
|
+
t-class | 根节点样式类
|
|
60
|
+
t-class-item | 列表子项样式类
|
|
61
|
+
t-class-thumb | 动画背景样式类
|
|
62
|
+
|
|
63
|
+
### CSS Variables
|
|
64
|
+
|
|
65
|
+
组件提供了下列 CSS 变量,可用于自定义样式。
|
|
66
|
+
名称 | 默认值 | 描述
|
|
67
|
+
-- | -- | --
|
|
68
|
+
--td-font-size-m | 32rpx | -
|
|
69
|
+
--td-segmented-bg-color | @bg-color-component-disabled | -
|
|
70
|
+
--td-segmented-item-active-bg | @bg-color-container | -
|
|
71
|
+
--td-segmented-item-active-color | @brand-color | -
|
|
72
|
+
--td-segmented-item-color | @text-color-primary | -
|
|
73
|
+
--td-segmented-item-disabled-color | @text-color-disabled | -
|
|
74
|
+
--td-segmented-item-label-font | @font-body-medium | -
|
|
75
|
+
--td-segmented-transition | all @anim-duration-base @anim-time-fn-easing | -
|