@opentinyvue/vue-input 2.21.0 → 2.22.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.
package/lib/index.js CHANGED
@@ -7,9 +7,8 @@ function _extends() {
7
7
  return n;
8
8
  }, _extends.apply(null, arguments);
9
9
  }
10
- import { defineComponent, $prefix, $setup, $props } from "@opentinyvue/vue-common";
10
+ import { defineComponent, $props, $setup, $prefix } from "@opentinyvue/vue-common";
11
11
  import PcTemplate from "./pc.js";
12
- import MobileTemplate from "./mobile.js";
13
12
  import MobileFirstTemplate from "./mobile-first.js";
14
13
  var template = function template2(mode) {
15
14
  var _process$env;
@@ -17,9 +16,6 @@ var template = function template2(mode) {
17
16
  if ("pc" === (tinyMode || mode)) {
18
17
  return PcTemplate;
19
18
  }
20
- if ("mobile" === (tinyMode || mode)) {
21
- return MobileTemplate;
22
- }
23
19
  if ("mobile-first" === (tinyMode || mode)) {
24
20
  return MobileFirstTemplate;
25
21
  }
@@ -198,7 +194,7 @@ var Input = defineComponent({
198
194
  });
199
195
  }
200
196
  });
201
- var version = "2.21.0";
197
+ var version = "2.22.0";
202
198
  Input.model = {
203
199
  prop: "modelValue",
204
200
  event: "update:modelValue"
@@ -301,6 +301,7 @@ var render = function render2() {
301
301
  "effect": "light",
302
302
  "content": _vm.state.displayOnlyTooltip,
303
303
  "placement": "top",
304
+ "pre": "",
304
305
  "popper-class": _vm.state.tooltipConfig.popperClass || "",
305
306
  "popper-options": {
306
307
  bubbling: true
@@ -312,7 +313,7 @@ var render = function render2() {
312
313
  }
313
314
  }
314
315
  }, [_c("div", {
315
- staticClass: "flex"
316
+ staticClass: "inline-flex"
316
317
  }, [_c("span", {
317
318
  ref: "textBox",
318
319
  staticClass: "text-box max-w-full break-words line-clamp-5 text-sm text-color-text-primary before:content-[''] before:float-right before:h-full before:-mb-4",
@@ -350,7 +351,9 @@ var render = function render2() {
350
351
  },
351
352
  proxy: true
352
353
  }], null, false, 2786811157)
353
- }, [_c("div", [_vm._v(_vm._s(_vm.state.displayOnlyText))])]) : _vm._e(), _c("textarea", _vm._b({
354
+ }, [_c("pre", {
355
+ staticClass: "font-[inherit]"
356
+ }, [_vm._v(_vm._s(_vm.state.displayOnlyText))])]) : _vm._e(), _c("textarea", _vm._b({
354
357
  ref: "textarea",
355
358
  staticClass: "block w-full border-0 sm:border-solid sm:border-color-border sm:hover:border-color-border-hover sm:focus:border-color-brand-focus sm:disabled:border-color-border-separator outline-0 rounded 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",
356
359
  class: [_vm.readonly ? "sm:border-0 px-0 py-0" : "sm:border px-3 ", _vm.state.isDisplayOnly ? "hidden" : "", _vm.state.inputSizeMf !== "mini" ? "sm:placeholder:text-sm sm:text-sm" : "sm:placeholder:text-xs sm:text-xs", _vm.hoverExpand && "min-w-40 absolute h-7 z-[2000] top-0 left-0", _vm.hoverExpand && _vm.state.enteredTextarea ? "py-2 leading-normal" : "py-0 leading-[1.625rem]", _vm.hoverExpand && !_vm.state.enteredTextarea && "min-h-7 px-2 leading-7 overflow-hidden"],
package/lib/pc.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { renderless as renderless$1, api as api$1 } from '@opentinyvue/vue-renderless/input/vue';
2
2
  import { defineComponent, $prefix, setup, directive, props } from '@opentinyvue/vue-common';
3
- import Clickoutside from '@opentinyvue/vue-renderless/common/deps/clickoutside';
3
+ import { Clickoutside } from '@opentinyvue/vue-directive';
4
4
  import { renderless, api } from '@opentinyvue/vue-renderless/tall-storage/vue';
5
5
  import '@opentinyvue/vue-theme/tall-storage/index.css';
6
6
  import { IconClose, IconEyeopen, IconEyeclose } from '@opentinyvue/vue-icon';
@@ -323,7 +323,7 @@ var render = function render2() {
323
323
  },
324
324
  proxy: true
325
325
  }], null, false, 2786811157)
326
- }, [_c("div", [_vm._v(_vm._s(_vm.state.displayOnlyText))])]) : _vm._e(), _c("textarea", _vm._b({
326
+ }, [_c("pre", [_vm._v(_vm._s(_vm.state.displayOnlyText))])]) : _vm._e(), _c("textarea", _vm._b({
327
327
  directives: [{
328
328
  name: "clickoutside",
329
329
  rawName: "v-clickoutside.mouseup",
package/package.json CHANGED
@@ -1,23 +1,22 @@
1
1
  {
2
2
  "name": "@opentinyvue/vue-input",
3
- "version": "2.21.0",
3
+ "type": "module",
4
+ "version": "2.22.0",
4
5
  "description": "",
6
+ "license": "MIT",
7
+ "sideEffects": false,
5
8
  "main": "./lib/index.js",
6
9
  "module": "./lib/index.js",
7
- "sideEffects": false,
8
- "type": "module",
9
10
  "dependencies": {
10
- "@opentinyvue/vue-action-sheet": "~2.21.0",
11
- "@opentinyvue/vue-common": "~2.21.0",
12
- "@opentinyvue/vue-icon": "~2.21.0",
13
- "@opentinyvue/vue-tooltip": "~2.21.0",
14
- "@opentinyvue/vue-button": "~2.21.0",
15
- "@opentinyvue/vue-dialog-box": "~2.21.0",
16
- "@opentinyvue/vue-renderless": "~3.21.0",
17
- "@opentinyvue/vue-theme-mobile": "~3.21.0",
18
- "@opentinyvue/vue-theme": "~3.21.0"
11
+ "@opentinyvue/vue-directive": "~2.22.0",
12
+ "@opentinyvue/vue-button": "~2.22.0",
13
+ "@opentinyvue/vue-common": "~2.22.0",
14
+ "@opentinyvue/vue-dialog-box": "~2.22.0",
15
+ "@opentinyvue/vue-icon": "~2.22.0",
16
+ "@opentinyvue/vue-renderless": "~3.22.0",
17
+ "@opentinyvue/vue-theme": "~3.22.0",
18
+ "@opentinyvue/vue-tooltip": "~2.22.0"
19
19
  },
20
- "license": "MIT",
21
20
  "types": "index.d.ts",
22
21
  "scripts": {
23
22
  "build": "pnpm -w build:ui $npm_package_name",
package/lib/mobile.js DELETED
@@ -1,247 +0,0 @@
1
- import { renderless, api } from '@opentinyvue/vue-renderless/input/vue';
2
- import { defineComponent, props, setup } from '@opentinyvue/vue-common';
3
- import { iconClose, iconChevronRight, iconEyeopen, iconEyeclose } from '@opentinyvue/vue-icon';
4
- import ActionSheet from '@opentinyvue/vue-action-sheet';
5
- import '@opentinyvue/vue-theme-mobile/input/index.css';
6
-
7
- function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
8
- var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
9
- if (render) {
10
- options.render = render;
11
- options.staticRenderFns = staticRenderFns;
12
- options._compiled = true;
13
- }
14
- var hook;
15
- if (injectStyles) {
16
- hook = injectStyles;
17
- }
18
- if (hook) {
19
- if (options.functional) {
20
- options._injectStyles = hook;
21
- var originalRender = options.render;
22
- options.render = function renderWithStyleInjection(h, context) {
23
- hook.call(context);
24
- return originalRender(h, context);
25
- };
26
- } else {
27
- var existing = options.beforeCreate;
28
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
29
- }
30
- }
31
- return {
32
- exports: scriptExports,
33
- options
34
- };
35
- }
36
-
37
- var __vue2_script = defineComponent({
38
- emits: ["update:modelValue", "change", "clear", "focus", "blur", "keyup", "keydown", "paste", "mouseenter", "mouseleave", "input"],
39
- components: {
40
- IconClose: iconClose(),
41
- IconChevronRight: iconChevronRight(),
42
- IconEyeopen: iconEyeopen(),
43
- IconEyeclose: iconEyeclose(),
44
- TinyActionSheet: ActionSheet
45
- },
46
- props: [].concat(props, ["name", "selectMenu", "ellipsis", "contentStyle", "labelWidth", "tips", "isSelect", "type", "label", "modelValue", "disabled", "readonly", "clearable", "suffixIcon", "prefixIcon", "autocomplete", "showPassword", "validateEvent", "showWordLimit", "title", "counter", "autosize", "tabindex", "width", "textAlign", "resize"]),
47
- setup: function setup$1(props2, context) {
48
- return setup({
49
- props: props2,
50
- context,
51
- renderless,
52
- api
53
- });
54
- }
55
- });
56
- var render = function render2() {
57
- var _vm = this;
58
- var _h = _vm.$createElement;
59
- var _c = _vm._self._c || _h;
60
- return _c("div", {
61
- class: [_vm.type === "textarea" ? "tiny-mobile-textarea" : "tiny-mobile-input", _vm.state.inputSize ? "tiny-mobile-input-" + _vm.state.inputSize : "", {
62
- "is-focus": _vm.state.focused,
63
- "is-disabled": _vm.state.inputDisabled,
64
- "is-exceed": _vm.state.inputExceed,
65
- "is-showlimit": _vm.state.isWordLimitVisible && _vm.type === "textarea",
66
- "tiny-mobile-input-group": _vm.slots.prepend || _vm.slots.append,
67
- "tiny-mobile-input-group-append": _vm.slots.append,
68
- "tiny-mobile-input-group-prepend": _vm.slots.prepend
69
- }],
70
- style: _vm.$attrs.style,
71
- on: {
72
- "mouseenter": function mouseenter($event) {
73
- _vm.state.hovering = true;
74
- },
75
- "mouseleave": function mouseleave($event) {
76
- _vm.state.hovering = false;
77
- }
78
- }
79
- }, [_vm.slots.title || _vm.title ? _c("div", {
80
- staticClass: "tiny-mobile-input__title"
81
- }, [_vm._t("title", function() {
82
- return [_vm._v(_vm._s(_vm.title))];
83
- })], 2) : _vm._e(), _vm.type !== "textarea" ? _c("div", {
84
- staticClass: "tiny-mobile-input__wrapper"
85
- }, [_vm.isSelect ? _c("div", {
86
- staticClass: "tiny-mobile-input__select",
87
- on: {
88
- "click": _vm.showBox
89
- }
90
- }, [_c("input", _vm._b({
91
- staticClass: "tiny-mobile-input__inner",
92
- style: _vm.state.inputStyle,
93
- attrs: {
94
- "type": "text",
95
- "readonly": "",
96
- "disabled": _vm.state.inputDisabled,
97
- "name": _vm.name,
98
- "aria-label": _vm.label,
99
- "tabindex": _vm.tabindex
100
- },
101
- domProps: {
102
- "value": _vm.state.checkedLabel
103
- },
104
- on: {
105
- "input": _vm.handleInput,
106
- "change": _vm.handleChange
107
- }
108
- }, "input", _vm.a(_vm.$attrs, ["size", "class", "style", "^on[A-Z]"]), false)), _c("div", {
109
- staticClass: "tiny-mobile-input__select-icon",
110
- style: {
111
- transform: _vm.state.boxVisibility ? "rotate(90deg)" : "none"
112
- }
113
- }, [_c("IconChevronRight")], 1)]) : [_vm.type !== "textarea" ? _c("input", _vm._b({
114
- ref: "input",
115
- staticClass: "tiny-mobile-input__inner",
116
- style: _vm.state.inputStyle,
117
- attrs: {
118
- "name": _vm.name,
119
- "tabindex": _vm.tabindex,
120
- "type": _vm.showPassword ? _vm.state.passwordVisible ? "text" : "password" : _vm.type,
121
- "disabled": _vm.state.inputDisabled,
122
- "readonly": _vm.readonly,
123
- "autocomplete": _vm.autocomplete,
124
- "aria-label": _vm.label
125
- },
126
- on: {
127
- "compositionstart": _vm.handleCompositionStart,
128
- "compositionupdate": _vm.handleCompositionUpdate,
129
- "compositionend": _vm.handleCompositionEnd,
130
- "input": _vm.handleInput,
131
- "focus": _vm.handleFocus,
132
- "blur": _vm.handleBlur,
133
- "change": _vm.handleChange
134
- }
135
- }, "input", _vm.a(_vm.$attrs, ["size", "class", "style", "^on[A-Z]"]), false)) : _vm._e(), _vm.slots.prepend ? _c("div", {
136
- staticClass: "tiny-mobile-input-group__prepend"
137
- }, [_c("span", [_vm._t("prepend")], 2)]) : _vm._e(), _vm.slots.prefix || _vm.prefixIcon ? _c("div", {
138
- staticClass: "tiny-mobile-input__prefix"
139
- }, [_vm._t("prefix"), _vm.prefixIcon ? _c(_vm.prefixIcon, {
140
- tag: "component",
141
- staticClass: "tiny-mobile-input__icon"
142
- }) : _vm._e()], 2) : _vm._e(), _vm.getSuffixVisible() ? _c("span", {
143
- staticClass: "tiny-mobile-input__suffix"
144
- }, [!_vm.state.showClear || !_vm.state.showPwdVisible || !_vm.state.isWordLimitVisible ? [_vm._t("suffix"), _vm.suffixIcon ? _c(_vm.suffixIcon, {
145
- tag: "component",
146
- staticClass: "tiny-mobile-input__icon"
147
- }) : _vm._e()] : _vm._e(), _vm.state.showClear ? _c("icon-close", {
148
- staticClass: "tiny-mobile-input__icon tiny-mobile-input__clear",
149
- on: {
150
- "mousedown": function mousedown($event) {
151
- $event.preventDefault();
152
- },
153
- "click": _vm.clear
154
- }
155
- }) : _vm._e(), _vm.state.showPwdVisible ? _c(_vm.state.passwordVisible ? "icon-eyeopen" : "icon-eyeclose", {
156
- tag: "component",
157
- staticClass: "tiny-mobile-input__icon",
158
- on: {
159
- "click": _vm.handlePasswordVisible
160
- }
161
- }) : _vm._e(), _vm.state.isWordLimitVisible ? _c("span", {
162
- staticClass: "tiny-mobile-input__count"
163
- }, [_c("span", {
164
- staticClass: "tiny-mobile-input__count-inner"
165
- }, [_vm._v(_vm._s(_vm.state.showWordLimit ? _vm.state.textLength + "/" + _vm.state.upperLimit : _vm.state.textLength))])]) : _vm._e(), _vm.state.validateState ? _c("i", {
166
- staticClass: "tiny-mobile-input__icon",
167
- class: ["tiny-mobile-input__validateIcon", _vm.validateIcon]
168
- }) : _vm._e()], 2) : _vm._e(), _vm.slots.append ? _c("div", {
169
- staticClass: "tiny-mobile-input-group__append"
170
- }, [_vm._t("append")], 2) : _vm._e()]], 2) : _c("div", {
171
- staticClass: "tiny-mobile-textarea__wrapper"
172
- }, [_c("textarea", _vm._b({
173
- ref: "textarea",
174
- class: ["tiny-mobile-textarea__inner", {
175
- "is-focus": _vm.state.focused,
176
- "is-autosize": _vm.autosize
177
- }],
178
- style: Object.assign({}, _vm.state.textareaStyle, {
179
- width: _vm.$attrs.cols ? "auto" : "100%",
180
- height: _vm.$attrs.cols || _vm.autosize ? "auto" : ""
181
- }),
182
- attrs: {
183
- "name": _vm.name,
184
- "tabindex": _vm.tabindex,
185
- "disabled": _vm.state.inputDisabled,
186
- "readonly": _vm.readonly,
187
- "autocomplete": _vm.autocomplete,
188
- "aria-label": _vm.label
189
- },
190
- on: {
191
- "focus": _vm.handleFocus,
192
- "blur": _vm.handleBlur,
193
- "change": _vm.handleChange,
194
- "compositionstart": _vm.handleCompositionStart,
195
- "compositionupdate": _vm.handleCompositionUpdate,
196
- "compositionend": _vm.handleCompositionEnd,
197
- "input": _vm.handleInput,
198
- "keyup": function keyup($event) {
199
- return _vm.$emit("keyup", $event);
200
- },
201
- "keydown": function keydown($event) {
202
- return _vm.$emit("keydown", $event);
203
- },
204
- "paste": function paste($event) {
205
- return _vm.$emit("paste", $event);
206
- }
207
- }
208
- }, "textarea", _vm.a(_vm.$attrs, ["type", "class", "style", "^on[A-Z]"]), false))]), _vm.state.isWordLimitVisible && _vm.type === "textarea" ? _c("span", {
209
- staticClass: "tiny-mobile-textarea__count"
210
- }, [_vm._v(_vm._s(_vm.state.showWordLimit ? _vm.state.textLength + "/" + _vm.state.upperLimit : _vm.state.textLength))]) : _vm._e(), _vm.slots.tips || _vm.tips ? _c("div", {
211
- staticClass: "tiny-mobile-input__tips"
212
- }, [_vm._t("tips", function() {
213
- return [_vm._v(_vm._s(_vm.tips))];
214
- })], 2) : _vm._e(), _c("tiny-action-sheet", {
215
- attrs: {
216
- "menus": _vm.selectMenu,
217
- "ellipsis": _vm.ellipsis,
218
- "content-style": _vm.contentStyle,
219
- "visible": _vm.state.boxVisibility
220
- },
221
- on: {
222
- "update:visible": function updateVisible($event) {
223
- _vm.state.boxVisibility = $event;
224
- }
225
- },
226
- model: {
227
- value: _vm.state.sheetvalue,
228
- callback: function callback($$v) {
229
- _vm.$set(_vm.state, "sheetvalue", $$v);
230
- },
231
- expression: "state.sheetvalue"
232
- }
233
- })], 1);
234
- };
235
- var staticRenderFns = [];
236
- var __cssModules = {};
237
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
238
- function __vue2_injectStyles(context) {
239
- for (var o in __cssModules) {
240
- this[o] = __cssModules[o];
241
- }
242
- }
243
- var mobile = /* @__PURE__ */ function() {
244
- return __component__.exports;
245
- }();
246
-
247
- export { mobile as default };
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;