@vtj/materials 0.10.1-alpha.6 → 0.10.1-alpha.7

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.
Files changed (89) hide show
  1. package/dist/assets/antdv/index.umd.js +2 -2
  2. package/dist/assets/charts/index.umd.js +2 -2
  3. package/dist/assets/element/index.umd.js +2 -2
  4. package/dist/assets/ui/index.umd.js +2 -2
  5. package/dist/assets/uni-h5/index.umd.js +2 -2
  6. package/dist/assets/uni-ui/index.umd.js +3 -3
  7. package/dist/assets/vant/index.umd.js +2 -2
  8. package/dist/deps/@vtj/charts/index.umd.js +2 -2
  9. package/dist/deps/@vtj/icons/index.umd.js +2 -2
  10. package/dist/deps/@vtj/ui/index.umd.js +2 -2
  11. package/dist/deps/@vtj/utils/index.umd.js +2 -2
  12. package/dist/deps/uni-ui/index.umd.js +1 -1
  13. package/dist/deps/uni-ui/style.css +1 -1
  14. package/package.json +5 -5
  15. package/src/uni-ui/components/badge.ts +5 -1
  16. package/src/uni-ui/components/breadcrumb.ts +76 -0
  17. package/src/uni-ui/components/calendar.ts +63 -0
  18. package/src/uni-ui/components/card.ts +113 -0
  19. package/src/uni-ui/components/collapse.ts +118 -0
  20. package/src/uni-ui/components/combox.ts +51 -0
  21. package/src/uni-ui/components/countdown.ts +92 -0
  22. package/src/uni-ui/components/dataCheckbox.ts +104 -0
  23. package/src/uni-ui/components/dataPicker.ts +146 -0
  24. package/src/uni-ui/components/dataSelect.ts +68 -0
  25. package/src/uni-ui/components/dateformat.ts +42 -0
  26. package/src/uni-ui/components/datetimePicker.ts +103 -0
  27. package/src/uni-ui/components/drawer.ts +38 -0
  28. package/src/uni-ui/components/easyinput.ts +159 -0
  29. package/src/uni-ui/components/fab.ts +89 -0
  30. package/src/uni-ui/components/fav.ts +65 -0
  31. package/src/uni-ui/components/filePicker.ts +127 -0
  32. package/src/uni-ui/components/forms.ts +209 -0
  33. package/src/uni-ui/components/goodsNav.ts +31 -0
  34. package/src/uni-ui/components/grid.ts +104 -0
  35. package/src/uni-ui/components/group.ts +50 -0
  36. package/src/uni-ui/components/icons.ts +47 -0
  37. package/src/uni-ui/components/index.ts +89 -1
  38. package/src/uni-ui/components/indexedList.ts +51 -0
  39. package/src/uni-ui/components/link.ts +60 -0
  40. package/src/uni-ui/components/list.ts +259 -0
  41. package/src/uni-ui/components/loadMore.ts +61 -0
  42. package/src/uni-ui/components/navbar.ts +121 -0
  43. package/src/uni-ui/components/noticeBar.ts +83 -0
  44. package/src/uni-ui/components/numberbox.ts +49 -0
  45. package/src/uni-ui/components/pagination.ts +59 -0
  46. package/src/uni-ui/components/popup.ts +206 -0
  47. package/src/uni-ui/components/rate.ts +89 -0
  48. package/src/uni-ui/components/row.ts +126 -0
  49. package/src/uni-ui/components/searchBar.ts +84 -0
  50. package/src/uni-ui/components/section.ts +68 -0
  51. package/src/uni-ui/components/segmentedControl.ts +48 -0
  52. package/src/uni-ui/components/steps.ts +55 -0
  53. package/src/uni-ui/components/swipeAction.ts +133 -0
  54. package/src/uni-ui/components/swiperDot.ts +114 -0
  55. package/src/uni-ui/components/table.ts +132 -0
  56. package/src/uni-ui/components/tag.ts +56 -0
  57. package/src/uni-ui/components/title.ts +49 -0
  58. package/src/uni-ui/components/tooltip.ts +32 -0
  59. package/src/uni-ui/components/transition.ts +49 -0
  60. package/src/uni-ui/index.ts +30 -13
  61. package/src/uni-ui/lib/uni-col/uni-col.vue +324 -0
  62. package/src/uni-ui/lib/uni-data-select/uni-data-select.vue +590 -0
  63. package/src/uni-ui/lib/uni-easyinput/common.js +54 -0
  64. package/src/uni-ui/lib/uni-easyinput/uni-easyinput.vue +790 -0
  65. package/src/uni-ui/lib/uni-forms-item/uni-forms-item.vue +630 -0
  66. package/src/uni-ui/lib/uni-goods-nav/i18n/en.json +6 -0
  67. package/src/uni-ui/lib/uni-goods-nav/i18n/index.js +8 -0
  68. package/src/uni-ui/lib/uni-goods-nav/i18n/zh-Hans.json +6 -0
  69. package/src/uni-ui/lib/uni-goods-nav/i18n/zh-Hant.json +6 -0
  70. package/src/uni-ui/lib/uni-goods-nav/uni-goods-nav.vue +231 -0
  71. package/src/uni-ui/lib/uni-icons/uni-icons.uvue +91 -0
  72. package/src/uni-ui/lib/uni-icons/uni-icons.vue +114 -0
  73. package/src/uni-ui/lib/uni-icons/uniicons.css +664 -0
  74. package/src/uni-ui/lib/uni-icons/uniicons.ttf +0 -0
  75. package/src/uni-ui/lib/uni-icons/uniicons_file.ts +664 -0
  76. package/src/uni-ui/lib/uni-icons/uniicons_file_vue.js +649 -0
  77. package/src/uni-ui/lib/uni-indexed-list/uni-indexed-list-item.vue +144 -0
  78. package/src/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue +404 -0
  79. package/src/uni-ui/lib/uni-list/uni-list.vue +123 -0
  80. package/src/uni-ui/lib/uni-list/uni-refresh.vue +65 -0
  81. package/src/uni-ui/lib/uni-list/uni-refresh.wxs +87 -0
  82. package/src/uni-ui/lib/uni-popup-dialog/keypress.js +45 -0
  83. package/src/uni-ui/lib/uni-popup-dialog/uni-popup-dialog.vue +324 -0
  84. package/src/uni-ui/lib/uni-rate/uni-rate.vue +361 -0
  85. package/src/uni-ui/lib/uni-table/uni-table.vue +496 -0
  86. package/src/uni-ui/lib/uni-td/uni-td.vue +99 -0
  87. package/src/uni-ui/lib/uni-th/uni-th.vue +310 -283
  88. package/src/uni-ui/lib/uni-tr/uni-tr.vue +194 -170
  89. package/src/version.ts +2 -2
