@tplc/wot 1.0.13 → 1.0.14

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.
@@ -86,8 +86,8 @@ export default {
86
86
  options: {
87
87
  virtualHost: true,
88
88
  addGlobalClass: true,
89
- styleIsolation: 'shared'
90
- }
89
+ styleIsolation: 'shared',
90
+ },
91
91
  }
92
92
  </script>
93
93
 
@@ -97,7 +97,14 @@ import wdPopup from '../wd-popup/wd-popup.vue'
97
97
  import wdPickerView from '../wd-picker-view/wd-picker-view.vue'
98
98
  import wdCell from '../wd-cell/wd-cell.vue'
99
99
  import { getCurrentInstance, onBeforeMount, ref, watch, computed, onMounted, nextTick } from 'vue'
100
- import { deepClone, defaultDisplayFormat, getType, isArray, isDef, isFunction } from '../common/util'
100
+ import {
101
+ deepClone,
102
+ defaultDisplayFormat,
103
+ getType,
104
+ isArray,
105
+ isDef,
106
+ isFunction,
107
+ } from '../common/util'
101
108
  import { type ColumnItem, formatArray, type PickerViewInstance } from '../wd-picker-view/types'
102
109
  import { FORM_KEY, type FormItemRule } from '../wd-form/types'
103
110
  import { useParent } from '../composables/useParent'
@@ -117,8 +124,12 @@ const popupShow = ref<boolean>(false)
117
124
  // 选定后展示的选中项
118
125
  const showValue = ref<string>('')
119
126
  const pickerValue = ref<string | number | boolean | string[] | number[] | boolean[]>('')
120
- const displayColumns = ref<Array<string | number | ColumnItem | Array<string | number | ColumnItem>>>([]) // 传入 pickerView 的columns
121
- const resetColumns = ref<Array<string | number | ColumnItem | Array<string | number | ColumnItem>>>([]) // 保存之前的 columns,当取消时,将数据源回滚,避免多级联动数据源不正确的情况
127
+ const displayColumns = ref<
128
+ Array<string | number | ColumnItem | Array<string | number | ColumnItem>>
129
+ >([]) // 传入 pickerView 的columns
130
+ const resetColumns = ref<Array<string | number | ColumnItem | Array<string | number | ColumnItem>>>(
131
+ [],
132
+ ) // 保存之前的 columns,当取消时,将数据源回滚,避免多级联动数据源不正确的情况
122
133
  const isPicking = ref<boolean>(false) // 判断pickview是否还在滑动中
123
134
  const hasConfirmed = ref<boolean>(false) // 判断用户是否点击了确认按钮
124
135
 
@@ -138,8 +149,8 @@ watch(
138
149
  },
139
150
  {
140
151
  immediate: true,
141
- deep: true
142
- }
152
+ deep: true,
153
+ },
143
154
  )
144
155
 
145
156
  watch(
@@ -151,8 +162,8 @@ watch(
151
162
  },
152
163
  {
153
164
  deep: true,
154
- immediate: true
155
- }
165
+ immediate: true,
166
+ },
156
167
  )
157
168
 
158
169
  watch(
@@ -171,8 +182,8 @@ watch(
171
182
  },
172
183
  {
173
184
  deep: true,
174
- immediate: true
175
- }
185
+ immediate: true,
186
+ },
176
187
  )
177
188
 
178
189
  watch(
@@ -184,8 +195,8 @@ watch(
184
195
  },
185
196
  {
186
197
  deep: true,
187
- immediate: true
188
- }
198
+ immediate: true,
199
+ },
189
200
  )
190
201
 
191
202
  // 是否展示清除按钮
