@opentinyvue/vue-ip-address 2.22.0 → 3.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 +1 -1
- package/lib/pc.js +123 -126
- package/package.json +3 -3
- package/src/index.d.ts +79 -1
- package/src/pc.vue.d.ts +59 -1
package/lib/index.js
CHANGED
package/lib/pc.js
CHANGED
|
@@ -1,38 +1,42 @@
|
|
|
1
1
|
import { renderless, api } from '@opentinyvue/vue-renderless/ip-address/vue';
|
|
2
2
|
import { defineComponent, props, setup } from '@opentinyvue/vue-common';
|
|
3
3
|
import { iconDotIpv4 } from '@opentinyvue/vue-icon';
|
|
4
|
+
import { openBlock, createElementBlock, createElementVNode, normalizeClass, Fragment, renderList, withDirectives, vModelText, renderSlot, createBlock, resolveDynamicComponent, createCommentVNode } from 'vue';
|
|
4
5
|
|
|
5
|
-
function
|
|
6
|
-
var
|
|
7
|
-
if (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
function _createForOfIteratorHelperLoose(r, e) {
|
|
7
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
8
|
+
if (t) return (t = t.call(r)).next.bind(t);
|
|
9
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
10
|
+
t && (r = t);
|
|
11
|
+
var o = 0;
|
|
12
|
+
return function() {
|
|
13
|
+
return o >= r.length ? { done: true } : { done: false, value: r[o++] };
|
|
14
|
+
};
|
|
11
15
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var originalRender = options.render;
|
|
20
|
-
options.render = function renderWithStyleInjection(h, context) {
|
|
21
|
-
hook.call(context);
|
|
22
|
-
return originalRender(h, context);
|
|
23
|
-
};
|
|
24
|
-
} else {
|
|
25
|
-
var existing = options.beforeCreate;
|
|
26
|
-
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
27
|
-
}
|
|
16
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
17
|
+
}
|
|
18
|
+
function _unsupportedIterableToArray(r, a) {
|
|
19
|
+
if (r) {
|
|
20
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
21
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
22
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
28
23
|
}
|
|
29
|
-
return {
|
|
30
|
-
exports: scriptExports,
|
|
31
|
-
options
|
|
32
|
-
};
|
|
33
24
|
}
|
|
25
|
+
function _arrayLikeToArray(r, a) {
|
|
26
|
+
(null == a || a > r.length) && (a = r.length);
|
|
27
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
28
|
+
return n;
|
|
29
|
+
}
|
|
30
|
+
var _export_sfc = function _export_sfc2(sfc, props) {
|
|
31
|
+
var target = sfc.__vccOpts || sfc;
|
|
32
|
+
for (var _iterator = _createForOfIteratorHelperLoose(props), _step; !(_step = _iterator()).done; ) {
|
|
33
|
+
var _step$value = _step.value, key = _step$value[0], val = _step$value[1];
|
|
34
|
+
target[key] = val;
|
|
35
|
+
}
|
|
36
|
+
return target;
|
|
37
|
+
};
|
|
34
38
|
|
|
35
|
-
var
|
|
39
|
+
var _sfc_main = defineComponent({
|
|
36
40
|
props: [].concat(props, ["size", "modelValue", "type", "readonly", "disabled", "delimiter"]),
|
|
37
41
|
emits: ["update:modelValue", "change", "blur", "focus", "select", "input"],
|
|
38
42
|
components: {
|
|
@@ -47,106 +51,99 @@ var __vue2_script = defineComponent({
|
|
|
47
51
|
});
|
|
48
52
|
}
|
|
49
53
|
});
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
var _h = _vm.$createElement;
|
|
53
|
-
var _c = _vm._self._c || _h;
|
|
54
|
-
return _c("div", {
|
|
55
|
-
staticClass: "tiny-ip-address"
|
|
56
|
-
}, [_c("ul", {
|
|
57
|
-
class: [_vm.state.active ? "active" : "", _vm.state.disabled ? "disabled" : "", "tiny-ip-address__input", _vm.state.size ? "" + _vm.state.size : "default"]
|
|
58
|
-
}, _vm._l(_vm.state.address, function(item, index) {
|
|
59
|
-
return _c("li", {
|
|
60
|
-
key: index
|
|
61
|
-
}, [_c("input", {
|
|
62
|
-
directives: [{
|
|
63
|
-
name: "model",
|
|
64
|
-
rawName: "v-model",
|
|
65
|
-
value: item.value,
|
|
66
|
-
expression: "item.value"
|
|
67
|
-
}],
|
|
68
|
-
ref: "inputs",
|
|
69
|
-
refInFor: true,
|
|
70
|
-
attrs: {
|
|
71
|
-
"readonly": _vm.readonly,
|
|
72
|
-
"disabled": _vm.state.disabled,
|
|
73
|
-
"type": "text",
|
|
74
|
-
"tabindex": "1"
|
|
75
|
-
},
|
|
76
|
-
domProps: {
|
|
77
|
-
"value": item.value
|
|
78
|
-
},
|
|
79
|
-
on: {
|
|
80
|
-
"select": function select($event) {
|
|
81
|
-
return _vm.select({
|
|
82
|
-
value: item,
|
|
83
|
-
index,
|
|
84
|
-
event: $event
|
|
85
|
-
});
|
|
86
|
-
},
|
|
87
|
-
"focus": function focus($event) {
|
|
88
|
-
return _vm.focus({
|
|
89
|
-
index,
|
|
90
|
-
event: $event
|
|
91
|
-
});
|
|
92
|
-
},
|
|
93
|
-
"input": [function($event) {
|
|
94
|
-
if ($event.target.composing) return;
|
|
95
|
-
_vm.$set(item, "value", $event.target.value);
|
|
96
|
-
}, function($event) {
|
|
97
|
-
return _vm.inputEvent({
|
|
98
|
-
item,
|
|
99
|
-
index
|
|
100
|
-
});
|
|
101
|
-
}],
|
|
102
|
-
"change": _vm.change,
|
|
103
|
-
"blur": function blur($event) {
|
|
104
|
-
return _vm.blur({
|
|
105
|
-
item,
|
|
106
|
-
index
|
|
107
|
-
});
|
|
108
|
-
},
|
|
109
|
-
"keyup": function keyup($event) {
|
|
110
|
-
return _vm.keyup({
|
|
111
|
-
item,
|
|
112
|
-
index,
|
|
113
|
-
event: $event
|
|
114
|
-
});
|
|
115
|
-
},
|
|
116
|
-
"keydown": function keydown($event) {
|
|
117
|
-
return _vm.keydown({
|
|
118
|
-
item,
|
|
119
|
-
index,
|
|
120
|
-
event: $event
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}), index < _vm.state.address.length - 1 ? [_vm._t("default", function() {
|
|
125
|
-
return [_vm.type === "IPv6" && _vm.delimiter === "icon-dot-ipv4" ? _c("span", {
|
|
126
|
-
staticClass: "tiny-ip-address__input__ipv6-delimiter"
|
|
127
|
-
}, [_vm._v(":")]) : _c(_vm.delimiter, {
|
|
128
|
-
tag: "component",
|
|
129
|
-
staticClass: "tiny-svg-size"
|
|
130
|
-
})];
|
|
131
|
-
}, {
|
|
132
|
-
"slotScope": {
|
|
133
|
-
state: _vm.state,
|
|
134
|
-
index,
|
|
135
|
-
item
|
|
136
|
-
}
|
|
137
|
-
})] : _vm._e()], 2);
|
|
138
|
-
}), 0)]);
|
|
54
|
+
var _hoisted_1 = {
|
|
55
|
+
class: "tiny-ip-address"
|
|
139
56
|
};
|
|
140
|
-
var
|
|
141
|
-
var
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
57
|
+
var _hoisted_2 = ["readonly", "disabled", "onUpdate:modelValue", "onSelect", "onFocus", "onInput", "onBlur", "onKeyup", "onKeydown"];
|
|
58
|
+
var _hoisted_3 = {
|
|
59
|
+
key: 0,
|
|
60
|
+
class: "tiny-ip-address__input__ipv6-delimiter"
|
|
61
|
+
};
|
|
62
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
63
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode(
|
|
64
|
+
"ul",
|
|
65
|
+
{
|
|
66
|
+
class: normalizeClass([_ctx.state.active ? "active" : "", _ctx.state.disabled ? "disabled" : "", "tiny-ip-address__input", _ctx.state.size ? "" + _ctx.state.size : "default"])
|
|
67
|
+
},
|
|
68
|
+
[(openBlock(true), createElementBlock(
|
|
69
|
+
Fragment,
|
|
70
|
+
null,
|
|
71
|
+
renderList(_ctx.state.address, function(item, index) {
|
|
72
|
+
return openBlock(), createElementBlock("li", {
|
|
73
|
+
key: index
|
|
74
|
+
}, [withDirectives(createElementVNode("input", {
|
|
75
|
+
ref_for: true,
|
|
76
|
+
ref: "inputs",
|
|
77
|
+
readonly: _ctx.readonly,
|
|
78
|
+
disabled: _ctx.state.disabled,
|
|
79
|
+
"onUpdate:modelValue": function onUpdateModelValue($event) {
|
|
80
|
+
return item.value = $event;
|
|
81
|
+
},
|
|
82
|
+
type: "text",
|
|
83
|
+
onSelect: function onSelect($event) {
|
|
84
|
+
return _ctx.select({
|
|
85
|
+
value: item,
|
|
86
|
+
index,
|
|
87
|
+
event: $event
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
onFocus: function onFocus($event) {
|
|
91
|
+
return _ctx.focus({
|
|
92
|
+
index,
|
|
93
|
+
event: $event
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
onInput: function onInput($event) {
|
|
97
|
+
return _ctx.inputEvent({
|
|
98
|
+
item,
|
|
99
|
+
index
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
onChange: _cache[0] || (_cache[0] = function() {
|
|
103
|
+
return _ctx.change && _ctx.change.apply(_ctx, arguments);
|
|
104
|
+
}),
|
|
105
|
+
onBlur: function onBlur($event) {
|
|
106
|
+
return _ctx.blur({
|
|
107
|
+
item,
|
|
108
|
+
index
|
|
109
|
+
});
|
|
110
|
+
},
|
|
111
|
+
onKeyup: function onKeyup($event) {
|
|
112
|
+
return _ctx.keyup({
|
|
113
|
+
item,
|
|
114
|
+
index,
|
|
115
|
+
event: $event
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
onKeydown: function onKeydown($event) {
|
|
119
|
+
return _ctx.keydown({
|
|
120
|
+
item,
|
|
121
|
+
index,
|
|
122
|
+
event: $event
|
|
123
|
+
});
|
|
124
|
+
},
|
|
125
|
+
tabindex: "1"
|
|
126
|
+
}, null, 40, _hoisted_2), [[vModelText, item.value]]), index < _ctx.state.address.length - 1 ? renderSlot(_ctx.$slots, "default", {
|
|
127
|
+
key: 0,
|
|
128
|
+
slotScope: {
|
|
129
|
+
state: _ctx.state,
|
|
130
|
+
index,
|
|
131
|
+
item
|
|
132
|
+
}
|
|
133
|
+
}, function() {
|
|
134
|
+
return [_ctx.type === "IPv6" && _ctx.delimiter === "icon-dot-ipv4" ? (openBlock(), createElementBlock("span", _hoisted_3, ":")) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.delimiter), {
|
|
135
|
+
key: 1,
|
|
136
|
+
class: "tiny-svg-size"
|
|
137
|
+
}))];
|
|
138
|
+
}) : createCommentVNode("v-if", true)]);
|
|
139
|
+
}),
|
|
140
|
+
128
|
|
141
|
+
/* KEYED_FRAGMENT */
|
|
142
|
+
))],
|
|
143
|
+
2
|
|
144
|
+
/* CLASS */
|
|
145
|
+
)]);
|
|
147
146
|
}
|
|
148
|
-
var pc = /* @__PURE__ */
|
|
149
|
-
return __component__.exports;
|
|
150
|
-
}();
|
|
147
|
+
var pc = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
151
148
|
|
|
152
149
|
export { pc as default };
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentinyvue/vue-ip-address",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.22.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib/index.js",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"type": "module",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@opentinyvue/vue-common": "~
|
|
11
|
-
"@opentinyvue/vue-icon": "~
|
|
10
|
+
"@opentinyvue/vue-common": "~3.22.0",
|
|
11
|
+
"@opentinyvue/vue-icon": "~3.22.0",
|
|
12
12
|
"@opentinyvue/vue-renderless": "~3.22.0",
|
|
13
13
|
"@opentinyvue/vue-theme": "~3.22.0"
|
|
14
14
|
},
|
package/src/index.d.ts
CHANGED
|
@@ -34,5 +34,83 @@ export declare const ipAddressProps: {
|
|
|
34
34
|
tiny_theme: StringConstructor;
|
|
35
35
|
tiny_chart_theme: ObjectConstructor;
|
|
36
36
|
};
|
|
37
|
-
declare const _default:
|
|
37
|
+
declare const _default: import("@vue/runtime-core").DefineComponent<{
|
|
38
|
+
size: StringConstructor;
|
|
39
|
+
/**
|
|
40
|
+
* @property {String} value - 显示值
|
|
41
|
+
*/
|
|
42
|
+
modelValue: StringConstructor;
|
|
43
|
+
/**
|
|
44
|
+
* @property {String} [type = IPv4] - IP地址输入组件类型('IPv4', 'IPv6',)可选择
|
|
45
|
+
*/
|
|
46
|
+
type: {
|
|
47
|
+
type: StringConstructor;
|
|
48
|
+
default: string;
|
|
49
|
+
validator: (value: string) => boolean;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* @property {Boolean} readonly - 只读
|
|
53
|
+
*/
|
|
54
|
+
readonly: BooleanConstructor;
|
|
55
|
+
/**
|
|
56
|
+
* @property {Boolean} disabled - 禁用
|
|
57
|
+
*/
|
|
58
|
+
disabled: BooleanConstructor;
|
|
59
|
+
/**
|
|
60
|
+
* @property {String, Object} [delimiter = .] - 组件IP段显示的分隔符改为图标
|
|
61
|
+
*/
|
|
62
|
+
delimiter: {
|
|
63
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
64
|
+
default: string;
|
|
65
|
+
};
|
|
66
|
+
tiny_mode: StringConstructor;
|
|
67
|
+
tiny_mode_root: BooleanConstructor;
|
|
68
|
+
tiny_template: (ObjectConstructor | FunctionConstructor)[];
|
|
69
|
+
tiny_renderless: FunctionConstructor;
|
|
70
|
+
tiny_theme: StringConstructor;
|
|
71
|
+
tiny_chart_theme: ObjectConstructor;
|
|
72
|
+
}, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
|
|
73
|
+
[key: string]: any;
|
|
74
|
+
}>, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
|
|
75
|
+
size: StringConstructor;
|
|
76
|
+
/**
|
|
77
|
+
* @property {String} value - 显示值
|
|
78
|
+
*/
|
|
79
|
+
modelValue: StringConstructor;
|
|
80
|
+
/**
|
|
81
|
+
* @property {String} [type = IPv4] - IP地址输入组件类型('IPv4', 'IPv6',)可选择
|
|
82
|
+
*/
|
|
83
|
+
type: {
|
|
84
|
+
type: StringConstructor;
|
|
85
|
+
default: string;
|
|
86
|
+
validator: (value: string) => boolean;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* @property {Boolean} readonly - 只读
|
|
90
|
+
*/
|
|
91
|
+
readonly: BooleanConstructor;
|
|
92
|
+
/**
|
|
93
|
+
* @property {Boolean} disabled - 禁用
|
|
94
|
+
*/
|
|
95
|
+
disabled: BooleanConstructor;
|
|
96
|
+
/**
|
|
97
|
+
* @property {String, Object} [delimiter = .] - 组件IP段显示的分隔符改为图标
|
|
98
|
+
*/
|
|
99
|
+
delimiter: {
|
|
100
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
101
|
+
default: string;
|
|
102
|
+
};
|
|
103
|
+
tiny_mode: StringConstructor;
|
|
104
|
+
tiny_mode_root: BooleanConstructor;
|
|
105
|
+
tiny_template: (ObjectConstructor | FunctionConstructor)[];
|
|
106
|
+
tiny_renderless: FunctionConstructor;
|
|
107
|
+
tiny_theme: StringConstructor;
|
|
108
|
+
tiny_chart_theme: ObjectConstructor;
|
|
109
|
+
}>>, {
|
|
110
|
+
disabled: boolean;
|
|
111
|
+
type: string;
|
|
112
|
+
tiny_mode_root: boolean;
|
|
113
|
+
readonly: boolean;
|
|
114
|
+
delimiter: string | Record<string, any>;
|
|
115
|
+
}, {}>;
|
|
38
116
|
export default _default;
|
package/src/pc.vue.d.ts
CHANGED
|
@@ -1,2 +1,60 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
|
|
2
|
+
disabled?: any;
|
|
3
|
+
size?: any;
|
|
4
|
+
type?: any;
|
|
5
|
+
tiny_mode?: any;
|
|
6
|
+
tiny_mode_root?: any;
|
|
7
|
+
tiny_template?: any;
|
|
8
|
+
tiny_renderless?: any;
|
|
9
|
+
_constants?: any;
|
|
10
|
+
tiny_theme?: any;
|
|
11
|
+
tiny_chart_theme?: any;
|
|
12
|
+
modelValue?: any;
|
|
13
|
+
readonly?: any;
|
|
14
|
+
delimiter?: any;
|
|
15
|
+
}>, {
|
|
16
|
+
t: (this: any, path: any, options?: any) => any;
|
|
17
|
+
vm: any;
|
|
18
|
+
f: (props: any, attrs?: {}) => {};
|
|
19
|
+
a: (attrs: any, filters: any, include: any) => {};
|
|
20
|
+
d: (props: any) => void;
|
|
21
|
+
dp: (props: any) => void;
|
|
22
|
+
gcls: (key: any) => any;
|
|
23
|
+
m: (...cssClasses: any[]) => string;
|
|
24
|
+
}, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("input" | "select" | "change" | "blur" | "focus" | "update:modelValue")[], "input" | "select" | "change" | "blur" | "focus" | "update:modelValue", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<Readonly<{
|
|
25
|
+
disabled?: any;
|
|
26
|
+
size?: any;
|
|
27
|
+
type?: any;
|
|
28
|
+
tiny_mode?: any;
|
|
29
|
+
tiny_mode_root?: any;
|
|
30
|
+
tiny_template?: any;
|
|
31
|
+
tiny_renderless?: any;
|
|
32
|
+
_constants?: any;
|
|
33
|
+
tiny_theme?: any;
|
|
34
|
+
tiny_chart_theme?: any;
|
|
35
|
+
modelValue?: any;
|
|
36
|
+
readonly?: any;
|
|
37
|
+
delimiter?: any;
|
|
38
|
+
}>>> & {
|
|
39
|
+
onInput?: ((...args: any[]) => any) | undefined;
|
|
40
|
+
onSelect?: ((...args: any[]) => any) | undefined;
|
|
41
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
42
|
+
onBlur?: ((...args: any[]) => any) | undefined;
|
|
43
|
+
onFocus?: ((...args: any[]) => any) | undefined;
|
|
44
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
readonly disabled?: any;
|
|
47
|
+
readonly size?: any;
|
|
48
|
+
readonly type?: any;
|
|
49
|
+
readonly tiny_mode?: any;
|
|
50
|
+
readonly tiny_mode_root?: any;
|
|
51
|
+
readonly tiny_template?: any;
|
|
52
|
+
readonly tiny_renderless?: any;
|
|
53
|
+
readonly _constants?: any;
|
|
54
|
+
readonly tiny_theme?: any;
|
|
55
|
+
readonly tiny_chart_theme?: any;
|
|
56
|
+
readonly modelValue?: any;
|
|
57
|
+
readonly readonly?: any;
|
|
58
|
+
readonly delimiter?: any;
|
|
59
|
+
}, {}>;
|
|
2
60
|
export default _default;
|