@holyer-lib/ui 0.0.7 → 0.1.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/dist/ui.cjs.js CHANGED
@@ -14,21 +14,13 @@ function __$styleInject(css) {
14
14
  return css;
15
15
  }
16
16
 
17
- function __$styleInject(css) {
18
- if (!css) return;
19
-
20
- if (typeof window == 'undefined') return;
21
- var style = document.createElement('style');
22
- style.setAttribute('media', 'screen');
23
-
24
- style.innerHTML = css;
25
- document.head.appendChild(style);
26
- return css;
27
- }
28
-
29
- __$styleInject(".hi-title {\n font-size: 24px;\n font-weight: bold;\n margin: 16px 0;\n border-left: 4px solid var(--td-brand-color);\n}\n");
30
-
31
17
  //
18
+ //
19
+ //
20
+ //
21
+ //
22
+ //
23
+
32
24
  var script = {
33
25
  name: 'HiTitle',
34
26
  props: {
@@ -37,9 +29,7 @@ var script = {
37
29
  default: '标题'
38
30
  }
39
31
  },
40
- data() {
41
- return {};
42
- }
32
+ data() {}
43
33
  };
44
34
 
45
35
  function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
@@ -117,6 +107,59 @@ function normalizeComponent(template, style, script, scopeId, isFunctionalTempla
117
107
  return script;
118
108
  }
119
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
+
120
163
  /* script */
121
164
  const __vue_script__ = script;
122
165
 
@@ -125,30 +168,25 @@ var __vue_render__ = function () {
125
168
  var _vm = this;
126
169
  var _h = _vm.$createElement;
127
170
  var _c = _vm._self._c || _h;
128
- return _c(
129
- "div",
130
- { staticClass: "hi-title" },
131
- [
132
- _vm._t("default", function () {
133
- return [_vm._v(_vm._s(_vm.content))]
134
- }),
135
- ],
136
- 2
137
- )
171
+ return _c("div", { staticClass: "hi-title" }, [
172
+ _vm._v("\n " + _vm._s(_vm.content) + "\n"),
173
+ ])
138
174
  };
139
175
  var __vue_staticRenderFns__ = [];
140
176
  __vue_render__._withStripped = true;
141
177
 
142
178
  /* style */
143
- const __vue_inject_styles__ = undefined;
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
+ };
144
184
  /* scoped */
145
- const __vue_scope_id__ = undefined;
185
+ const __vue_scope_id__ = "data-v-03a3ffda";
146
186
  /* module identifier */
147
187
  const __vue_module_identifier__ = undefined;
148
188
  /* functional template */
149
189
  const __vue_is_functional_template__ = false;
150
- /* style inject */
151
-
152
190
  /* style inject SSR */
153
191
 
154
192
  /* style inject shadow dom */
@@ -163,7 +201,7 @@ __vue_render__._withStripped = true;
163
201
  __vue_is_functional_template__,
164
202
  __vue_module_identifier__,
165
203
  false,
166
- undefined,
204
+ createInjector,
167
205
  undefined,
168
206
  undefined
169
207
  );
package/dist/ui.esm.js CHANGED
@@ -10,21 +10,13 @@ function __$styleInject(css) {
10
10
  return css;
11
11
  }
12
12
 
13
- function __$styleInject(css) {
14
- if (!css) return;
15
-
16
- if (typeof window == 'undefined') return;
17
- var style = document.createElement('style');
18
- style.setAttribute('media', 'screen');
19
-
20
- style.innerHTML = css;
21
- document.head.appendChild(style);
22
- return css;
23
- }
24
-
25
- __$styleInject(".hi-title {\n font-size: 24px;\n font-weight: bold;\n margin: 16px 0;\n border-left: 4px solid var(--td-brand-color);\n}\n");
26
-
27
13
  //
14
+ //
15
+ //
16
+ //
17
+ //
18
+ //
19
+
28
20
  var script = {
29
21
  name: 'HiTitle',
30
22
  props: {
@@ -33,9 +25,7 @@ var script = {
33
25
  default: '标题'
34
26
  }
35
27
  },
36
- data() {
37
- return {};
38
- }
28
+ data() {}
39
29
  };
40
30
 
41
31
  function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
@@ -113,6 +103,59 @@ function normalizeComponent(template, style, script, scopeId, isFunctionalTempla
113
103
  return script;
114
104
  }
115
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
+
116
159
  /* script */
117
160
  const __vue_script__ = script;
118
161
 
