@tdesign/uniapp 0.9.0 → 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 +17 -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 +1 -1
- package/dist/badge/README.md +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 +12 -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 +9 -7
- 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/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 +14 -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 +10 -8
- 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 +7 -4
- 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.vue +8 -6
- 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/indexes.vue +7 -4
- 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 +1 -1
- 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.vue +14 -9
- package/dist/segmented/README.en-US.md +1 -1
- package/dist/segmented/README.md +1 -1
- package/dist/segmented/segmented.vue +6 -3
- 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 +6 -4
- package/dist/tab-panel/tab-panel.vue +5 -3
- package/dist/table/README.en-US.md +4 -4
- package/dist/table/README.md +4 -4
- package/dist/table/table.css +2 -2
- package/dist/table/table.vue +38 -7
- package/dist/tabs/README.en-US.md +1 -1
- package/dist/tabs/README.md +1 -1
- 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/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/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/package.json +1 -1
|
@@ -118,17 +118,19 @@
|
|
|
118
118
|
</view>
|
|
119
119
|
</template>
|
|
120
120
|
<script>
|
|
121
|
-
import TImage from '../image/image';
|
|
122
|
-
import TIcon from '../icon/icon';
|
|
123
121
|
import TBadge from '../badge/badge';
|
|
124
122
|
|
|
125
|
-
import { uniComponent } from '../common/src/index';
|
|
126
123
|
import { prefix } from '../common/config';
|
|
127
|
-
|
|
124
|
+
|
|
125
|
+
import { ChildrenMixin, RELATION_MAP } from '../common/relation';
|
|
126
|
+
import { uniComponent } from '../common/src/index';
|
|
128
127
|
import { uniqueFactory, setIcon } from '../common/utils';
|
|
129
|
-
import { isObject } from '../common/validator';
|
|
130
128
|
import tools from '../common/utils.wxs';
|
|
131
|
-
import {
|
|
129
|
+
import { isObject } from '../common/validator';
|
|
130
|
+
import TIcon from '../icon/icon';
|
|
131
|
+
import TImage from '../image/image';
|
|
132
|
+
|
|
133
|
+
import props from './props';
|
|
132
134
|
|
|
133
135
|
|
|
134
136
|
const name = `${prefix}-grid-item`;
|
|
@@ -70,7 +70,7 @@ title | String | - | title of current step | N
|
|
|
70
70
|
### CSS Variables
|
|
71
71
|
|
|
72
72
|
The component provides the following CSS variables, which can be used to customize styles.
|
|
73
|
-
Name | Default Value | Description
|
|
73
|
+
Name | Default Value | Description
|
|
74
74
|
-- | -- | --
|
|
75
75
|
--td-guide-body-color | @text-color-secondary | -
|
|
76
76
|
--td-guide-dialog-body-font | @font-body-large | -
|
package/dist/guide/README.md
CHANGED
|
@@ -109,7 +109,7 @@ title | String | - | 当前步骤的标题内容,支持插槽:slot="title-{{
|
|
|
109
109
|
### CSS Variables
|
|
110
110
|
|
|
111
111
|
组件提供了下列 CSS 变量,可用于自定义样式。
|
|
112
|
-
名称 | 默认值 | 描述
|
|
112
|
+
名称 | 默认值 | 描述
|
|
113
113
|
-- | -- | --
|
|
114
114
|
--td-guide-body-color | @text-color-secondary | -
|
|
115
115
|
--td-guide-dialog-body-font | @font-body-large | -
|
package/dist/guide/guide.vue
CHANGED
|
@@ -210,18 +210,19 @@
|
|
|
210
210
|
</template>
|
|
211
211
|
|
|
212
212
|
<script>
|
|
213
|
-
import TOverlay from '../overlay/overlay';
|
|
214
|
-
import TPopup from '../popup/popup';
|
|
215
|
-
import { uniComponent } from '../common/src/index';
|
|
216
|
-
import props from './props';
|
|
217
213
|
import { prefix } from '../common/config';
|
|
218
|
-
import {
|
|
214
|
+
import { uniComponent } from '../common/src/index';
|
|
219
215
|
import { debounce, getRect, rpx2px, styles, unitConvert, nextTick, systemInfo, coalesce } from '../common/utils';
|
|
216
|
+
import { isFunction, isNumeric } from '../common/validator';
|
|
217
|
+
import usingConfig from '../mixins/using-config';
|
|
218
|
+
import useCustomNavbar from '../mixins/using-custom-navbar';
|
|
219
|
+
import TOverlay from '../overlay/overlay';
|
|
220
|
+
import TPopup from '../popup/popup';
|
|
221
|
+
|
|
220
222
|
import ContentComp from './content.vue';
|
|
223
|
+
import props from './props';
|
|
221
224
|
|
|
222
|
-
import useCustomNavbar from '../mixins/using-custom-navbar';
|
|
223
225
|
|
|
224
|
-
import usingConfig from '../mixins/using-config';
|
|
225
226
|
const componentName = 'guide';
|
|
226
227
|
const name = `${prefix}-${componentName}`;
|
|
227
228
|
|
package/dist/icon/icon.vue
CHANGED
|
@@ -24,12 +24,15 @@
|
|
|
24
24
|
</view>
|
|
25
25
|
</template>
|
|
26
26
|
<script>
|
|
27
|
-
import { uniComponent } from '../common/src/index';
|
|
28
27
|
import { prefix } from '../common/config';
|
|
29
|
-
import
|
|
28
|
+
import { uniComponent } from '../common/src/index';
|
|
29
|
+
|
|
30
|
+
|
|
30
31
|
import { styles, addUnit, getRect } from '../common/utils';
|
|
31
32
|
import tools from '../common/utils.wxs';
|
|
32
33
|
|
|
34
|
+
import props from './props';
|
|
35
|
+
|
|
33
36
|
|
|
34
37
|
const name = `${prefix}-icon`;
|
|
35
38
|
export default {
|
|
@@ -43,7 +43,7 @@ t-class-load | \-
|
|
|
43
43
|
### CSS Variables
|
|
44
44
|
|
|
45
45
|
The component provides the following CSS variables, which can be used to customize styles.
|
|
46
|
-
Name | Default Value | Description
|
|
46
|
+
Name | Default Value | Description
|
|
47
47
|
-- | -- | --
|
|
48
48
|
--td-image-color | @text-color-placeholder | -
|
|
49
49
|
--td-image-loading-bg-color | @bg-color-secondarycontainer | -
|
package/dist/image/README.md
CHANGED
package/dist/image/image.vue
CHANGED
|
@@ -83,14 +83,15 @@
|
|
|
83
83
|
</view>
|
|
84
84
|
</template>
|
|
85
85
|
<script>
|
|
86
|
-
import TLoading from '../loading/loading';
|
|
87
|
-
import TIcon from '../icon/icon';
|
|
88
|
-
import { uniComponent } from '../common/src/index';
|
|
89
|
-
import ImageProps from './props';
|
|
90
86
|
import { prefix } from '../common/config';
|
|
87
|
+
import { uniComponent } from '../common/src/index';
|
|
91
88
|
import { addUnit, getRect, appBaseInfo } from '../common/utils';
|
|
92
|
-
import { compareVersion } from '../common/version';
|
|
93
89
|
import tools from '../common/utils.wxs';
|
|
90
|
+
import { compareVersion } from '../common/version';
|
|
91
|
+
import TIcon from '../icon/icon';
|
|
92
|
+
import TLoading from '../loading/loading';
|
|
93
|
+
|
|
94
|
+
import ImageProps from './props';
|
|
94
95
|
|
|
95
96
|
|
|
96
97
|
const name = `${prefix}-image`;
|
|
@@ -14,10 +14,11 @@ image-props | Object | - | Typescript: `ImageProps`,[Image API Documents](./im
|
|
|
14
14
|
images | Array | [] | Typescript: `Array<string>` | N
|
|
15
15
|
initial-index | Number | 0 | Typescript: `Number` | N
|
|
16
16
|
lazy | Boolean | true | \- | N
|
|
17
|
+
max-zoom | Number | 3 | \- | N
|
|
17
18
|
show-index | Boolean | false | \- | N
|
|
18
19
|
using-custom-navbar | Boolean | false | \- | N
|
|
19
|
-
visible | Boolean | false | hide or show image viewer。`v-model:visible` is supported | N
|
|
20
|
-
default-visible | Boolean | false | hide or show image viewer。uncontrolled property | N
|
|
20
|
+
visible | Boolean | false | hide or show image viewer。`v-model:visible` is supported。Typescript: `boolean \| null` | N
|
|
21
|
+
default-visible | Boolean | false | hide or show image viewer。uncontrolled property。Typescript: `boolean \| null` | N
|
|
21
22
|
|
|
22
23
|
### ImageViewer Events
|
|
23
24
|
|
|
@@ -37,7 +38,7 @@ delete-btn | \-
|
|
|
37
38
|
### CSS Variables
|
|
38
39
|
|
|
39
40
|
The component provides the following CSS variables, which can be used to customize styles.
|
|
40
|
-
Name | Default Value | Description
|
|
41
|
+
Name | Default Value | Description
|
|
41
42
|
-- | -- | --
|
|
42
43
|
--td-image-viewer-close-margin-left | @spacer-1 | -
|
|
43
44
|
--td-image-viewer-delete-margin-right | @spacer-1 | -
|
|
@@ -45,10 +45,11 @@ image-props | Object | - | 透传至 Image 组件。TS 类型:`ImageProps`,[
|
|
|
45
45
|
images | Array | [] | 图片数组。TS 类型:`Array<string>` | N
|
|
46
46
|
initial-index | Number | 0 | 初始化页码。TS 类型:`Number` | N
|
|
47
47
|
lazy | Boolean | true | 是否开启图片懒加载。开启后会预加载当前图片、相邻图片 | N
|
|
48
|
+
max-zoom | Number | 3 | 图片最大放大比例 | N
|
|
48
49
|
show-index | Boolean | false | 是否显示页码 | N
|
|
49
50
|
using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
|
|
50
|
-
visible | Boolean | false | 隐藏/显示预览。支持语法糖 `v-model:visible` | N
|
|
51
|
-
default-visible | Boolean | false |
|
|
51
|
+
visible | Boolean | false | 隐藏/显示预览。支持语法糖 `v-model:visible`。TS 类型:`boolean \| null` | N
|
|
52
|
+
default-visible | Boolean | false | 隐藏/显示预览。非受控属性。TS 类型:`boolean \| null` | N
|
|
52
53
|
|
|
53
54
|
### ImageViewer Events
|
|
54
55
|
|
|
@@ -68,7 +69,7 @@ delete-btn | 删除操作
|
|
|
68
69
|
### CSS Variables
|
|
69
70
|
|
|
70
71
|
组件提供了下列 CSS 变量,可用于自定义样式。
|
|
71
|
-
名称 | 默认值 | 描述
|
|
72
|
+
名称 | 默认值 | 描述
|
|
72
73
|
-- | -- | --
|
|
73
74
|
--td-image-viewer-close-margin-left | @spacer-1 | -
|
|
74
75
|
--td-image-viewer-delete-margin-right | @spacer-1 | -
|
|
@@ -28,6 +28,18 @@
|
|
|
28
28
|
.t-image-viewer .swiper {
|
|
29
29
|
outline: 0;
|
|
30
30
|
}
|
|
31
|
+
.t-image-viewer__movable-area {
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: 100%;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
}
|
|
36
|
+
.t-image-viewer__movable-view {
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
}
|
|
31
43
|
.t-image-viewer__image {
|
|
32
44
|
width: 100%;
|
|
33
45
|
display: inline-block;
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
:aria-modal="true"
|
|
8
8
|
aria-role="dialog"
|
|
9
9
|
aria-label="图片查看器"
|
|
10
|
-
@touchmove.stop.prevent="true"
|
|
11
10
|
>
|
|
12
11
|
<view
|
|
13
12
|
:class="classPrefix + '__mask'"
|
|
@@ -15,6 +14,7 @@
|
|
|
15
14
|
:style="'' + tools._style([backgroundColor && '--td-image-viewer-mask-bg-color: ' + backgroundColor])"
|
|
16
15
|
aria-role="button"
|
|
17
16
|
aria-label="关闭"
|
|
17
|
+
@touchmove.prevent="() => {}"
|
|
18
18
|
@click="(e) => onClose(e, 'overlay')"
|
|
19
19
|
/>
|
|
20
20
|
<block v-if="images && images.length">
|
|
@@ -33,21 +33,42 @@
|
|
|
33
33
|
:key="index"
|
|
34
34
|
:class="classPrefix + '__preview-image'"
|
|
35
35
|
>
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
<movable-area
|
|
37
|
+
:class="classPrefix + '__movable-area'"
|
|
38
|
+
scale-area
|
|
39
|
+
@touchmove="onAreaTouchMove"
|
|
40
|
+
>
|
|
41
|
+
<movable-view
|
|
42
|
+
:class="classPrefix + '__movable-view'"
|
|
43
|
+
direction="all"
|
|
44
|
+
:scale="true"
|
|
45
|
+
:scale-min="1"
|
|
46
|
+
:scale-max="maxZoom"
|
|
47
|
+
:scale-value="index === currentSwiperIndex ? currentScale : 1"
|
|
48
|
+
:damping="100"
|
|
49
|
+
:friction="20"
|
|
50
|
+
:out-of-bounds="false"
|
|
51
|
+
:disabled="false"
|
|
52
|
+
@scale="onMovableScale"
|
|
53
|
+
@tap.stop="onImageDoubleTap(index)"
|
|
54
|
+
>
|
|
55
|
+
<t-image
|
|
56
|
+
v-if="!lazy || shouldLoadImage(index, currentSwiperIndex, loadedImageIndexes)"
|
|
57
|
+
:t-class="prefix + '-image--external'"
|
|
58
|
+
:class="classPrefix + '__image'"
|
|
59
|
+
:custom-style="(imagesStyle[index] && imagesStyle[index].style) || ''"
|
|
60
|
+
:data-index="index"
|
|
61
|
+
:src="item"
|
|
62
|
+
:mode="(imageProps && imageProps.mode) || 'aspectFit'"
|
|
63
|
+
:lazy="(imageProps && imageProps.lazy) || false"
|
|
64
|
+
:loading="(imageProps && imageProps.loading) || 'default'"
|
|
65
|
+
:shape="(imageProps && imageProps.shape) || 'square'"
|
|
66
|
+
:webp="(imageProps && imageProps.webp) || false"
|
|
67
|
+
:show-menu-by-longpress="(imageProps && imageProps.showMenuByLongpress) || false"
|
|
68
|
+
@load="(e) => onImageLoadSuccess(e, { index })"
|
|
69
|
+
/>
|
|
70
|
+
</movable-view>
|
|
71
|
+
</movable-area>
|
|
51
72
|
</swiper-item>
|
|
52
73
|
</swiper>
|
|
53
74
|
</view>
|
|
@@ -111,16 +132,21 @@
|
|
|
111
132
|
</view>
|
|
112
133
|
</template>
|
|
113
134
|
<script>
|
|
114
|
-
import
|
|
115
|
-
import TIcon from '../icon/icon';
|
|
135
|
+
import { prefix } from '../common/config';
|
|
116
136
|
import { uniComponent } from '../common/src/index';
|
|
117
137
|
import { styles, calcIcon, systemInfo } from '../common/utils';
|
|
118
|
-
|
|
119
|
-
|
|
138
|
+
|
|
139
|
+
|
|
120
140
|
import tools from '../common/utils.wxs';
|
|
121
|
-
import
|
|
141
|
+
import TIcon from '../icon/icon';
|
|
142
|
+
import TImage from '../image/image';
|
|
143
|
+
|
|
144
|
+
|
|
122
145
|
import useCustomNavbar from '../mixins/using-custom-navbar';
|
|
123
146
|
|
|
147
|
+
import { shouldLoadImage } from './computed.js';
|
|
148
|
+
import props from './props';
|
|
149
|
+
|
|
124
150
|
|
|
125
151
|
const name = `${prefix}-image-viewer`;
|
|
126
152
|
|
|
@@ -161,6 +187,8 @@ export default {
|
|
|
161
187
|
iDeleteBtn: null,
|
|
162
188
|
iCloseBtn: null,
|
|
163
189
|
dataVisible: this.visible,
|
|
190
|
+
currentScale: 1,
|
|
191
|
+
lastTapTime: 0,
|
|
164
192
|
};
|
|
165
193
|
},
|
|
166
194
|
watch: {
|
|
@@ -297,11 +325,46 @@ export default {
|
|
|
297
325
|
const {
|
|
298
326
|
detail: { current },
|
|
299
327
|
} = e;
|
|
328
|
+
// 切换图片时重置缩放,避免上一张的缩放状态影响当前图
|
|
329
|
+
this.currentScale = 1;
|
|
300
330
|
this.currentSwiperIndex = current;
|
|
301
331
|
|
|
302
332
|
this._trigger('change', { index: current });
|
|
303
333
|
},
|
|
304
334
|
|
|
335
|
+
onMovableScale(e) {
|
|
336
|
+
const scale = e?.detail?.scale ?? 1;
|
|
337
|
+
this.currentScale = scale;
|
|
338
|
+
},
|
|
339
|
+
|
|
340
|
+
onAreaTouchMove(e) {
|
|
341
|
+
// 当图片处于缩放状态时,阻止 touchmove 冒泡到 swiper,避免误触翻页(H5 端兜底)
|
|
342
|
+
// movable-view 自身仍会响应拖动/pinch,不受影响
|
|
343
|
+
// 注:小程序端原生 swiper 滑动手势底层接管,stopPropagation 无效,留作平台限制
|
|
344
|
+
if (this.currentScale > 1) {
|
|
345
|
+
if (e && typeof e.stopPropagation === 'function') {
|
|
346
|
+
e.stopPropagation();
|
|
347
|
+
}
|
|
348
|
+
if (e && typeof e.preventDefault === 'function') {
|
|
349
|
+
e.preventDefault();
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
|
|
354
|
+
onImageDoubleTap(index) {
|
|
355
|
+
// 仅响应当前图片,避免影响其它 swiper-item
|
|
356
|
+
if (index !== this.currentSwiperIndex) return;
|
|
357
|
+
const now = Date.now();
|
|
358
|
+
if (now - this.lastTapTime < 300) {
|
|
359
|
+
// 双击:在 1 与 maxZoom 之间切换
|
|
360
|
+
const max = Number(this.maxZoom) || 3;
|
|
361
|
+
this.currentScale = this.currentScale > 1 ? 1 : max;
|
|
362
|
+
this.lastTapTime = 0;
|
|
363
|
+
} else {
|
|
364
|
+
this.lastTapTime = now;
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
|
|
305
368
|
onClose(e, source) {
|
|
306
369
|
this._trigger('close', { visible: false, trigger: source || 'button', index: this.currentSwiperIndex });
|
|
307
370
|
},
|
|
@@ -41,6 +41,11 @@ export interface TdImageViewerProps {
|
|
|
41
41
|
* @default true
|
|
42
42
|
*/
|
|
43
43
|
lazy?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* 图片最大放大比例
|
|
46
|
+
* @default 3
|
|
47
|
+
*/
|
|
48
|
+
maxZoom?: number;
|
|
44
49
|
/**
|
|
45
50
|
* 是否显示页码
|
|
46
51
|
* @default false
|
|
@@ -60,7 +65,7 @@ export interface TdImageViewerProps {
|
|
|
60
65
|
* 隐藏/显示预览,非受控属性
|
|
61
66
|
* @default false
|
|
62
67
|
*/
|
|
63
|
-
defaultVisible?: boolean;
|
|
68
|
+
defaultVisible?: boolean | null;
|
|
64
69
|
/**
|
|
65
70
|
* 翻页时回调
|
|
66
71
|
*/
|
|
@@ -52,7 +52,7 @@ t-class-sidebar-item | \-
|
|
|
52
52
|
### CSS Variables
|
|
53
53
|
|
|
54
54
|
The component provides the following CSS variables, which can be used to customize styles.
|
|
55
|
-
Name | Default Value | Description
|
|
55
|
+
Name | Default Value | Description
|
|
56
56
|
-- | -- | --
|
|
57
57
|
--td-indexes-sidebar-active-bg-color | @brand-color | -
|
|
58
58
|
--td-indexes-sidebar-active-color | @text-color-anti | -
|
package/dist/indexes/README.md
CHANGED
package/dist/indexes/indexes.vue
CHANGED
|
@@ -38,14 +38,17 @@
|
|
|
38
38
|
</template>
|
|
39
39
|
<script>
|
|
40
40
|
|
|
41
|
-
import { uniComponent } from '../common/src/index';
|
|
42
41
|
import { prefix } from '../common/config';
|
|
43
|
-
import
|
|
42
|
+
import { ParentMixin, RELATION_MAP } from '../common/relation';
|
|
43
|
+
import { uniComponent } from '../common/src/index';
|
|
44
|
+
|
|
45
|
+
|
|
44
46
|
import { getRect, throttle, systemInfo } from '../common/utils';
|
|
45
|
-
import pageScrollMixin from '../mixins/page-scroll';
|
|
46
47
|
import tools from '../common/utils.wxs';
|
|
48
|
+
import pageScrollMixin from '../mixins/page-scroll';
|
|
49
|
+
|
|
47
50
|
import { getFirstCharacter } from './computed.js';
|
|
48
|
-
import
|
|
51
|
+
import props from './props';
|
|
49
52
|
|
|
50
53
|
|
|
51
54
|
const name = `${prefix}-indexes`;
|
|
@@ -11,7 +11,7 @@ index | String / Number | - | \- | N
|
|
|
11
11
|
### CSS Variables
|
|
12
12
|
|
|
13
13
|
The component provides the following CSS variables, which can be used to customize styles.
|
|
14
|
-
Name | Default Value | Description
|
|
14
|
+
Name | Default Value | Description
|
|
15
15
|
-- | -- | --
|
|
16
16
|
--td-indexes-anchor-active-bg-color | @bg-color-container | -
|
|
17
17
|
--td-indexes-anchor-active-color | @brand-color | -
|
|
@@ -20,11 +20,13 @@
|
|
|
20
20
|
</view>
|
|
21
21
|
</template>
|
|
22
22
|
<script>
|
|
23
|
-
import { uniComponent } from '../common/src/index';
|
|
24
23
|
import { prefix } from '../common/config';
|
|
25
|
-
import props from './props';
|
|
26
|
-
import tools from '../common/utils.wxs';
|
|
27
24
|
import { ChildrenMixin, RELATION_MAP } from '../common/relation';
|
|
25
|
+
import { uniComponent } from '../common/src/index';
|
|
26
|
+
|
|
27
|
+
import tools from '../common/utils.wxs';
|
|
28
|
+
|
|
29
|
+
import props from './props';
|
|
28
30
|
|
|
29
31
|
|
|
30
32
|
const name = `${prefix}-indexes-anchor`;
|
|
@@ -93,7 +93,7 @@ t-class-tips | \-
|
|
|
93
93
|
### CSS Variables
|
|
94
94
|
|
|
95
95
|
The component provides the following CSS variables, which can be used to customize styles.
|
|
96
|
-
Name | Default Value | Description
|
|
96
|
+
Name | Default Value | Description
|
|
97
97
|
-- | -- | --
|
|
98
98
|
--td-input-align-items | center | -
|
|
99
99
|
--td-input-bg-color | @bg-color-container | -
|
package/dist/input/README.md
CHANGED
package/dist/input/input.vue
CHANGED
|
@@ -48,7 +48,7 @@ t-class-suffix-icon | \-
|
|
|
48
48
|
### CSS Variables
|
|
49
49
|
|
|
50
50
|
The component provides the following CSS variables, which can be used to customize styles.
|
|
51
|
-
Name | Default Value | Description
|
|
51
|
+
Name | Default Value | Description
|
|
52
52
|
-- | -- | --
|
|
53
53
|
--td-link-danger-active-color | @error-color-active | -
|
|
54
54
|
--td-link-danger-color | @error-color | -
|
package/dist/link/README.md
CHANGED
package/dist/link/link.vue
CHANGED
|
@@ -72,12 +72,15 @@
|
|
|
72
72
|
</view>
|
|
73
73
|
</template>
|
|
74
74
|
<script>
|
|
75
|
-
import TIcon from '../icon/icon';
|
|
76
|
-
import { uniComponent } from '../common/src/index';
|
|
77
75
|
import { prefix } from '../common/config';
|
|
78
|
-
import
|
|
76
|
+
import { uniComponent } from '../common/src/index';
|
|
77
|
+
|
|
78
|
+
|
|
79
79
|
import { calcIcon, coalesce } from '../common/utils';
|
|
80
80
|
import tools from '../common/utils.wxs';
|
|
81
|
+
import TIcon from '../icon/icon';
|
|
82
|
+
|
|
83
|
+
import props from './props';
|
|
81
84
|
|
|
82
85
|
|
|
83
86
|
const name = `${prefix}-link`;
|
|
@@ -40,7 +40,7 @@ t-class-text | \-
|
|
|
40
40
|
### CSS Variables
|
|
41
41
|
|
|
42
42
|
The component provides the following CSS variables, which can be used to customize styles.
|
|
43
|
-
Name | Default Value | Description
|
|
43
|
+
Name | Default Value | Description
|
|
44
44
|
-- | -- | --
|
|
45
45
|
--td-loading-color | @brand-color | -
|
|
46
46
|
--td-loading-full-bg-color | rgba(255, 255, 255, 0.6) | -
|
package/dist/loading/README.md
CHANGED
package/dist/loading/loading.vue
CHANGED
|
@@ -88,11 +88,13 @@
|
|
|
88
88
|
</view>
|
|
89
89
|
</template>
|
|
90
90
|
<script>
|
|
91
|
-
import { uniComponent } from '../common/src/index';
|
|
92
91
|
import { prefix } from '../common/config';
|
|
93
|
-
import
|
|
92
|
+
import { uniComponent } from '../common/src/index';
|
|
93
|
+
|
|
94
94
|
import tools from '../common/utils.wxs';
|
|
95
95
|
|
|
96
|
+
import props from './props';
|
|
97
|
+
|
|
96
98
|
|
|
97
99
|
const name = `${prefix}-loading`;
|
|
98
100
|
|
package/dist/message/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { MessageType } from './message.interface';
|
|
2
1
|
import { getInstance } from '../common/utils';
|
|
3
2
|
|
|
3
|
+
import { MessageType } from './message.interface';
|
|
4
|
+
|
|
4
5
|
|
|
5
6
|
const showMessage = function (options, theme = MessageType.info) {
|
|
6
7
|
const { context, selector = '#t-message', ...otherOptions } = options;
|
package/dist/message/message.vue
CHANGED
|
@@ -34,12 +34,13 @@
|
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<script>
|
|
37
|
-
import TMessageItem from '../message-item/message-item.vue';
|
|
38
|
-
import { uniComponent } from '../common/src/index';
|
|
39
37
|
import { prefix } from '../common/config';
|
|
38
|
+
import { uniComponent } from '../common/src/index';
|
|
39
|
+
import { unitConvert } from '../common/utils';
|
|
40
|
+
import TMessageItem from '../message-item/message-item.vue';
|
|
41
|
+
|
|
40
42
|
import { MessageType } from './message.interface';
|
|
41
43
|
import props from './props';
|
|
42
|
-
import { unitConvert } from '../common/utils';
|
|
43
44
|
|
|
44
45
|
|
|
45
46
|
const SHOW_DURATION = 400;
|
|
@@ -89,16 +89,18 @@
|
|
|
89
89
|
</view>
|
|
90
90
|
</template>
|
|
91
91
|
<script>
|
|
92
|
-
import TIcon from '../icon/icon';
|
|
93
|
-
import TLink from '../link/link';
|
|
94
|
-
import { uniComponent } from '../common/src/index';
|
|
95
92
|
import { prefix } from '../common/config';
|
|
93
|
+
import { uniComponent } from '../common/src/index';
|
|
96
94
|
import { getRect, unitConvert, calcIcon } from '../common/utils';
|
|
97
|
-
import { isObject } from '../common/validator';
|
|
98
95
|
import tools from '../common/utils.wxs';
|
|
99
|
-
import {
|
|
96
|
+
import { isObject } from '../common/validator';
|
|
97
|
+
import TIcon from '../icon/icon';
|
|
98
|
+
import TLink from '../link/link';
|
|
99
|
+
|
|
100
100
|
import { messageDefaultData } from '../message/config';
|
|
101
101
|
|
|
102
|
+
import { getMessageStyles } from './computed.js';
|
|
103
|
+
|
|
102
104
|
|
|
103
105
|
const SHOW_DURATION = 400;
|
|
104
106
|
const name = `${prefix}-message`;
|