@varlet/ui 1.27.11-alpha.1653999804324 → 1.27.11

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/es/input/Input.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import VarFormDetails from '../form-details';
2
2
  import VarIcon from '../icon';
3
- import { defineComponent, getCurrentInstance, ref, computed, nextTick } from 'vue';
3
+ import { defineComponent, getCurrentInstance, ref, computed, nextTick, onMounted } from 'vue';
4
4
  import { props } from './props';
5
5
  import { isEmpty } from '../utils/shared';
6
6
  import { useValidation, createNamespace, call } from '../utils/components';
@@ -290,8 +290,10 @@ export default defineComponent({
290
290
 
291
291
 
292
292
  var focus = () => {
293
+ var _el$value;
294
+
293
295
  ;
294
- el.value.focus();
296
+ (_el$value = el.value) == null ? void 0 : _el$value.focus();
295
297
  }; // expose
296
298
 
297
299
 
@@ -306,6 +308,9 @@ export default defineComponent({
306
308
  resetValidation
307
309
  };
308
310
  call(bindForm, inputProvider);
311
+ onMounted(() => {
312
+ if (props.autofocus) focus();
313
+ });
309
314
  return {
310
315
  el,
311
316
  id,
package/es/input/props.js CHANGED
@@ -61,6 +61,10 @@ export var props = {
61
61
  type: Boolean,
62
62
  default: false
63
63
  },
64
+ autofocus: {
65
+ type: Boolean,
66
+ default: false
67
+ },
64
68
  validateTrigger: {
65
69
  type: Array,
66
70
  default: () => ['onInput', 'onClear']
@@ -1,8 +1,8 @@
1
1
  import '../../styles/common.css'
2
+ import '../SnackbarSfc.css'
2
3
  import '../../styles/elevation.css'
3
4
  import '../../loading/loading.css'
4
5
  import '../../button/button.css'
5
6
  import '../../icon/icon.css'
6
7
  import '../snackbar.css'
7
8
  import '../coreSfc.css'
8
- import '../SnackbarSfc.css'
@@ -1,8 +1,8 @@
1
1
  import '../../styles/common.less'
2
+ import '../SnackbarSfc.less'
2
3
  import '../../styles/elevation.less'
3
4
  import '../../loading/loading.less'
4
5
  import '../../button/button.less'
5
6
  import '../../icon/icon.less'
6
7
  import '../snackbar.less'
7
8
  import '../coreSfc.less'
8
- import '../SnackbarSfc.less'
package/es/varlet.esm.js CHANGED
@@ -10830,6 +10830,10 @@ var props$p = {
10830
10830
  type: Boolean,
10831
10831
  default: false
10832
10832
  },
10833
+ autofocus: {
10834
+ type: Boolean,
10835
+ default: false
10836
+ },
10833
10837
  validateTrigger: {
10834
10838
  type: Array,
10835
10839
  default: () => ["onInput", "onClear"]
@@ -11086,7 +11090,8 @@ var Input = defineComponent({
11086
11090
  };
11087
11091
  var validate = () => v(props2.rules, props2.modelValue);
11088
11092
  var focus = () => {
11089
- el.value.focus();
11093
+ var _el$value;
11094
+ (_el$value = el.value) == null ? void 0 : _el$value.focus();
11090
11095
  };
11091
11096
  var blur = () => {
11092
11097
  el.value.blur();
@@ -11097,6 +11102,10 @@ var Input = defineComponent({
11097
11102
  resetValidation
11098
11103
  };
11099
11104
  call(bindForm, inputProvider);
11105
+ onMounted(() => {
11106
+ if (props2.autofocus)
11107
+ focus();
11108
+ });
11100
11109
  return {
11101
11110
  el,
11102
11111
  id,
@@ -17540,9 +17549,9 @@ var skeleton = "";
17540
17549
  var SkeletonSfc = "";
17541
17550
  var slider = "";
17542
17551
  var SliderSfc = "";
17552
+ var SnackbarSfc = "";
17543
17553
  var snackbar = "";
17544
17554
  var coreSfc = "";
17545
- var SnackbarSfc = "";
17546
17555
  var space = "";
17547
17556
  var step = "";
17548
17557
  var StepSfc = "";
@@ -899,6 +899,10 @@
899
899
  "type": "boolean",
900
900
  "description": "文本域是否可以拖动调整尺寸 默认值:false"
901
901
  },
902
+ "var-input/autofocus": {
903
+ "type": "boolean",
904
+ "description": "是否自动聚焦 默认值:false"
905
+ },
902
906
  "var-input/validate-trigger": {
903
907
  "type": "ValidateTriggers[]",
904
908
  "description": "触发验证的时机,可选值为 `onFocus` `onBlur` `onChange` `onClick` `onClear` `onInput` 默认值:['onInput', 'onClear']"
@@ -333,6 +333,7 @@
333
333
  "disabled",
334
334
  "clearable",
335
335
  "resize",
336
+ "autofocus",
336
337
  "validate-trigger",
337
338
  "rules"
338
339
  ]
@@ -2652,6 +2652,15 @@
2652
2652
  "kind": "expression"
2653
2653
  }
2654
2654
  },
2655
+ {
2656
+ "name": "autofocus",
2657
+ "description": "是否自动聚焦",
2658
+ "default": "false",
2659
+ "value": {
2660
+ "type": "boolean",
2661
+ "kind": "expression"
2662
+ }
2663
+ },
2655
2664
  {
2656
2665
  "name": "validate-trigger",
2657
2666
  "description": "触发验证的时机,可选值为 `onFocus` `onBlur` `onChange` `onClick` `onClear` `onInput`",
@@ -306,8 +306,10 @@ var _default = (0, _vue.defineComponent)({
306
306
 
307
307
 
308
308
  var focus = () => {
309
+ var _el$value;
310
+
309
311
  ;
310
- el.value.focus();
312
+ (_el$value = el.value) == null ? void 0 : _el$value.focus();
311
313
  }; // expose
312
314
 
313
315
 
@@ -322,6 +324,9 @@ var _default = (0, _vue.defineComponent)({
322
324
  resetValidation
323
325
  };
324
326
  (0, _components.call)(bindForm, inputProvider);
327
+ (0, _vue.onMounted)(() => {
328
+ if (props.autofocus) focus();
329
+ });
325
330
  return {
326
331
  el,
327
332
  id,
@@ -68,6 +68,10 @@ var props = {
68
68
  type: Boolean,
69
69
  default: false
70
70
  },
71
+ autofocus: {
72
+ type: Boolean,
73
+ default: false
74
+ },
71
75
  validateTrigger: {
72
76
  type: Array,
73
77
  default: () => ['onInput', 'onClear']
@@ -1,8 +1,8 @@
1
1
  require('../../styles/common.css')
2
+ require('../SnackbarSfc.css')
2
3
  require('../../styles/elevation.css')
3
4
  require('../../loading/loading.css')
4
5
  require('../../button/button.css')
5
6
  require('../../icon/icon.css')
6
7
  require('../snackbar.css')
7
8
  require('../coreSfc.css')
8
- require('../SnackbarSfc.css')
@@ -1,8 +1,8 @@
1
1
  require('../../styles/common.less')
2
+ require('../SnackbarSfc.less')
2
3
  require('../../styles/elevation.less')
3
4
  require('../../loading/loading.less')
4
5
  require('../../button/button.less')
5
6
  require('../../icon/icon.less')
6
7
  require('../snackbar.less')
7
8
  require('../coreSfc.less')
8
- require('../SnackbarSfc.less')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "1.27.11-alpha.1653999804324",
3
+ "version": "1.27.11",
4
4
  "description": "A material like components library",
5
5
  "module": "es/index.js",
6
6
  "main": "lib/index.js",
@@ -39,13 +39,13 @@
39
39
  },
40
40
  "gitHead": "ee9c3866bedad96c86365b0f9888a3a6bb781b1f",
41
41
  "dependencies": {
42
- "@varlet/icons": "1.27.11-alpha.1653999804324",
42
+ "@varlet/icons": "1.27.11",
43
43
  "dayjs": "^1.10.4",
44
44
  "decimal.js": "^10.2.1"
45
45
  },
46
46
  "devDependencies": {
47
- "@varlet/cli": "1.27.11-alpha.1653999804324",
48
- "@varlet/touch-emulator": "1.27.11-alpha.1653999804324",
47
+ "@varlet/cli": "1.27.11",
48
+ "@varlet/touch-emulator": "1.27.11",
49
49
  "@vue/runtime-core": "3.2.25",
50
50
  "@vue/test-utils": "2.0.0-rc.6",
51
51
  "clipboard": "^2.0.6",
package/types/input.d.ts CHANGED
@@ -17,6 +17,7 @@ export interface InputProps {
17
17
  readonly?: boolean
18
18
  clearable?: boolean
19
19
  resize?: boolean
20
+ autofocus?: boolean
20
21
  validateTrigger?: InputValidateTriggers[]
21
22
  rules?: Array<(v: string) => any>
22
23
  onFocus?: (e: Event) => void