@@ -0,0 +1,231 @@
1
+ <template>
2
+ <view class="uni-goods-nav">
3
+ <!-- 底部占位 -->
4
+ <view class="uni-tab__seat" />
5
+ <view class="uni-tab__cart-box flex">
6
+ <view class="flex uni-tab__cart-sub-left">
7
+ <view v-for="(item,index) in options" :key="index" class="flex uni-tab__cart-button-left uni-tab__shop-cart" @click="onClick(index,item)">
8
+ <view class="uni-tab__icon">
9
+ <uni-icons :type="item.icon" size="20" color="#646566"></uni-icons>
10
+ <!-- <image class="image" :src="item.icon" mode="widthFix" /> -->
11
+ </view>
12
+ <text class="uni-tab__text">{{ item.text }}</text>
13
+ <view class="flex uni-tab__dot-box">
14
+ <text v-if="item.info" :class="{ 'uni-tab__dots': item.info > 9 }" class="uni-tab__dot " :style="{'backgroundColor':item.infoBackgroundColor?item.infoBackgroundColor:'#ff0000',
15
+ color:item.infoColor?item.infoColor:'#fff'
16
+ }">{{ item.info }}</text>
17
+ </view>
18
+ </view>
19
+ </view>
20
+ <view :class="{'uni-tab__right':fill}" class="flex uni-tab__cart-sub-right ">
21
+ <view v-for="(item,index) in buttonGroup" :key="index" :style="{background:item.backgroundColor,color:item.color}"
22
+ class="flex uni-tab__cart-button-right" @click="buttonClick(index,item)"><text :style="{color:item.color}" class="uni-tab__cart-button-right-text">{{ item.text }}</text></view>
23
+ </view>
24
+ </view>
25
+ </view>
26
+ </template>
27
+
28
+ <script>
29
+ import {
30
+ initVueI18n
31
+ } from '@dcloudio/uni-i18n'
32
+ import messages from './i18n/index.js'
33
+ const { t } = initVueI18n(messages)
34
+ /**
35
+ * GoodsNav 商品导航
36
+ * @description 商品加入购物车、立即购买等
37
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=865
38
+ * @property {Array} options 组件参数
39
+ * @property {Array} buttonGroup 组件按钮组参数
40
+ * @property {Boolean} fill = [true | false] 组件按钮组参数
41
+ * @property {Boolean} stat 是否开启统计功能
42
+ * @event {Function} click 左侧点击事件
43
+ * @event {Function} buttonClick 右侧按钮组点击事件
44
+ * @example <uni-goods-nav :fill="true" options="" buttonGroup="buttonGroup" @click="" @buttonClick="" />
45
+ */
46
+ export default {
47
+ name: 'UniGoodsNav',
48
+ emits:['click','buttonClick'],
49
+ props: {
50
+ options: {
51
+ type: Array,
52
+ default () {
53
+ return [{
54
+ icon: 'shop',
55
+ text: t("uni-goods-nav.options.shop"),
56
+ }, {
57
+ icon: 'cart',
58
+ text: t("uni-goods-nav.options.cart")
59
+ }]
60
+ }
61
+ },
62
+ buttonGroup: {
63
+ type: Array,
64
+ default () {
65
+ return [{
66
+ text: t("uni-goods-nav.buttonGroup.addToCart"),
67
+ backgroundColor: 'linear-gradient(90deg, #FFCD1E, #FF8A18)',
68
+ color: '#fff'
69
+ },
70
+ {
71
+ text: t("uni-goods-nav.buttonGroup.buyNow"),
72
+ backgroundColor: 'linear-gradient(90deg, #FE6035, #EF1224)',
73
+ color: '#fff'
74
+ }
75
+ ]
76
+ }
77
+ },
78
+ fill: {
79
+ type: Boolean,
80
+ default: false
81
+ },
82
+ stat:{
83
+ type: Boolean,
84
+ default: false
85
+ }
86
+ },
87
+ methods: {
88
+ onClick(index, item) {
89
+ this.$emit('click', {
90
+ index,
91
+ content: item,
92
+ })
93
+ },
94
+ buttonClick(index, item) {
95
+ if (uni.report && this.stat) {
96
+ uni.report(item.text, item.text)
97
+ }
98
+ this.$emit('buttonClick', {
99
+ index,
100
+ content: item
101
+ })
102
+ }
103
+ }
104
+ }
105
+ </script>
106
+
107
+ <style lang="scss" >
108
+ .flex {
109
+ /* #ifndef APP-NVUE */
110
+ display: flex;
111
+ /* #endif */
112
+ flex-direction: row;
113
+ }
114
+
115
+ .uni-goods-nav {
116
+ /* #ifndef APP-NVUE */
117
+ display: flex;
118
+ /* #endif */
119
+ flex: 1;
120
+ flex-direction: row;
121
+ }
122
+
123
+ .uni-tab__cart-box {
124
+ flex: 1;
125
+ height: 50px;
126
+ background-color: #fff;
127
+ z-index: 900;
128
+ }
129
+
130
+ .uni-tab__cart-sub-left {
131
+ padding: 0 5px;
132
+ display: flex;
133
+ flex-direction: row;
134
+ }
135
+
136
+ .uni-tab__cart-sub-right {
137
+ flex: 1;
138
+ }
139
+
140
+ .uni-tab__right {
141
+ margin: 5px 0;
142
+ margin-right: 10px;
143
+ border-radius: 100px;
144
+ overflow: hidden;
145
+ }
146
+
147
+ .uni-tab__cart-button-left {
148
+ /* #ifndef APP-NVUE */
149
+ display: flex;
150
+ /* #endif */
151
+ // flex: 1;
152
+ position: relative;
153
+ justify-content: center;
154
+ align-items: center;
155
+ flex-direction: column;
156
+ margin: 0 10px;
157
+ /* #ifdef H5 */
158
+ cursor: pointer;
159
+ /* #endif */
160
+ }
161
+
162
+ .uni-tab__icon {
163
+ width: 18px;
164
+ height: 18px;
165
+ }
166
+
167
+ .image {
168
+ width: 18px;
169
+ height: 18px;
170
+ }
171
+
172
+ .uni-tab__text {
173
+ margin-top: 3px;
174
+ font-size: 12px;
175
+ color: #646566;
176
+ }
177
+
178
+ .uni-tab__cart-button-right {
179
+ /* #ifndef APP-NVUE */
180
+ display: flex;
181
+ flex-direction: column;
182
+ /* #endif */
183
+ flex: 1;
184
+ justify-content: center;
185
+ align-items: center;
186
+ /* #ifdef H5 */
187
+ cursor: pointer;
188
+ /* #endif */
189
+ }
190
+
191
+ .uni-tab__cart-button-right-text {
192
+ font-size: 14px;
193
+ color: #fff;
194
+ }
195
+
196
+ .uni-tab__cart-button-right:active {
197
+ opacity: 0.7;
198
+ }
199
+
200
+ .uni-tab__dot-box {
201
+ /* #ifndef APP-NVUE */
202
+ display: flex;
203
+ flex-direction: column;
204
+ /* #endif */
205
+ position: absolute;
206
+ right: -2px;
207
+ top: 2px;
208
+ justify-content: center;
209
+ align-items: center;
210
+ // width: 0;
211
+ // height: 0;
212
+ }
213
+
214
+ .uni-tab__dot {
215
+ // width: 30rpx;
216
+ // height: 30rpx;
217
+ padding: 0 4px;
218
+ line-height: 15px;
219
+ color: #ffffff;
220
+ text-align: center;
221
+ font-size: 12px;
222
+ background-color: #ff0000;
223
+ border-radius: 15px;
224
+ }
225
+
226
+ .uni-tab__dots {
227
+ padding: 0 4px;
228
+ // width: auto;
229
+ border-radius: 15px;
230
+ }
231
+ </style>
@@ -0,0 +1,91 @@
1
+ <template>
2
+ <text class="uni-icons" :style="styleObj">
3
+ <slot>{{unicode}}</slot>
4
+ </text>
5
+ </template>
6
+
7
+ <script>
8
+ import { fontData, IconsDataItem } from './uniicons_file'
9
+
10
+ /**
11
+ * Icons 图标
12
+ * @description 用于展示 icon 图标
13
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=28
14
+ * @property {Number} size 图标大小
15
+ * @property {String} type 图标图案,参考示例
16
+ * @property {String} color 图标颜色
17
+ * @property {String} customPrefix 自定义图标
18
+ * @event {Function} click 点击 Icon 触发事件
19
+ */
20
+ export default {
21
+ name: "uni-icons",
22
+ props: {
23
+ type: {
24
+ type: String,
25
+ default: ''
26
+ },
27
+ color: {
28
+ type: String,
29
+ default: '#333333'
30
+ },
31
+ size: {
32
+ type: Object,
33
+ default: 16
34
+ },
35
+ fontFamily: {
36
+ type: String,
37
+ default: ''
38
+ }
39
+ },
40
+ data() {
41
+ return {};
42
+ },
43
+ computed: {
44
+ unicode() : string {
45
+ let codes = fontData.find((item : IconsDataItem) : boolean => { return item.font_class == this.type })
46
+ if (codes !== null) {
47
+ return codes.unicode
48
+ }
49
+ return ''
50
+ },
51
+ iconSize() : string {
52
+ const size = this.size
53
+ if (typeof size == 'string') {
54
+ const reg = /^[0-9]*$/g
55
+ return reg.test(size as string) ? '' + size + 'px' : '' + size;
56
+ // return '' + this.size
57
+ }
58
+ return this.getFontSize(size as number)
59
+ },
60
+ styleObj() : UTSJSONObject {
61
+ if (this.fontFamily !== '') {
62
+ return { color: this.color, fontSize: this.iconSize, fontFamily: this.fontFamily }
63
+ }
64
+ return { color: this.color, fontSize: this.iconSize }
65
+ }
66
+ },
67
+ created() { },
68
+ methods: {
69
+ /**
70
+ * 字体大小
71
+ */
72
+ getFontSize(size : number) : string {
73
+ return size + 'px';
74
+ },
75
+ },
76
+ }
77
+ </script>
78
+
79
+ <style scoped>
80
+ @font-face {
81
+ font-family: UniIconsFontFamily;
82
+ src: url('./uniicons.ttf');
83
+ }
84
+
85
+ .uni-icons {
86
+ font-family: UniIconsFontFamily;
87
+ font-size: 18px;
88
+ font-style: normal;
89
+ color: #333;
90
+ }
91
+ </style>
@@ -0,0 +1,114 @@
1
+ <template>
2
+ <!-- #ifdef APP-NVUE -->
3
+ <!-- <text :style="styleObj" class="uni-icons" @click="_onClick">{{unicode}}</text> -->
4
+ <!-- #endif -->
5
+ <!-- #ifndef APP-NVUE -->
6
+ <text
7
+ :style="styleObj"
8
+ class="uni-icons"
9
+ :class="['uniui-' + type, customPrefix, customPrefix ? type : '']"
10
+ @click="_onClick">
11
+ <slot></slot>
12
+ </text>
13
+ <!-- #endif -->
14
+ </template>
15
+
16
+ <script>
17
+ import { fontData } from './uniicons_file_vue.js';
18
+
19
+ const getVal = (val) => {
20
+ const reg = /^[0-9]*$/g;
21
+ return typeof val === 'number' || reg.test(val) ? val + 'px' : val;
22
+ };
23
+
24
+ // #ifdef APP-NVUE
25
+ var domModule = weex.requireModule('dom');
26
+ import iconUrl from './uniicons.ttf';
27
+ domModule.addRule('fontFace', {
28
+ fontFamily: 'uniicons',
29
+ src: "url('" + iconUrl + "')"
30
+ });
31
+ // #endif
32
+
33
+ /**
34
+ * Icons 图标
35
+ * @description 用于展示 icons 图标
36
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=28
37
+ * @property {Number} size 图标大小
38
+ * @property {String} type 图标图案,参考示例
39
+ * @property {String} color 图标颜色
40
+ * @property {String} customPrefix 自定义图标
41
+ * @event {Function} click 点击 Icon 触发事件
42
+ */
43
+ export default {
44
+ name: 'UniIcons',
45
+ emits: ['click'],
46
+ props: {
47
+ type: {
48
+ type: String,
49
+ default: ''
50
+ },
51
+ color: {
52
+ type: String,
53
+ default: '#333333'
54
+ },
55
+ size: {
56
+ type: [Number, String],
57
+ default: 16
58
+ },
59
+ customPrefix: {
60
+ type: String,
61
+ default: ''
62
+ },
63
+ fontFamily: {
64
+ type: String,
65
+ default: ''
66
+ }
67
+ },
68
+ data() {
69
+ return {
70
+ icons: fontData
71
+ };
72
+ },
73
+ computed: {
74
+ unicode() {
75
+ let code = this.icons.find((v) => v.font_class === this.type);
76
+ if (code) {
77
+ return code.unicode;
78
+ }
79
+ return '';
80
+ },
81
+ iconSize() {
82
+ return getVal(this.size);
83
+ },
84
+ styleObj() {
85
+ if (this.fontFamily !== '') {
86
+ return `color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`;
87
+ }
88
+ return `color: ${this.color}; font-size: ${this.iconSize};`;
89
+ }
90
+ },
91
+ methods: {
92
+ _onClick() {
93
+ this.$emit('click');
94
+ }
95
+ }
96
+ };
97
+ </script>
98
+
99
+ <style lang="scss">
100
+ /* #ifndef APP-NVUE */
101
+ @import './uniicons.css';
102
+
103
+ @font-face {
104
+ font-family: uniicons;
105
+ src: url('./uniicons.ttf');
106
+ }
107
+
108
+ /* #endif */
109
+ .uni-icons {
110
+ font-family: uniicons;
111
+ text-decoration: none;
112
+ text-align: center;
113
+ }
114
+ </style>