@@ -121,30 +164,25 @@ var __vue_render__ = function () {
121
164
  var _vm = this;
122
165
  var _h = _vm.$createElement;
123
166
  var _c = _vm._self._c || _h;
124
- return _c(
125
- "div",
126
- { staticClass: "hi-title" },
127
- [
128
- _vm._t("default", function () {
129
- return [_vm._v(_vm._s(_vm.content))]
130
- }),
131
- ],
132
- 2
133
- )
167
+ return _c("div", { staticClass: "hi-title" }, [
168
+ _vm._v("\n " + _vm._s(_vm.content) + "\n"),
169
+ ])
134
170
  };
135
171
  var __vue_staticRenderFns__ = [];
136
172
  __vue_render__._withStripped = true;
137
173
 
138
174
  /* style */
139
- const __vue_inject_styles__ = undefined;
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
+ };
140
180
  /* scoped */
141
- const __vue_scope_id__ = undefined;
181
+ const __vue_scope_id__ = "data-v-03a3ffda";
142
182
  /* module identifier */
143
183
  const __vue_module_identifier__ = undefined;
144
184
  /* functional template */
145
185
  const __vue_is_functional_template__ = false;
146
- /* style inject */
147
-
148
186
  /* style inject SSR */
149
187
 
150
188
  /* style inject shadow dom */
@@ -159,7 +197,7 @@ __vue_render__._withStripped = true;
159
197
  __vue_is_functional_template__,
160
198
  __vue_module_identifier__,
161
199
  false,
162
- undefined,
200
+ createInjector,
163
201
  undefined,
164
202
  undefined
165
203
  );
package/dist/ui.umd.js CHANGED
@@ -16,21 +16,13 @@
16
16
  return css;
17
17
  }
18
18
 
19
- function __$styleInject(css) {
20
- if (!css) return;
21
-
22
- if (typeof window == 'undefined') return;
23
- var style = document.createElement('style');
24
- style.setAttribute('media', 'screen');
25
-
26
- style.innerHTML = css;
27
- document.head.appendChild(style);
28
- return css;
29
- }
30
-
31
- __$styleInject(".hi-title {\n font-size: 24px;\n font-weight: bold;\n margin: 16px 0;\n border-left: 4px solid var(--td-brand-color);\n}\n");
32
-
33
19
  //
20
+ //
21
+ //
22
+ //
23
+ //
24
+ //
25
+
34
26
  var script = {
35
27
  name: 'HiTitle',
36
28
  props: {
@@ -39,9 +31,7 @@
39
31
  default: '标题'
40
32
  }
41
33
  },
42
- data() {
43
- return {};
44
- }
34
+ data() {}
45
35
  };
46
36
 
47
37
  function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
@@ -119,6 +109,59 @@
119
109
  return script;
120
110
  }
121
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
+
122
165
  /* script */
123
166
  const __vue_script__ = script;
124
167
 
@@ -127,30 +170,25 @@
127
170
  var _vm = this;
128
171
  var _h = _vm.$createElement;
129
172
  var _c = _vm._self._c || _h;
130
- return _c(
131
- "div",
132
- { staticClass: "hi-title" },
133
- [
134
- _vm._t("default", function () {
135
- return [_vm._v(_vm._s(_vm.content))]
136
- }),
137
- ],
138
- 2
139
- )
173
+ return _c("div", { staticClass: "hi-title" }, [
174
+ _vm._v("\n " + _vm._s(_vm.content) + "\n"),
175
+ ])
140
176
  };
141
177
  var __vue_staticRenderFns__ = [];
142
178
  __vue_render__._withStripped = true;
143
179
 
144
180
  /* style */
145
- const __vue_inject_styles__ = undefined;
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
+ };
146
186
  /* scoped */
147
- const __vue_scope_id__ = undefined;
187
+ const __vue_scope_id__ = "data-v-03a3ffda";
148
188
  /* module identifier */
149
189
  const __vue_module_identifier__ = undefined;
150
190
  /* functional template */
151
191
  const __vue_is_functional_template__ = false;
152
- /* style inject */
153
-
154
192
  /* style inject SSR */
155
193
 
156
194
  /* style inject shadow dom */
@@ -165,7 +203,7 @@
165
203
  __vue_is_functional_template__,
166
204
  __vue_module_identifier__,
167
205
  false,
168
- undefined,
206
+ createInjector,
169
207
  undefined,
170
208
  undefined
171
209
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holyer-lib/ui",
3
- "version": "0.0.7",
3
+ "version": "0.1.0",
4
4
  "main": "dist/ui.cjs.js",
5
5
  "module": "dist/ui.esm.js",
6
6
  "unpkg": "dist/ui.umd.js",
@@ -11,7 +11,7 @@
11
11
  "access": "public"
12
12
  },
13
13
  "dependencies": {
14
- "@holyer-lib/title": "1.0.0"
14
+ "@holyer-lib/title": "0.1.0"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "vue": "2.6.14"