Skip to content

Commit b903c44

Browse files
committed
[build] 1.3.0
1 parent 2a56bd2 commit b903c44

File tree

5 files changed

+61
-23
lines changed

5 files changed

+61
-23
lines changed

dist/vue-custom-element.esm.js

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-custom-element v1.2.2
2+
* vue-custom-element v1.3.0
33
* (c) 2017 Karol Fabjańczuk
44
* @license MIT
55
*/
@@ -164,6 +164,20 @@ function convertAttributeValue(value) {
164164
return propsValue;
165165
}
166166

167+
function extractProps(collection, props) {
168+
if (collection && collection.length) {
169+
collection.forEach(function (prop) {
170+
var camelCaseProp = camelize(prop);
171+
props.camelCase.indexOf(camelCaseProp) === -1 && props.camelCase.push(camelCaseProp);
172+
});
173+
} else if (collection && (typeof collection === 'undefined' ? 'undefined' : _typeof(collection)) === 'object') {
174+
for (var prop in collection) {
175+
var camelCaseProp = camelize(prop);
176+
props.camelCase.indexOf(camelCaseProp) === -1 && props.camelCase.push(camelCaseProp);
177+
}
178+
}
179+
}
180+
167181
function getProps() {
168182
var componentDefinition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
169183

@@ -172,16 +186,21 @@ function getProps() {
172186
hyphenate: []
173187
};
174188

175-
if (componentDefinition.props && componentDefinition.props.length) {
176-
componentDefinition.props.forEach(function (prop) {
177-
props.camelCase.push(camelize(prop));
189+
if (componentDefinition.mixins) {
190+
componentDefinition.mixins.forEach(function (mixin) {
191+
extractProps(mixin.props, props);
178192
});
179-
} else if (componentDefinition.props && _typeof(componentDefinition.props) === 'object') {
180-
for (var prop in componentDefinition.props) {
181-
props.camelCase.push(camelize(prop));
182-
}
183193
}
184194

195+
if (componentDefinition.extends && componentDefinition.extends.props) {
196+
var parentProps = componentDefinition.extends.props;
197+
198+
199+
extractProps(parentProps, props);
200+
}
201+
202+
extractProps(componentDefinition.props, props);
203+
185204
props.camelCase.forEach(function (prop) {
186205
props.hyphenate.push(hyphenate(prop));
187206
});
@@ -302,7 +321,7 @@ function createVueInstance(element, Vue, componentDefinition, props, options) {
302321
}
303322

304323
customEmit.apply(undefined, [element].concat(args));
305-
(_proto__$$emit = this.__proto__.$emit).call.apply(_proto__$$emit, [this].concat(args));
324+
this.__proto__ && (_proto__$$emit = this.__proto__.$emit).call.apply(_proto__$$emit, [this].concat(args));
306325
};
307326

308327
var rootElement = void 0;

dist/vue-custom-element.js

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-custom-element v1.2.2
2+
* vue-custom-element v1.3.0
33
* (c) 2017 Karol Fabjańczuk
44
* @license MIT
55
*/
@@ -170,6 +170,20 @@ function convertAttributeValue(value) {
170170
return propsValue;
171171
}
172172

173+
function extractProps(collection, props) {
174+
if (collection && collection.length) {
175+
collection.forEach(function (prop) {
176+
var camelCaseProp = camelize(prop);
177+
props.camelCase.indexOf(camelCaseProp) === -1 && props.camelCase.push(camelCaseProp);
178+
});
179+
} else if (collection && (typeof collection === 'undefined' ? 'undefined' : _typeof(collection)) === 'object') {
180+
for (var prop in collection) {
181+
var camelCaseProp = camelize(prop);
182+
props.camelCase.indexOf(camelCaseProp) === -1 && props.camelCase.push(camelCaseProp);
183+
}
184+
}
185+
}
186+
173187
function getProps() {
174188
var componentDefinition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
175189

@@ -178,16 +192,21 @@ function getProps() {
178192
hyphenate: []
179193
};
180194

181-
if (componentDefinition.props && componentDefinition.props.length) {
182-
componentDefinition.props.forEach(function (prop) {
183-
props.camelCase.push(camelize(prop));
195+
if (componentDefinition.mixins) {
196+
componentDefinition.mixins.forEach(function (mixin) {
197+
extractProps(mixin.props, props);
184198
});
185-
} else if (componentDefinition.props && _typeof(componentDefinition.props) === 'object') {
186-
for (var prop in componentDefinition.props) {
187-
props.camelCase.push(camelize(prop));
188-
}
189199
}
190200

201+
if (componentDefinition.extends && componentDefinition.extends.props) {
202+
var parentProps = componentDefinition.extends.props;
203+
204+
205+
extractProps(parentProps, props);
206+
}
207+
208+
extractProps(componentDefinition.props, props);
209+
191210
props.camelCase.forEach(function (prop) {
192211
props.hyphenate.push(hyphenate(prop));
193212
});
@@ -308,7 +327,7 @@ function createVueInstance(element, Vue, componentDefinition, props, options) {
308327
}
309328

310329
customEmit.apply(undefined, [element].concat(args));
311-
(_proto__$$emit = this.__proto__.$emit).call.apply(_proto__$$emit, [this].concat(args));
330+
this.__proto__ && (_proto__$$emit = this.__proto__.$emit).call.apply(_proto__$$emit, [this].concat(args));
312331
};
313332

314333
var rootElement = void 0;

dist/vue-custom-element.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/demo.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/demo.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)