@itfin/components 1.0.62 → 1.0.64
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/package.json
CHANGED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// modified copy of https://github.com/vuejs/vue-loader/blob/master/lib/runtime/componentNormalizer.js
|
|
2
|
+
// contains code to inject styles from options.injectStyles
|
|
3
|
+
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/* globals __VUE_SSR_CONTEXT__ */
|
|
6
|
+
|
|
7
|
+
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
|
8
|
+
// This module is a runtime utility for cleaner component module output and will
|
|
9
|
+
// be included in the final webpack user bundle.
|
|
10
|
+
|
|
11
|
+
export default function normalizeComponent (
|
|
12
|
+
scriptExports,
|
|
13
|
+
render,
|
|
14
|
+
staticRenderFns,
|
|
15
|
+
functionalTemplate,
|
|
16
|
+
injectStyles,
|
|
17
|
+
scopeId,
|
|
18
|
+
moduleIdentifier, /* server only */
|
|
19
|
+
shadowMode /* vue-cli only */
|
|
20
|
+
) {
|
|
21
|
+
// Vue.extend constructor export interop
|
|
22
|
+
var options = typeof scriptExports === 'function'
|
|
23
|
+
? scriptExports.options
|
|
24
|
+
: scriptExports
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
// render functions
|
|
28
|
+
if (render) {
|
|
29
|
+
options.render = render
|
|
30
|
+
options.staticRenderFns = staticRenderFns
|
|
31
|
+
options._compiled = true
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// functional template
|
|
35
|
+
if (functionalTemplate) {
|
|
36
|
+
options.functional = true
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// scopedId
|
|
40
|
+
if (scopeId) {
|
|
41
|
+
options._scopeId = 'data-v-' + scopeId
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
var hook
|
|
45
|
+
if (moduleIdentifier) { // server build
|
|
46
|
+
hook = function (context) {
|
|
47
|
+
// 2.3 injection
|
|
48
|
+
context =
|
|
49
|
+
context || // cached call
|
|
50
|
+
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
51
|
+
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
|
52
|
+
// 2.2 with runInNewContext: true
|
|
53
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
54
|
+
context = __VUE_SSR_CONTEXT__
|
|
55
|
+
}
|
|
56
|
+
// modification start
|
|
57
|
+
if (Array.isArray(options.injectStyles)) {
|
|
58
|
+
options.injectStyles.forEach((style) => {
|
|
59
|
+
if (style.__inject__) { // eslint-disable-line no-underscore-dangle
|
|
60
|
+
style.__inject__(context); // eslint-disable-line no-underscore-dangle
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
// modification end
|
|
65
|
+
|
|
66
|
+
// inject component styles
|
|
67
|
+
if (injectStyles) {
|
|
68
|
+
injectStyles.call(this, context)
|
|
69
|
+
}
|
|
70
|
+
// register component module identifier for async chunk inferrence
|
|
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
|
+
} else if (injectStyles) {
|
|
79
|
+
hook = shadowMode
|
|
80
|
+
? function () {
|
|
81
|
+
injectStyles.call(
|
|
82
|
+
this,
|
|
83
|
+
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
: injectStyles
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (hook) {
|
|
90
|
+
if (options.functional) {
|
|
91
|
+
// for template-only hot-reload because in that case the render fn doesn't
|
|
92
|
+
// go through the normalizer
|
|
93
|
+
options._injectStyles = hook
|
|
94
|
+
// register for functional component in vue file
|
|
95
|
+
var originalRender = options.render
|
|
96
|
+
options.render = function renderWithStyleInjection (h, context) {
|
|
97
|
+
hook.call(context)
|
|
98
|
+
return originalRender(h, context)
|
|
99
|
+
}
|
|
100
|
+
} else {
|
|
101
|
+
// inject component registration as beforeCreate hook
|
|
102
|
+
var existing = options.beforeCreate
|
|
103
|
+
options.beforeCreate = existing
|
|
104
|
+
? [].concat(existing, hook)
|
|
105
|
+
: [hook]
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return {
|
|
110
|
+
exports: scriptExports,
|
|
111
|
+
options: options
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import webpack from 'webpack';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
export default function extend(config) {
|
|
5
|
+
config.plugins.push(new webpack.NormalModuleReplacementPlugin(
|
|
6
|
+
/vue-loader\/lib\/runtime\/componentNormalizer.js/,
|
|
7
|
+
path.join(__dirname, 'componentNormalizer.js'),
|
|
8
|
+
));
|
|
9
|
+
};
|