@opentinyvue/vue-link 2.21.0 → 3.21.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 +63 -61
- package/package.json +2 -2
- package/src/index.d.ts +58 -1
- package/src/pc.vue.d.ts +46 -1
package/lib/index.js
CHANGED
package/lib/pc.js
CHANGED
|
@@ -1,37 +1,41 @@
|
|
|
1
1
|
import { renderless, api } from '@opentinyvue/vue-renderless/link/vue';
|
|
2
2
|
import { defineComponent, props, setup } from '@opentinyvue/vue-common';
|
|
3
|
+
import { openBlock, createElementBlock, mergeProps, createBlock, resolveDynamicComponent, normalizeClass, createCommentVNode, toDisplayString, renderSlot } from 'vue';
|
|
3
4
|
|
|
4
|
-
function
|
|
5
|
-
var
|
|
6
|
-
if (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
function _createForOfIteratorHelperLoose(r, e) {
|
|
6
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
7
|
+
if (t) return (t = t.call(r)).next.bind(t);
|
|
8
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
9
|
+
t && (r = t);
|
|
10
|
+
var o = 0;
|
|
11
|
+
return function() {
|
|
12
|
+
return o >= r.length ? { done: true } : { done: false, value: r[o++] };
|
|
13
|
+
};
|
|
10
14
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var originalRender = options.render;
|
|
19
|
-
options.render = function renderWithStyleInjection(h, context) {
|
|
20
|
-
hook.call(context);
|
|
21
|
-
return originalRender(h, context);
|
|
22
|
-
};
|
|
23
|
-
} else {
|
|
24
|
-
var existing = options.beforeCreate;
|
|
25
|
-
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
26
|
-
}
|
|
15
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
16
|
+
}
|
|
17
|
+
function _unsupportedIterableToArray(r, a) {
|
|
18
|
+
if (r) {
|
|
19
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
20
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
21
|
+
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;
|
|
27
22
|
}
|
|
28
|
-
return {
|
|
29
|
-
exports: scriptExports,
|
|
30
|
-
options
|
|
31
|
-
};
|
|
32
23
|
}
|
|
24
|
+
function _arrayLikeToArray(r, a) {
|
|
25
|
+
(null == a || a > r.length) && (a = r.length);
|
|
26
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
27
|
+
return n;
|
|
28
|
+
}
|
|
29
|
+
var _export_sfc = function _export_sfc2(sfc, props) {
|
|
30
|
+
var target = sfc.__vccOpts || sfc;
|
|
31
|
+
for (var _iterator = _createForOfIteratorHelperLoose(props), _step; !(_step = _iterator()).done; ) {
|
|
32
|
+
var _step$value = _step.value, key = _step$value[0], val = _step$value[1];
|
|
33
|
+
target[key] = val;
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
33
37
|
|
|
34
|
-
var
|
|
38
|
+
var _sfc_main = defineComponent({
|
|
35
39
|
props: [].concat(props, ["disabled", "href", "icon", "type", "underline", "value"]),
|
|
36
40
|
emits: ["click"],
|
|
37
41
|
setup: function setup$1(props2, context) {
|
|
@@ -43,41 +47,39 @@ var __vue2_script = defineComponent({
|
|
|
43
47
|
});
|
|
44
48
|
}
|
|
45
49
|
});
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return _c("a", _vm._b({
|
|
51
|
-
class: ["tiny-link", "tiny-link--additional", _vm.type ? "tiny-link--" + _vm.type : "", _vm.state.disabled && "is-disabled", _vm.underline && !_vm.state.disabled && "is-underline"],
|
|
52
|
-
attrs: {
|
|
53
|
-
"href": _vm.state.disabled ? null : _vm.state.href,
|
|
54
|
-
"rel": "noopener noreferrer"
|
|
55
|
-
},
|
|
56
|
-
on: {
|
|
57
|
-
"click": _vm.handleClick
|
|
58
|
-
}
|
|
59
|
-
}, "a", _vm.a(_vm.$attrs, ["^on[A-Z]"]), false), [_vm.icon ? _c(_vm.icon, {
|
|
60
|
-
tag: "component",
|
|
61
|
-
staticClass: "tiny-svg-size tiny-link-svg",
|
|
62
|
-
class: {
|
|
63
|
-
"tiny-link-svg-only": !(_vm.slots.default || _vm.value)
|
|
64
|
-
}
|
|
65
|
-
}) : _vm._e(), _vm.value ? _c("span", {
|
|
66
|
-
staticClass: "tiny-link__inner"
|
|
67
|
-
}, [_vm._v(" " + _vm._s(_vm.value) + " ")]) : _vm.slots.default ? _c("span", {
|
|
68
|
-
staticClass: "tiny-link__inner"
|
|
69
|
-
}, [_vm._t("default")], 2) : _vm._e(), _vm.slots.icon ? _vm._t("icon") : _vm._e()], 2);
|
|
50
|
+
var _hoisted_1 = ["href"];
|
|
51
|
+
var _hoisted_2 = {
|
|
52
|
+
key: 1,
|
|
53
|
+
class: "tiny-link__inner"
|
|
70
54
|
};
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
55
|
+
var _hoisted_3 = {
|
|
56
|
+
key: 2,
|
|
57
|
+
class: "tiny-link__inner"
|
|
58
|
+
};
|
|
59
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
60
|
+
return openBlock(), createElementBlock("a", mergeProps({
|
|
61
|
+
class: ["tiny-link", "tiny-link--additional", _ctx.type ? "tiny-link--" + _ctx.type : "", _ctx.state.disabled && "is-disabled", _ctx.underline && !_ctx.state.disabled && "is-underline"],
|
|
62
|
+
href: _ctx.state.disabled ? null : _ctx.state.href
|
|
63
|
+
}, _ctx.a(_ctx.$attrs, ["^on[A-Z]"]), {
|
|
64
|
+
rel: "noopener noreferrer",
|
|
65
|
+
onClick: _cache[0] || (_cache[0] = function() {
|
|
66
|
+
return _ctx.handleClick && _ctx.handleClick.apply(_ctx, arguments);
|
|
67
|
+
})
|
|
68
|
+
}), [_ctx.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), {
|
|
69
|
+
key: 0,
|
|
70
|
+
class: normalizeClass(["tiny-svg-size tiny-link-svg", {
|
|
71
|
+
"tiny-link-svg-only": !(_ctx.slots.default || _ctx.value)
|
|
72
|
+
}])
|
|
73
|
+
}, null, 8, ["class"])) : createCommentVNode("v-if", true), _ctx.value ? (openBlock(), createElementBlock(
|
|
74
|
+
"span",
|
|
75
|
+
_hoisted_2,
|
|
76
|
+
toDisplayString(_ctx.value),
|
|
77
|
+
1
|
|
78
|
+
/* TEXT */
|
|
79
|
+
)) : _ctx.slots.default ? (openBlock(), createElementBlock("span", _hoisted_3, [renderSlot(_ctx.$slots, "default")])) : createCommentVNode("v-if", true), _ctx.slots.icon ? renderSlot(_ctx.$slots, "icon", {
|
|
80
|
+
key: 3
|
|
81
|
+
}) : createCommentVNode("v-if", true)], 16, _hoisted_1);
|
|
78
82
|
}
|
|
79
|
-
var pc = /* @__PURE__ */
|
|
80
|
-
return __component__.exports;
|
|
81
|
-
}();
|
|
83
|
+
var pc = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
82
84
|
|
|
83
85
|
export { pc as default };
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentinyvue/vue-link",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.21.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-common": "~
|
|
11
|
+
"@opentinyvue/vue-common": "~3.21.0",
|
|
12
12
|
"@opentinyvue/vue-renderless": "~3.21.0",
|
|
13
13
|
"@opentinyvue/vue-theme": "~3.21.0"
|
|
14
14
|
},
|
package/src/index.d.ts
CHANGED
|
@@ -24,5 +24,62 @@ export declare const linkProps: {
|
|
|
24
24
|
tiny_theme: StringConstructor;
|
|
25
25
|
tiny_chart_theme: ObjectConstructor;
|
|
26
26
|
};
|
|
27
|
-
declare const _default:
|
|
27
|
+
declare const _default: import("@vue/runtime-core").DefineComponent<{
|
|
28
|
+
/** 文本链接类型:'primary' | 'success' | 'warning' | 'danger' | 'info' */
|
|
29
|
+
type: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
default: string;
|
|
32
|
+
};
|
|
33
|
+
/** 显示内容 */
|
|
34
|
+
value: StringConstructor;
|
|
35
|
+
/** 是否下划线 */
|
|
36
|
+
underline: {
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
default: boolean;
|
|
39
|
+
};
|
|
40
|
+
/** 原生 href 属性 */
|
|
41
|
+
href: StringConstructor;
|
|
42
|
+
/** 自定义图标 */
|
|
43
|
+
icon: (StringConstructor | ObjectConstructor)[];
|
|
44
|
+
/** 是否禁用状态 */
|
|
45
|
+
disabled: BooleanConstructor;
|
|
46
|
+
tiny_mode: StringConstructor;
|
|
47
|
+
tiny_mode_root: BooleanConstructor;
|
|
48
|
+
tiny_template: (ObjectConstructor | FunctionConstructor)[];
|
|
49
|
+
tiny_renderless: FunctionConstructor;
|
|
50
|
+
tiny_theme: StringConstructor;
|
|
51
|
+
tiny_chart_theme: ObjectConstructor;
|
|
52
|
+
}, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
|
|
53
|
+
[key: string]: any;
|
|
54
|
+
}>, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
|
|
55
|
+
/** 文本链接类型:'primary' | 'success' | 'warning' | 'danger' | 'info' */
|
|
56
|
+
type: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
default: string;
|
|
59
|
+
};
|
|
60
|
+
/** 显示内容 */
|
|
61
|
+
value: StringConstructor;
|
|
62
|
+
/** 是否下划线 */
|
|
63
|
+
underline: {
|
|
64
|
+
type: BooleanConstructor;
|
|
65
|
+
default: boolean;
|
|
66
|
+
};
|
|
67
|
+
/** 原生 href 属性 */
|
|
68
|
+
href: StringConstructor;
|
|
69
|
+
/** 自定义图标 */
|
|
70
|
+
icon: (StringConstructor | ObjectConstructor)[];
|
|
71
|
+
/** 是否禁用状态 */
|
|
72
|
+
disabled: BooleanConstructor;
|
|
73
|
+
tiny_mode: StringConstructor;
|
|
74
|
+
tiny_mode_root: BooleanConstructor;
|
|
75
|
+
tiny_template: (ObjectConstructor | FunctionConstructor)[];
|
|
76
|
+
tiny_renderless: FunctionConstructor;
|
|
77
|
+
tiny_theme: StringConstructor;
|
|
78
|
+
tiny_chart_theme: ObjectConstructor;
|
|
79
|
+
}>>, {
|
|
80
|
+
disabled: boolean;
|
|
81
|
+
type: string;
|
|
82
|
+
tiny_mode_root: boolean;
|
|
83
|
+
underline: boolean;
|
|
84
|
+
}, {}>;
|
|
28
85
|
export default _default;
|
package/src/pc.vue.d.ts
CHANGED
|
@@ -1,2 +1,47 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ILinkApi } from '@opentinyvue/vue-renderless/types/link.type';
|
|
2
|
+
declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
|
|
3
|
+
value?: any;
|
|
4
|
+
disabled?: any;
|
|
5
|
+
icon?: any;
|
|
6
|
+
type?: any;
|
|
7
|
+
tiny_mode?: any;
|
|
8
|
+
tiny_mode_root?: any;
|
|
9
|
+
tiny_template?: any;
|
|
10
|
+
tiny_renderless?: any;
|
|
11
|
+
_constants?: any;
|
|
12
|
+
tiny_theme?: any;
|
|
13
|
+
tiny_chart_theme?: any;
|
|
14
|
+
href?: any;
|
|
15
|
+
underline?: any;
|
|
16
|
+
}>, ILinkApi, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, "click"[], "click", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<Readonly<{
|
|
17
|
+
value?: any;
|
|
18
|
+
disabled?: any;
|
|
19
|
+
icon?: any;
|
|
20
|
+
type?: any;
|
|
21
|
+
tiny_mode?: any;
|
|
22
|
+
tiny_mode_root?: any;
|
|
23
|
+
tiny_template?: any;
|
|
24
|
+
tiny_renderless?: any;
|
|
25
|
+
_constants?: any;
|
|
26
|
+
tiny_theme?: any;
|
|
27
|
+
tiny_chart_theme?: any;
|
|
28
|
+
href?: any;
|
|
29
|
+
underline?: any;
|
|
30
|
+
}>>> & {
|
|
31
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
32
|
+
}, {
|
|
33
|
+
readonly value?: any;
|
|
34
|
+
readonly disabled?: any;
|
|
35
|
+
readonly icon?: any;
|
|
36
|
+
readonly type?: any;
|
|
37
|
+
readonly tiny_mode?: any;
|
|
38
|
+
readonly tiny_mode_root?: any;
|
|
39
|
+
readonly tiny_template?: any;
|
|
40
|
+
readonly tiny_renderless?: any;
|
|
41
|
+
readonly _constants?: any;
|
|
42
|
+
readonly tiny_theme?: any;
|
|
43
|
+
readonly tiny_chart_theme?: any;
|
|
44
|
+
readonly href?: any;
|
|
45
|
+
readonly underline?: any;
|
|
46
|
+
}, {}>;
|
|
2
47
|
export default _default;
|