@holyer-lib/title 0.0.1 → 0.0.2
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/dist/title.cjs.js +209 -0
- package/dist/title.esm.js +205 -0
- package/dist/title.umd.js +213 -0
- package/package.json +1 -1
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
function __$styleInject(css) {
|
|
6
|
+
if (!css) return;
|
|
7
|
+
|
|
8
|
+
if (typeof window == 'undefined') return;
|
|
9
|
+
var style = document.createElement('style');
|
|
10
|
+
style.setAttribute('media', 'screen');
|
|
11
|
+
|
|
12
|
+
style.innerHTML = css;
|
|
13
|
+
document.head.appendChild(style);
|
|
14
|
+
return css;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//
|
|
18
|
+
//
|
|
19
|
+
//
|
|
20
|
+
//
|
|
21
|
+
//
|
|
22
|
+
//
|
|
23
|
+
|
|
24
|
+
var script = {
|
|
25
|
+
name: 'HiTitle',
|
|
26
|
+
props: {
|
|
27
|
+
content: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: '标题'
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
data() {}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
|
|
36
|
+
if (typeof shadowMode !== 'boolean') {
|
|
37
|
+
createInjectorSSR = createInjector;
|
|
38
|
+
createInjector = shadowMode;
|
|
39
|
+
shadowMode = false;
|
|
40
|
+
}
|
|
41
|
+
// Vue.extend constructor export interop.
|
|
42
|
+
const options = typeof script === 'function' ? script.options : script;
|
|
43
|
+
// render functions
|
|
44
|
+
if (template && template.render) {
|
|
45
|
+
options.render = template.render;
|
|
46
|
+
options.staticRenderFns = template.staticRenderFns;
|
|
47
|
+
options._compiled = true;
|
|
48
|
+
// functional template
|
|
49
|
+
if (isFunctionalTemplate) {
|
|
50
|
+
options.functional = true;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// scopedId
|
|
54
|
+
if (scopeId) {
|
|
55
|
+
options._scopeId = scopeId;
|
|
56
|
+
}
|
|
57
|
+
let hook;
|
|
58
|
+
if (moduleIdentifier) {
|
|
59
|
+
// server build
|
|
60
|
+
hook = function (context) {
|
|
61
|
+
// 2.3 injection
|
|
62
|
+
context =
|
|
63
|
+
context || // cached call
|
|
64
|
+
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
65
|
+
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
|
|
66
|
+
// 2.2 with runInNewContext: true
|
|
67
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
68
|
+
context = __VUE_SSR_CONTEXT__;
|
|
69
|
+
}
|
|
70
|
+
// inject component styles
|
|
71
|
+
if (style) {
|
|
72
|
+
style.call(this, createInjectorSSR(context));
|
|
73
|
+
}
|
|
74
|
+
// register component module identifier for async chunk inference
|
|
75
|
+
if (context && context._registeredComponents) {
|
|
76
|
+
context._registeredComponents.add(moduleIdentifier);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
// used by ssr in case component is cached and beforeCreate
|
|
80
|
+
// never gets called
|
|
81
|
+
options._ssrRegister = hook;
|
|
82
|
+
}
|
|
83
|
+
else if (style) {
|
|
84
|
+
hook = shadowMode
|
|
85
|
+
? function (context) {
|
|
86
|
+
style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
|
|
87
|
+
}
|
|
88
|
+
: function (context) {
|
|
89
|
+
style.call(this, createInjector(context));
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
if (hook) {
|
|
93
|
+
if (options.functional) {
|
|
94
|
+
// register for functional component in vue file
|
|
95
|
+
const originalRender = options.render;
|
|
96
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
97
|
+
hook.call(context);
|
|
98
|
+
return originalRender(h, context);
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
// inject component registration as beforeCreate hook
|
|
103
|
+
const existing = options.beforeCreate;
|
|
104
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return script;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const isOldIE = typeof navigator !== 'undefined' &&
|
|
111
|
+
/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
|
|
112
|
+
function createInjector(context) {
|
|
113
|
+
return (id, style) => addStyle(id, style);
|
|
114
|
+
}
|
|
115
|
+
let HEAD;
|
|
116
|
+
const styles = {};
|
|
117
|
+
function addStyle(id, css) {
|
|
118
|
+
const group = isOldIE ? css.media || 'default' : id;
|
|
119
|
+
const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] });
|
|
120
|
+
if (!style.ids.has(id)) {
|
|
121
|
+
style.ids.add(id);
|
|
122
|
+
let code = css.source;
|
|
123
|
+
if (css.map) {
|
|
124
|
+
// https://developer.chrome.com/devtools/docs/javascript-debugging
|
|
125
|
+
// this makes source maps inside style tags work properly in Chrome
|
|
126
|
+
code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';
|
|
127
|
+
// http://stackoverflow.com/a/26603875
|
|
128
|
+
code +=
|
|
129
|
+
'\n/*# sourceMappingURL=data:application/json;base64,' +
|
|
130
|
+
btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +
|
|
131
|
+
' */';
|
|
132
|
+
}
|
|
133
|
+
if (!style.element) {
|
|
134
|
+
style.element = document.createElement('style');
|
|
135
|
+
style.element.type = 'text/css';
|
|
136
|
+
if (css.media)
|
|
137
|
+
style.element.setAttribute('media', css.media);
|
|
138
|
+
if (HEAD === undefined) {
|
|
139
|
+
HEAD = document.head || document.getElementsByTagName('head')[0];
|
|
140
|
+
}
|
|
141
|
+
HEAD.appendChild(style.element);
|
|
142
|
+
}
|
|
143
|
+
if ('styleSheet' in style.element) {
|
|
144
|
+
style.styles.push(code);
|
|
145
|
+
style.element.styleSheet.cssText = style.styles
|
|
146
|
+
.filter(Boolean)
|
|
147
|
+
.join('\n');
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
const index = style.ids.size - 1;
|
|
151
|
+
const textNode = document.createTextNode(code);
|
|
152
|
+
const nodes = style.element.childNodes;
|
|
153
|
+
if (nodes[index])
|
|
154
|
+
style.element.removeChild(nodes[index]);
|
|
155
|
+
if (nodes.length)
|
|
156
|
+
style.element.insertBefore(textNode, nodes[index]);
|
|
157
|
+
else
|
|
158
|
+
style.element.appendChild(textNode);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* script */
|
|
164
|
+
const __vue_script__ = script;
|
|
165
|
+
|
|
166
|
+
/* template */
|
|
167
|
+
var __vue_render__ = function () {
|
|
168
|
+
var _vm = this;
|
|
169
|
+
var _h = _vm.$createElement;
|
|
170
|
+
var _c = _vm._self._c || _h;
|
|
171
|
+
return _c("div", { staticClass: "hi-title" }, [
|
|
172
|
+
_vm._v("\n " + _vm._s(_vm.content) + "\n"),
|
|
173
|
+
])
|
|
174
|
+
};
|
|
175
|
+
var __vue_staticRenderFns__ = [];
|
|
176
|
+
__vue_render__._withStripped = true;
|
|
177
|
+
|
|
178
|
+
/* style */
|
|
179
|
+
const __vue_inject_styles__ = function (inject) {
|
|
180
|
+
if (!inject) return
|
|
181
|
+
inject("data-v-03a3ffda_0", { source: "\n.title[data-v-03a3ffda] {\n text-align: center;\n margin: 20px 0;\n}\n", map: {"version":3,"sources":["/home/runner/work/holyer-lib/holyer-lib/packages/ui/title/src/index.vue"],"names":[],"mappings":";AAoBA;EACA,kBAAA;EACA,cAAA;AACA","file":"index.vue","sourcesContent":["<template>\n <div class=\"hi-title\">\n {{ content }}\n </div>\n</template>\n\n<script>\nexport default {\n name: 'HiTitle',\n props: {\n content: {\n type: String,\n default: '标题'\n }\n },\n data() {}\n};\n</script>\n\n<style scoped>\n.title {\n text-align: center;\n margin: 20px 0;\n}\n</style>\n"]}, media: undefined });
|
|
182
|
+
|
|
183
|
+
};
|
|
184
|
+
/* scoped */
|
|
185
|
+
const __vue_scope_id__ = "data-v-03a3ffda";
|
|
186
|
+
/* module identifier */
|
|
187
|
+
const __vue_module_identifier__ = undefined;
|
|
188
|
+
/* functional template */
|
|
189
|
+
const __vue_is_functional_template__ = false;
|
|
190
|
+
/* style inject SSR */
|
|
191
|
+
|
|
192
|
+
/* style inject shadow dom */
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
const __vue_component__ = /*#__PURE__*/normalizeComponent(
|
|
197
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
198
|
+
__vue_inject_styles__,
|
|
199
|
+
__vue_script__,
|
|
200
|
+
__vue_scope_id__,
|
|
201
|
+
__vue_is_functional_template__,
|
|
202
|
+
__vue_module_identifier__,
|
|
203
|
+
false,
|
|
204
|
+
createInjector,
|
|
205
|
+
undefined,
|
|
206
|
+
undefined
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
module.exports = __vue_component__;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
function __$styleInject(css) {
|
|
2
|
+
if (!css) return;
|
|
3
|
+
|
|
4
|
+
if (typeof window == 'undefined') return;
|
|
5
|
+
var style = document.createElement('style');
|
|
6
|
+
style.setAttribute('media', 'screen');
|
|
7
|
+
|
|
8
|
+
style.innerHTML = css;
|
|
9
|
+
document.head.appendChild(style);
|
|
10
|
+
return css;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//
|
|
14
|
+
//
|
|
15
|
+
//
|
|
16
|
+
//
|
|
17
|
+
//
|
|
18
|
+
//
|
|
19
|
+
|
|
20
|
+
var script = {
|
|
21
|
+
name: 'HiTitle',
|
|
22
|
+
props: {
|
|
23
|
+
content: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: '标题'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
data() {}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
|
|
32
|
+
if (typeof shadowMode !== 'boolean') {
|
|
33
|
+
createInjectorSSR = createInjector;
|
|
34
|
+
createInjector = shadowMode;
|
|
35
|
+
shadowMode = false;
|
|
36
|
+
}
|
|
37
|
+
// Vue.extend constructor export interop.
|
|
38
|
+
const options = typeof script === 'function' ? script.options : script;
|
|
39
|
+
// render functions
|
|
40
|
+
if (template && template.render) {
|
|
41
|
+
options.render = template.render;
|
|
42
|
+
options.staticRenderFns = template.staticRenderFns;
|
|
43
|
+
options._compiled = true;
|
|
44
|
+
// functional template
|
|
45
|
+
if (isFunctionalTemplate) {
|
|
46
|
+
options.functional = true;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
// scopedId
|
|
50
|
+
if (scopeId) {
|
|
51
|
+
options._scopeId = scopeId;
|
|
52
|
+
}
|
|
53
|
+
let hook;
|
|
54
|
+
if (moduleIdentifier) {
|
|
55
|
+
// server build
|
|
56
|
+
hook = function (context) {
|
|
57
|
+
// 2.3 injection
|
|
58
|
+
context =
|
|
59
|
+
context || // cached call
|
|
60
|
+
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
61
|
+
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
|
|
62
|
+
// 2.2 with runInNewContext: true
|
|
63
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
64
|
+
context = __VUE_SSR_CONTEXT__;
|
|
65
|
+
}
|
|
66
|
+
// inject component styles
|
|
67
|
+
if (style) {
|
|
68
|
+
style.call(this, createInjectorSSR(context));
|
|
69
|
+
}
|
|
70
|
+
// register component module identifier for async chunk inference
|
|
71
|
+
if (context && context._registeredComponents) {
|
|
72
|
+
context._registeredComponents.add(moduleIdentifier);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
// used by ssr in case component is cached and beforeCreate
|
|
76
|
+
// never gets called
|
|
77
|
+
options._ssrRegister = hook;
|
|
78
|
+
}
|
|
79
|
+
else if (style) {
|
|
80
|
+
hook = shadowMode
|
|
81
|
+
? function (context) {
|
|
82
|
+
style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
|
|
83
|
+
}
|
|
84
|
+
: function (context) {
|
|
85
|
+
style.call(this, createInjector(context));
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (hook) {
|
|
89
|
+
if (options.functional) {
|
|
90
|
+
// register for functional component in vue file
|
|
91
|
+
const originalRender = options.render;
|
|
92
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
93
|
+
hook.call(context);
|
|
94
|
+
return originalRender(h, context);
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
// inject component registration as beforeCreate hook
|
|
99
|
+
const existing = options.beforeCreate;
|
|
100
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return script;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const isOldIE = typeof navigator !== 'undefined' &&
|
|
107
|
+
/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
|
|
108
|
+
function createInjector(context) {
|
|
109
|
+
return (id, style) => addStyle(id, style);
|
|
110
|
+
}
|
|
111
|
+
let HEAD;
|
|
112
|
+
const styles = {};
|
|
113
|
+
function addStyle(id, css) {
|
|
114
|
+
const group = isOldIE ? css.media || 'default' : id;
|
|
115
|
+
const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] });
|
|
116
|
+
if (!style.ids.has(id)) {
|
|
117
|
+
style.ids.add(id);
|
|
118
|
+
let code = css.source;
|
|
119
|
+
if (css.map) {
|
|
120
|
+
// https://developer.chrome.com/devtools/docs/javascript-debugging
|
|
121
|
+
// this makes source maps inside style tags work properly in Chrome
|
|
122
|
+
code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';
|
|
123
|
+
// http://stackoverflow.com/a/26603875
|
|
124
|
+
code +=
|
|
125
|
+
'\n/*# sourceMappingURL=data:application/json;base64,' +
|
|
126
|
+
btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +
|
|
127
|
+
' */';
|
|
128
|
+
}
|
|
129
|
+
if (!style.element) {
|
|
130
|
+
style.element = document.createElement('style');
|
|
131
|
+
style.element.type = 'text/css';
|
|
132
|
+
if (css.media)
|
|
133
|
+
style.element.setAttribute('media', css.media);
|
|
134
|
+
if (HEAD === undefined) {
|
|
135
|
+
HEAD = document.head || document.getElementsByTagName('head')[0];
|
|
136
|
+
}
|
|
137
|
+
HEAD.appendChild(style.element);
|
|
138
|
+
}
|
|
139
|
+
if ('styleSheet' in style.element) {
|
|
140
|
+
style.styles.push(code);
|
|
141
|
+
style.element.styleSheet.cssText = style.styles
|
|
142
|
+
.filter(Boolean)
|
|
143
|
+
.join('\n');
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
const index = style.ids.size - 1;
|
|
147
|
+
const textNode = document.createTextNode(code);
|
|
148
|
+
const nodes = style.element.childNodes;
|
|
149
|
+
if (nodes[index])
|
|
150
|
+
style.element.removeChild(nodes[index]);
|
|
151
|
+
if (nodes.length)
|
|
152
|
+
style.element.insertBefore(textNode, nodes[index]);
|
|
153
|
+
else
|
|
154
|
+
style.element.appendChild(textNode);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* script */
|
|
160
|
+
const __vue_script__ = script;
|
|
161
|
+
|
|
162
|
+
/* template */
|
|
163
|
+
var __vue_render__ = function () {
|
|
164
|
+
var _vm = this;
|
|
165
|
+
var _h = _vm.$createElement;
|
|
166
|
+
var _c = _vm._self._c || _h;
|
|
167
|
+
return _c("div", { staticClass: "hi-title" }, [
|
|
168
|
+
_vm._v("\n " + _vm._s(_vm.content) + "\n"),
|
|
169
|
+
])
|
|
170
|
+
};
|
|
171
|
+
var __vue_staticRenderFns__ = [];
|
|
172
|
+
__vue_render__._withStripped = true;
|
|
173
|
+
|
|
174
|
+
/* style */
|
|
175
|
+
const __vue_inject_styles__ = function (inject) {
|
|
176
|
+
if (!inject) return
|
|
177
|
+
inject("data-v-03a3ffda_0", { source: "\n.title[data-v-03a3ffda] {\n text-align: center;\n margin: 20px 0;\n}\n", map: {"version":3,"sources":["/home/runner/work/holyer-lib/holyer-lib/packages/ui/title/src/index.vue"],"names":[],"mappings":";AAoBA;EACA,kBAAA;EACA,cAAA;AACA","file":"index.vue","sourcesContent":["<template>\n <div class=\"hi-title\">\n {{ content }}\n </div>\n</template>\n\n<script>\nexport default {\n name: 'HiTitle',\n props: {\n content: {\n type: String,\n default: '标题'\n }\n },\n data() {}\n};\n</script>\n\n<style scoped>\n.title {\n text-align: center;\n margin: 20px 0;\n}\n</style>\n"]}, media: undefined });
|
|
178
|
+
|
|
179
|
+
};
|
|
180
|
+
/* scoped */
|
|
181
|
+
const __vue_scope_id__ = "data-v-03a3ffda";
|
|
182
|
+
/* module identifier */
|
|
183
|
+
const __vue_module_identifier__ = undefined;
|
|
184
|
+
/* functional template */
|
|
185
|
+
const __vue_is_functional_template__ = false;
|
|
186
|
+
/* style inject SSR */
|
|
187
|
+
|
|
188
|
+
/* style inject shadow dom */
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
const __vue_component__ = /*#__PURE__*/normalizeComponent(
|
|
193
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
194
|
+
__vue_inject_styles__,
|
|
195
|
+
__vue_script__,
|
|
196
|
+
__vue_scope_id__,
|
|
197
|
+
__vue_is_functional_template__,
|
|
198
|
+
__vue_module_identifier__,
|
|
199
|
+
false,
|
|
200
|
+
createInjector,
|
|
201
|
+
undefined,
|
|
202
|
+
undefined
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
export { __vue_component__ as default };
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Title = factory());
|
|
5
|
+
})(this, (function () { 'use strict';
|
|
6
|
+
|
|
7
|
+
function __$styleInject(css) {
|
|
8
|
+
if (!css) return;
|
|
9
|
+
|
|
10
|
+
if (typeof window == 'undefined') return;
|
|
11
|
+
var style = document.createElement('style');
|
|
12
|
+
style.setAttribute('media', 'screen');
|
|
13
|
+
|
|
14
|
+
style.innerHTML = css;
|
|
15
|
+
document.head.appendChild(style);
|
|
16
|
+
return css;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//
|
|
20
|
+
//
|
|
21
|
+
//
|
|
22
|
+
//
|
|
23
|
+
//
|
|
24
|
+
//
|
|
25
|
+
|
|
26
|
+
var script = {
|
|
27
|
+
name: 'HiTitle',
|
|
28
|
+
props: {
|
|
29
|
+
content: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: '标题'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
data() {}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
|
|
38
|
+
if (typeof shadowMode !== 'boolean') {
|
|
39
|
+
createInjectorSSR = createInjector;
|
|
40
|
+
createInjector = shadowMode;
|
|
41
|
+
shadowMode = false;
|
|
42
|
+
}
|
|
43
|
+
// Vue.extend constructor export interop.
|
|
44
|
+
const options = typeof script === 'function' ? script.options : script;
|
|
45
|
+
// render functions
|
|
46
|
+
if (template && template.render) {
|
|
47
|
+
options.render = template.render;
|
|
48
|
+
options.staticRenderFns = template.staticRenderFns;
|
|
49
|
+
options._compiled = true;
|
|
50
|
+
// functional template
|
|
51
|
+
if (isFunctionalTemplate) {
|
|
52
|
+
options.functional = true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// scopedId
|
|
56
|
+
if (scopeId) {
|
|
57
|
+
options._scopeId = scopeId;
|
|
58
|
+
}
|
|
59
|
+
let hook;
|
|
60
|
+
if (moduleIdentifier) {
|
|
61
|
+
// server build
|
|
62
|
+
hook = function (context) {
|
|
63
|
+
// 2.3 injection
|
|
64
|
+
context =
|
|
65
|
+
context || // cached call
|
|
66
|
+
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
67
|
+
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
|
|
68
|
+
// 2.2 with runInNewContext: true
|
|
69
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
70
|
+
context = __VUE_SSR_CONTEXT__;
|
|
71
|
+
}
|
|
72
|
+
// inject component styles
|
|
73
|
+
if (style) {
|
|
74
|
+
style.call(this, createInjectorSSR(context));
|
|
75
|
+
}
|
|
76
|
+
// register component module identifier for async chunk inference
|
|
77
|
+
if (context && context._registeredComponents) {
|
|
78
|
+
context._registeredComponents.add(moduleIdentifier);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
// used by ssr in case component is cached and beforeCreate
|
|
82
|
+
// never gets called
|
|
83
|
+
options._ssrRegister = hook;
|
|
84
|
+
}
|
|
85
|
+
else if (style) {
|
|
86
|
+
hook = shadowMode
|
|
87
|
+
? function (context) {
|
|
88
|
+
style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
|
|
89
|
+
}
|
|
90
|
+
: function (context) {
|
|
91
|
+
style.call(this, createInjector(context));
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
if (hook) {
|
|
95
|
+
if (options.functional) {
|
|
96
|
+
// register for functional component in vue file
|
|
97
|
+
const originalRender = options.render;
|
|
98
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
99
|
+
hook.call(context);
|
|
100
|
+
return originalRender(h, context);
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
// inject component registration as beforeCreate hook
|
|
105
|
+
const existing = options.beforeCreate;
|
|
106
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return script;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const isOldIE = typeof navigator !== 'undefined' &&
|
|
113
|
+
/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
|
|
114
|
+
function createInjector(context) {
|
|
115
|
+
return (id, style) => addStyle(id, style);
|
|
116
|
+
}
|
|
117
|
+
let HEAD;
|
|
118
|
+
const styles = {};
|
|
119
|
+
function addStyle(id, css) {
|
|
120
|
+
const group = isOldIE ? css.media || 'default' : id;
|
|
121
|
+
const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] });
|
|
122
|
+
if (!style.ids.has(id)) {
|
|
123
|
+
style.ids.add(id);
|
|
124
|
+
let code = css.source;
|
|
125
|
+
if (css.map) {
|
|
126
|
+
// https://developer.chrome.com/devtools/docs/javascript-debugging
|
|
127
|
+
// this makes source maps inside style tags work properly in Chrome
|
|
128
|
+
code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';
|
|
129
|
+
// http://stackoverflow.com/a/26603875
|
|
130
|
+
code +=
|
|
131
|
+
'\n/*# sourceMappingURL=data:application/json;base64,' +
|
|
132
|
+
btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +
|
|
133
|
+
' */';
|
|
134
|
+
}
|
|
135
|
+
if (!style.element) {
|
|
136
|
+
style.element = document.createElement('style');
|
|
137
|
+
style.element.type = 'text/css';
|
|
138
|
+
if (css.media)
|
|
139
|
+
style.element.setAttribute('media', css.media);
|
|
140
|
+
if (HEAD === undefined) {
|
|
141
|
+
HEAD = document.head || document.getElementsByTagName('head')[0];
|
|
142
|
+
}
|
|
143
|
+
HEAD.appendChild(style.element);
|
|
144
|
+
}
|
|
145
|
+
if ('styleSheet' in style.element) {
|
|
146
|
+
style.styles.push(code);
|
|
147
|
+
style.element.styleSheet.cssText = style.styles
|
|
148
|
+
.filter(Boolean)
|
|
149
|
+
.join('\n');
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
const index = style.ids.size - 1;
|
|
153
|
+
const textNode = document.createTextNode(code);
|
|
154
|
+
const nodes = style.element.childNodes;
|
|
155
|
+
if (nodes[index])
|
|
156
|
+
style.element.removeChild(nodes[index]);
|
|
157
|
+
if (nodes.length)
|
|
158
|
+
style.element.insertBefore(textNode, nodes[index]);
|
|
159
|
+
else
|
|
160
|
+
style.element.appendChild(textNode);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* script */
|
|
166
|
+
const __vue_script__ = script;
|
|
167
|
+
|
|
168
|
+
/* template */
|
|
169
|
+
var __vue_render__ = function () {
|
|
170
|
+
var _vm = this;
|
|
171
|
+
var _h = _vm.$createElement;
|
|
172
|
+
var _c = _vm._self._c || _h;
|
|
173
|
+
return _c("div", { staticClass: "hi-title" }, [
|
|
174
|
+
_vm._v("\n " + _vm._s(_vm.content) + "\n"),
|
|
175
|
+
])
|
|
176
|
+
};
|
|
177
|
+
var __vue_staticRenderFns__ = [];
|
|
178
|
+
__vue_render__._withStripped = true;
|
|
179
|
+
|
|
180
|
+
/* style */
|
|
181
|
+
const __vue_inject_styles__ = function (inject) {
|
|
182
|
+
if (!inject) return
|
|
183
|
+
inject("data-v-03a3ffda_0", { source: "\n.title[data-v-03a3ffda] {\n text-align: center;\n margin: 20px 0;\n}\n", map: {"version":3,"sources":["/home/runner/work/holyer-lib/holyer-lib/packages/ui/title/src/index.vue"],"names":[],"mappings":";AAoBA;EACA,kBAAA;EACA,cAAA;AACA","file":"index.vue","sourcesContent":["<template>\n <div class=\"hi-title\">\n {{ content }}\n </div>\n</template>\n\n<script>\nexport default {\n name: 'HiTitle',\n props: {\n content: {\n type: String,\n default: '标题'\n }\n },\n data() {}\n};\n</script>\n\n<style scoped>\n.title {\n text-align: center;\n margin: 20px 0;\n}\n</style>\n"]}, media: undefined });
|
|
184
|
+
|
|
185
|
+
};
|
|
186
|
+
/* scoped */
|
|
187
|
+
const __vue_scope_id__ = "data-v-03a3ffda";
|
|
188
|
+
/* module identifier */
|
|
189
|
+
const __vue_module_identifier__ = undefined;
|
|
190
|
+
/* functional template */
|
|
191
|
+
const __vue_is_functional_template__ = false;
|
|
192
|
+
/* style inject SSR */
|
|
193
|
+
|
|
194
|
+
/* style inject shadow dom */
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
const __vue_component__ = /*#__PURE__*/normalizeComponent(
|
|
199
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
200
|
+
__vue_inject_styles__,
|
|
201
|
+
__vue_script__,
|
|
202
|
+
__vue_scope_id__,
|
|
203
|
+
__vue_is_functional_template__,
|
|
204
|
+
__vue_module_identifier__,
|
|
205
|
+
false,
|
|
206
|
+
createInjector,
|
|
207
|
+
undefined,
|
|
208
|
+
undefined
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
return __vue_component__;
|
|
212
|
+
|
|
213
|
+
}));
|