@@ -263,7 +274,7 @@ function getSelects(value: string | number | Array<string | number | Array<any>>
263
274
  if (value.length === 0) {
264
275
  value = formatColumns.map(() => 0)
265
276
  }
266
- let selected: number[] = []
277
+ const selected: number[] = []
267
278
  value.forEach((target, col) => {
268
279
  let row = formatColumns[col].findIndex((row) => {
269
280
  return row[props.valueKey].toString() === target.toString()
@@ -306,7 +317,7 @@ function showPopup() {
306
317
  function onCancel() {
307
318
  popupShow.value = false
308
319
  emit('cancel')
309
- let timmer = setTimeout(() => {
320
+ const timmer = setTimeout(() => {
310
321
  clearTimeout(timmer)
311
322
  isDef(pickerViewWd.value) && pickerViewWd.value.resetColumns(resetColumns.value)
312
323
  }, 300)
@@ -330,7 +341,7 @@ function onConfirm() {
330
341
  (isPass: boolean) => {
331
342
  isPass && handleConfirm()
332
343
  },
333
- proxy.$.exposed
344
+ proxy.$.exposed,
334
345
  )
335
346
  } else {
336
347
  handleConfirm()
@@ -353,7 +364,7 @@ function handleConfirm() {
353
364
  setShowValue(selects)
354
365
  emit('confirm', {
355
366
  value: values,
356
- selectedItems: selects
367
+ selectedItems: selects,
357
368
  })
358
369
  }
359
370
  /**
@@ -404,7 +415,7 @@ function handleClear() {
404
415
  defineExpose<PickerExpose>({
405
416
  close,
406
417
  open,
407
- setLoading
418
+ setLoading,
408
419
  })
409
420
  </script>
410
421
  <style lang="scss" scoped>
@@ -1,5 +1,5 @@
1
- @import "./../common/abstracts/_mixin.scss";
2
- @import "./../common/abstracts/variable.scss";
1
+ @import './../common/abstracts/_mixin.scss';
2
+ @import './../common/abstracts/variable.scss';
3
3
 
4
4
  .wot-theme-dark {
5
5
  @include b(radio) {
@@ -29,7 +29,7 @@
29
29
  color: $-dark-color-gray;
30
30
  }
31
31
  }
32
-
32
+
33
33
  @include when(button) {
34
34
  .wd-radio__label {
35
35
  border-color: #c8c9cc;
@@ -44,7 +44,7 @@
44
44
  }
45
45
  }
46
46
  }
47
-
47
+
48
48
  @include when(dot) {
49
49
  .wd-radio__shape {
50
50
  border-color: #c8c9cc;
@@ -109,7 +109,7 @@
109
109
 
110
110
  @include when(dot) {
111
111
  .wd-radio__shape {
112
- border: 2px solid $-radio-dot-border-color;
112
+ border: 1px solid $-radio-dot-border-color;
113
113
  border-radius: 50%;
114
114
  position: relative;
115
115
  display: inline-block;
@@ -117,7 +117,7 @@
117
117
  transition: none;
118
118
 
119
119
  &::before {
120
- content: "";
120
+ content: '';
121
121
  position: absolute;
122
122
  width: $-radio-dot-size;
123
123
  height: $-radio-dot-size;
@@ -126,7 +126,7 @@
126
126
  border-radius: 50%;
127
127
  background-color: #fff;
128
128
  transform: scale(0);
129
- transition: transform .2s ease-in;
129
+ transition: transform 0.2s ease-in;
130
130
  }
131
131
  }
132
132
  @include when(checked) {
@@ -154,7 +154,7 @@
154
154
  height: $-radio-button-height;
155
155
  min-width: $-radio-button-min-width;
156
156
  max-width: $-radio-button-max-width;
157
- padding: 5px 15px;
157
+ padding: 4rpx 12rpx;
158
158
  margin-right: 0;
159
159
  border-radius: $-radio-button-radius;
160
160
  background-color: $-radio-button-bg;
@@ -190,7 +190,7 @@
190
190
  margin-right: 4px;
191
191
  float: left;
192
192
  &::after {
193
- content: "";
193
+ content: '';
194
194
  display: table;
195
195
  clear: both;
196
196
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "@tplc/wot",
3
3
  "name": "@tplc/wot",
4
- "version": "1.0.13",
4
+ "version": "1.0.14",
5
5
  "keywords": [
6
6
  "wot-design-uni",
7
7
  "国际化",