@opentinyvue/vue-input 2.26.0 → 2.28.0

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.
@@ -110,7 +110,7 @@ var __vue2_script = defineComponent({
110
110
  TinyButton: Button,
111
111
  TinyDialogBox: DialogBox
112
112
  },
113
- props: [].concat(props, ["name", "size", "form", "type", "mask", "label", "modelValue", "height", "resize", "counter", "autosize", "disabled", "readonly", "tabindex", "clearable", "suffixIcon", "prefixIcon", "autocomplete", "showPassword", "validateEvent", "showWordLimit", "customClass", "displayOnly", "displayOnlyContent", "showEmptyValue", "popupMore", "showTooltip", "frontClearIcon", "hoverExpand"]),
113
+ props: [].concat(props, ["name", "size", "form", "type", "mask", "label", "modelValue", "height", "resize", "counter", "autosize", "disabled", "readonly", "tabindex", "clearable", "suffixIcon", "prefixIcon", "autocomplete", "showPassword", "validateEvent", "showWordLimit", "customClass", "displayOnly", "displayOnlyContent", "showEmptyValue", "popupMore", "showTooltip", "frontClearIcon", "hoverExpand", "inputBoxType"]),
114
114
  setup: function setup$1(props2, context) {
115
115
  return setup({
116
116
  props: props2,
@@ -189,7 +189,7 @@ var render = function render2() {
189
189
  staticClass: "absolute top-0 left-0 max-w-full overflow-hidden text-ellipsis whitespace-nowrap leading-7 sm:leading-normal text-color-text-primary"
190
190
  }, [_vm._v(" " + _vm._s(_vm.state.displayOnlyText) + " ")])]) : _vm._e(), _vm.type !== "textarea" ? _c("input", _vm._b({
191
191
  ref: "input",
192
- class: _vm.m("w-full border-0 sm:border px-0 sm:px-3 sm:border-solid sm:border-color-border sm:hover:border-color-border-hover sm:focus:border-color-brand-focus sm:disabled:border-color-border placeholder:text-color-text-placeholder placeholder:text-sm sm:disabled:placeholder:text-color-text-disabled text-sm text-color-text-primary bg-color-bg-1 disabled:cursor-not-allowed disabled:text-color-text-disabled sm:disabled:text-color-text-disabled sm:disabled:bg-color-bg-6 py-0 outline-0 transition-colors duration-200 ease-in-out ", _vm.state.inputSizeMf === "medium" ? "h-8 leading-8 " + _vm.m("sm:text-sm") + " placeholder:text-sm" : _vm.state.inputSizeMf === "mini" ? "h-6 leading-6 text-xs placeholder:text-xs" : "h-7 leading-7", _vm.slots.prepend || _vm.slots.append ? "align-middle table-cell" : "inline-block", _vm.slots.prepend && _vm.slots.append ? "rounded-none" : _vm.slots.prepend ? "rounded-tl-none rounded-bl-none rounded-tr rounded-br" : _vm.slots.append ? "rounded-tl rounded-bl rounded-tr-none rounded-br-none" : "rounded", _vm.readonly ? " text-ellipsis overflow-hidden whitespace-nowrap" : "sm:border", (_vm.slots.prefix || _vm.prefixIcon) && (_vm.slots.suffix || _vm.suffixIcon || _vm.clearable || _vm.showPassword) ? "px-6 sm:px-6" : _vm.slots.prefix || _vm.prefixIcon ? "pl-6 sm:pl-6 pr-0 sm:pr-3" : _vm.slots.suffix || _vm.suffixIcon || _vm.clearable || _vm.showPassword ? "pl-0 sm:pl-3 pr-6 sm:pr-6" : "", _vm.mask && _vm.state.inputDisabled ? !_vm.state.maskValueVisible ? "font-[serif] pr-6 sm:pr-6" : "pr-6 sm:pr-6" : "", (_vm.slots.suffix || _vm.suffixIcon || _vm.showPassword) && _vm.clearable ? "pr-10 sm:pr-10" : "", _vm.state.isDisplayOnly ? "invisible h-auto leading-none border-0" : "", _vm.state.isWordLimitVisible ? _vm.clearable ? "pr-18 sm:pr-18" : "pr-14 sm:pr-14" : "", _vm.customClass),
192
+ class: _vm.m("w-full border-0 sm:border px-0 sm:px-3 sm:border-solid sm:border-color-border sm:hover:border-color-border-hover sm:focus:border-color-brand-focus sm:disabled:border-color-border placeholder:text-color-text-placeholder placeholder:text-sm sm:disabled:placeholder:text-color-text-disabled text-sm text-color-text-primary bg-color-bg-1 disabled:cursor-not-allowed disabled:text-color-text-disabled sm:disabled:text-color-text-disabled sm:disabled:bg-color-bg-6 py-0 outline-0 transition-colors duration-200 ease-in-out ", _vm.state.inputSizeMf === "medium" ? "h-8 leading-8 " + _vm.m("sm:text-sm") + " placeholder:text-sm" : _vm.state.inputSizeMf === "mini" ? "h-6 leading-6 text-xs placeholder:text-xs" : "h-7 leading-7", _vm.slots.prepend || _vm.slots.append ? "align-middle table-cell" : "inline-block", _vm.inputBoxType === "underline" ? "rounded-none border-t-0 border-l-0 border-r-0 border-b sm:border-b" : _vm.slots.prepend && _vm.slots.append ? "rounded-none" : _vm.slots.prepend ? "rounded-tl-none rounded-bl-none rounded-tr rounded-br" : _vm.slots.append ? "rounded-tl rounded-bl rounded-tr-none rounded-br-none" : "rounded", _vm.readonly ? " text-ellipsis overflow-hidden whitespace-nowrap" : "sm:border", (_vm.slots.prefix || _vm.prefixIcon) && (_vm.slots.suffix || _vm.suffixIcon || _vm.clearable || _vm.showPassword) ? "px-6 sm:px-6" : _vm.slots.prefix || _vm.prefixIcon ? "pl-6 sm:pl-6 pr-0 sm:pr-3" : _vm.slots.suffix || _vm.suffixIcon || _vm.clearable || _vm.showPassword ? "pl-0 sm:pl-3 pr-6 sm:pr-6" : "", _vm.mask && _vm.state.inputDisabled ? !_vm.state.maskValueVisible ? "font-[serif] pr-6 sm:pr-6" : "pr-6 sm:pr-6" : "", (_vm.slots.suffix || _vm.suffixIcon || _vm.showPassword) && _vm.clearable ? "pr-10 sm:pr-10" : "", _vm.state.isDisplayOnly ? "invisible h-auto leading-none border-0" : "", _vm.state.isWordLimitVisible ? _vm.clearable ? "pr-18 sm:pr-18" : "pr-14 sm:pr-14" : "", _vm.customClass),
193
193
  attrs: {
194
194
  "data-tag": "tiny-input-inner",
195
195
  "name": _vm.name,
@@ -199,7 +199,7 @@ var render = function render2() {
199
199
  "readonly": _vm.readonly,
200
200
  "unselectable": _vm.readonly ? "on" : "off",
201
201
  "autocomplete": _vm.autocomplete,
202
- "aria-label": _vm.label
202
+ "aria-label": _vm.label || _vm.$attrs.placeholder
203
203
  },
204
204
  on: {
205
205
  "compositionstart": _vm.handleCompositionStart,
@@ -247,6 +247,11 @@ var render = function render2() {
247
247
  staticClass: "pointer-events-auto text-xs fill-color-icon-placeholder flex justify-start items-center"
248
248
  }, [_vm.state.showClear ? _c("icon-close", {
249
249
  class: _vm.m("hidden sm:block text-center transition-all duration-300 ease-in-out text-xs cursor-pointer", _vm.state.inputSizeMf === "medium" ? "leading-8" : _vm.state.inputSizeMf === "mini" ? "leading-6" : "leading-7"),
250
+ attrs: {
251
+ "role": "button",
252
+ "aria-label": "clear",
253
+ "tabindex": "0"
254
+ },
250
255
  on: {
251
256
  "mousedown": function mousedown($event) {
252
257
  $event.preventDefault();
@@ -258,6 +263,11 @@ var render = function render2() {
258
263
  class: _vm.m("text-center transition-all duration-300 ease-in-out text-xs", _vm.state.inputSizeMf === "medium" ? "leading-8" : _vm.state.inputSizeMf === "mini" ? "leading-6" : "leading-7")
259
264
  }) : _vm._e()] : _vm._e(), _vm.state.showClear ? _c("icon-error", {
260
265
  class: _vm.m("text-center transition-all duration-300 ease-in-out text-xs cursor-pointer fill-color-none-hover block sm:hidden", _vm.state.inputSizeMf === "medium" ? "leading-8" : _vm.state.inputSizeMf === "mini" ? "leading-6" : "leading-7"),
266
+ attrs: {
267
+ "role": "button",
268
+ "aria-label": "clear",
269
+ "tabindex": "0"
270
+ },
261
271
  on: {
262
272
  "mousedown": function mousedown($event) {
263
273
  $event.preventDefault();
@@ -267,6 +277,11 @@ var render = function render2() {
267
277
  }) : _vm._e(), _vm.showPassword ? _c(_vm.state.passwordVisible ? "icon-eyeopen" : "icon-eyeclose", {
268
278
  tag: "component",
269
279
  class: _vm.m("text-center transition-all duration-300 ease-in-out text-xs", _vm.state.inputSizeMf === "medium" ? "leading-8" : _vm.state.inputSizeMf === "mini" ? "leading-6" : "leading-7"),
280
+ attrs: {
281
+ "role": "button",
282
+ "aria-label": _vm.state.passwordVisible ? "hide password" : "show password",
283
+ "tabindex": "0"
284
+ },
270
285
  nativeOn: {
271
286
  "click": function click($event) {
272
287
  return _vm.handlePasswordVisible.apply(null, arguments);
@@ -275,13 +290,23 @@ var render = function render2() {
275
290
  }) : _vm._e(), _vm.mask && _vm.state.inputDisabled ? _c(_vm.state.maskValueVisible ? "icon-eyeopen" : "icon-eyeclose", {
276
291
  tag: "component",
277
292
  class: _vm.m("text-center transition-all duration-300 ease-in-out text-xs fill-color-text-placeholder", _vm.state.inputSizeMf === "medium" ? "leading-8" : _vm.state.inputSizeMf === "mini" ? "leading-6" : "leading-7"),
293
+ attrs: {
294
+ "role": "button",
295
+ "aria-label": _vm.state.maskValueVisible ? "hide content" : "show content",
296
+ "tabindex": "0"
297
+ },
278
298
  nativeOn: {
279
299
  "click": function click($event) {
280
300
  _vm.state.maskValueVisible = !_vm.state.maskValueVisible;
281
301
  }
282
302
  }
283
303
  }) : _vm._e(), _vm.state.isWordLimitVisible ? _c("span", {
284
- staticClass: "h-full inline-flex items-center text-xs sm:text-sm text-color-text-placeholder"
304
+ staticClass: "h-full inline-flex items-center text-xs sm:text-sm text-color-text-placeholder",
305
+ attrs: {
306
+ "id": (_vm.$attrs.id || _vm.name || "input") + "-word-limit",
307
+ "role": "status",
308
+ "aria-live": "polite"
309
+ }
285
310
  }, [_c("span", {
286
311
  staticClass: "bg-color-bg-1 leading-none inline-block text-xs"
287
312
  }, [_vm._v(_vm._s(_vm.state.showWordLimit ? _vm.state.textLength + "/" + _vm.state.upperLimit : _vm.state.textLength))])]) : _vm._e()], 2), _vm.state.validateState ? _c("i", {
@@ -365,7 +390,7 @@ var render = function render2() {
365
390
  "readonly": _vm.readonly,
366
391
  "unselectable": _vm.readonly ? "on" : "off",
367
392
  "autocomplete": _vm.autocomplete,
368
- "aria-label": _vm.label
393
+ "aria-label": _vm.label || _vm.$attrs.placeholder
369
394
  },
370
395
  on: {
371
396
  "compositionstart": _vm.handleCompositionStart,
@@ -385,7 +410,10 @@ var render = function render2() {
385
410
  }, "textarea", _vm.a(_vm.$attrs, ["type", "class", "style", "^on[A-Z]"]), false))], 1), _vm.state.isWordLimitVisible && _vm.type === "textarea" ? _c("span", {
386
411
  staticClass: "text-color-text-placeholder text-xs leading-5 absolute bottom-0 right-3",
387
412
  attrs: {
388
- "data-tag": "tiny-input-limit"
413
+ "data-tag": "tiny-input-limit",
414
+ "id": (_vm.$attrs.id || _vm.name || "textarea") + "-word-limit",
415
+ "role": "status",
416
+ "aria-live": "polite"
389
417
  }
390
418
  }, [_vm._v(_vm._s(_vm.state.showWordLimit ? _vm.state.textLength + "/" + _vm.state.upperLimit : _vm.state.textLength))]) : _vm._e(), _vm._t("default")], 2);
391
419
  };
package/lib/pc.js CHANGED
@@ -130,7 +130,7 @@ var render = function render2() {
130
130
  return _vm.$emit("click", $event);
131
131
  }
132
132
  }
133
- }, "div", _vm.a(_vm.$attrs, ["class"]), false), [_vm.type !== "textarea" ? [_vm.slots.prepend && !_vm.state.isDisplayOnly ? _c("div", {
133
+ }, "div", _vm.a(_vm.$attrs, ["class", "role", "aria-haspopup", "aria-autocomplete", "aria-owns", "aria-controls"]), false), [_vm.type !== "textarea" ? [_vm.slots.prepend && !_vm.state.isDisplayOnly ? _c("div", {
134
134
  ref: "prepend",
135
135
  staticClass: "tiny-input-group__prepend"
136
136
  }, [_vm._t("prepend")], 2) : _vm._e(), _c("span", {
@@ -176,7 +176,7 @@ var render = function render2() {
176
176
  "readonly": _vm.readonly,
177
177
  "unselectable": _vm.readonly ? "on" : "off",
178
178
  "autocomplete": _vm.autocomplete,
179
- "aria-label": _vm.label
179
+ "aria-label": _vm.label || _vm.$attrs.placeholder
180
180
  },
181
181
  on: {
182
182
  "compositionend": _vm.handleCompositionEnd,
@@ -196,7 +196,7 @@ var render = function render2() {
196
196
  return _vm.$emit("paste", $event);
197
197
  }
198
198
  }
199
- }, "input", _vm.a(_vm.$attrs, ["type", "class", "style", "^on[A-Z]", "id"]), false)) : _vm._e()], 1), _vm.isMemoryStorage ? _c("tiny-tall-storage", {
199
+ }, "input", _vm.a(_vm.$attrs, ["type", "class", "style", "^on[A-Z]", "id", "aria-required", "aria-invalid"]), false)) : _vm._e()], 1), _vm.isMemoryStorage ? _c("tiny-tall-storage", {
200
200
  attrs: {
201
201
  "name": _vm.name,
202
202
  "localstorage-data": _vm.storageData,
@@ -222,6 +222,11 @@ var render = function render2() {
222
222
  staticClass: "tiny-input__suffix-inner"
223
223
  }, [_vm.frontClearIcon && _vm.state.showClear ? _c("icon-close", {
224
224
  staticClass: "tiny-svg-size tiny-input__icon tiny-input__clear",
225
+ attrs: {
226
+ "role": "button",
227
+ "aria-label": "清除",
228
+ "tabindex": "0"
229
+ },
225
230
  on: {
226
231
  "mousedown": function mousedown($event) {
227
232
  $event.preventDefault();
@@ -233,6 +238,11 @@ var render = function render2() {
233
238
  staticClass: "tiny-svg-size tiny-input__icon"
234
239
  }) : _vm._e()] : _vm._e(), !_vm.frontClearIcon && _vm.state.showClear ? _c("icon-close", {
235
240
  staticClass: "tiny-svg-size tiny-input__icon tiny-input__clear",
241
+ attrs: {
242
+ "role": "button",
243
+ "aria-label": "清除",
244
+ "tabindex": "0"
245
+ },
236
246
  on: {
237
247
  "mousedown": function mousedown($event) {
238
248
  $event.preventDefault();
@@ -242,6 +252,11 @@ var render = function render2() {
242
252
  }) : _vm._e(), _vm.showPassword ? _c(_vm.state.passwordVisible ? "icon-eyeopen" : "icon-eyeclose", {
243
253
  tag: "component",
244
254
  staticClass: "tiny-svg-size tiny-input__icon",
255
+ attrs: {
256
+ "role": "button",
257
+ "aria-label": _vm.state.passwordVisible ? "hide password" : "show password",
258
+ "tabindex": "0"
259
+ },
245
260
  nativeOn: {
246
261
  "click": function click($event) {
247
262
  return _vm.handlePasswordVisible.apply(null, arguments);
@@ -250,13 +265,23 @@ var render = function render2() {
250
265
  }) : _vm._e(), _vm.mask && _vm.state.inputDisabled ? _c(_vm.state.maskValueVisible ? "icon-eyeopen" : "icon-eyeclose", {
251
266
  tag: "component",
252
267
  staticClass: "tiny-svg-size tiny-input__icon",
268
+ attrs: {
269
+ "role": "button",
270
+ "aria-label": _vm.state.maskValueVisible ? "hide content" : "show content",
271
+ "tabindex": "0"
272
+ },
253
273
  nativeOn: {
254
274
  "click": function click($event) {
255
275
  _vm.state.maskValueVisible = !_vm.state.maskValueVisible;
256
276
  }
257
277
  }
258
278
  }) : _vm._e(), _vm.state.isWordLimitVisible ? _c("span", {
259
- staticClass: "tiny-input__count"
279
+ staticClass: "tiny-input__count",
280
+ attrs: {
281
+ "id": (_vm.$attrs.id || _vm.name || "input") + "-word-limit",
282
+ "role": "status",
283
+ "aria-live": "polite"
284
+ }
260
285
  }, [_c("span", {
261
286
  staticClass: "tiny-input__count-inner"
262
287
  }, [_c("span", {
@@ -346,7 +371,7 @@ var render = function render2() {
346
371
  "readonly": _vm.readonly,
347
372
  "unselectable": _vm.readonly ? "on" : "off",
348
373
  "autocomplete": _vm.autocomplete,
349
- "aria-label": _vm.label
374
+ "aria-label": _vm.label || _vm.$attrs.placeholder
350
375
  },
351
376
  on: {
352
377
  "compositionstart": _vm.handleCompositionStart,
@@ -378,8 +403,13 @@ var render = function render2() {
378
403
  return _vm.$emit("paste", $event);
379
404
  }
380
405
  }
381
- }, "textarea", _vm.a(_vm.$attrs, ["type", "class", "style", "id"]), false))], 1), _vm.state.isWordLimitVisible && _vm.type === "textarea" ? _c("span", {
382
- staticClass: "tiny-input__count"
406
+ }, "textarea", _vm.a(_vm.$attrs, ["type", "class", "style", "id", "aria-required", "aria-invalid"]), false))], 1), _vm.state.isWordLimitVisible && _vm.type === "textarea" ? _c("span", {
407
+ staticClass: "tiny-input__count",
408
+ attrs: {
409
+ "id": (_vm.$attrs.id || _vm.name || "textarea") + "-word-limit",
410
+ "role": "status",
411
+ "aria-live": "polite"
412
+ }
383
413
  }, [_c("span", {
384
414
  staticClass: "tiny-input__count-inner"
385
415
  }, [_c("span", {
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@opentinyvue/vue-input",
3
3
  "type": "module",
4
- "version": "2.26.0",
4
+ "version": "2.28.0",
5
5
  "description": "",
6
6
  "license": "MIT",
7
7
  "sideEffects": false,
8
8
  "main": "./lib/index.js",
9
9
  "module": "./lib/index.js",
10
10
  "dependencies": {
11
- "@opentinyvue/vue-directive": "~2.26.0",
12
- "@opentinyvue/vue-button": "~2.26.0",
13
- "@opentinyvue/vue-common": "~2.26.0",
14
- "@opentinyvue/vue-dialog-box": "~2.26.0",
15
- "@opentinyvue/vue-icon": "~2.26.0",
16
- "@opentinyvue/vue-renderless": "~3.26.0",
17
- "@opentinyvue/vue-theme": "~3.26.0",
18
- "@opentinyvue/vue-tooltip": "~2.26.0"
11
+ "@opentinyvue/vue-directive": "~2.28.0",
12
+ "@opentinyvue/vue-button": "~2.28.0",
13
+ "@opentinyvue/vue-common": "~2.28.0",
14
+ "@opentinyvue/vue-dialog-box": "~2.28.0",
15
+ "@opentinyvue/vue-icon": "~2.28.0",
16
+ "@opentinyvue/vue-renderless": "~3.28.0",
17
+ "@opentinyvue/vue-theme": "~3.28.0",
18
+ "@opentinyvue/vue-tooltip": "~2.28.0"
19
19
  },
20
20
  "types": "index.d.ts",
21
21
  "scripts": {