add exportProps to component as public infromation about component props interface

pull/3917/head
Yury Zhuravlev 6 years ago
parent 7e2e23e7ae
commit 27854a37ff

@ -440,9 +440,10 @@ export default function dom(
constructor(options) {
super();
this.exportProps = ${prop_names};
${css.code && b`this.shadowRoot.innerHTML = \`<style>${css.code.replace(/\\/g, '\\\\')}${options.dev ? `\n/*# sourceMappingURL=${css.map.toUrl()} */` : ''}</style>\`;`}
@init(this, { target: this.shadowRoot }, ${definition}, ${has_create_fragment ? 'create_fragment': 'null'}, ${not_equal}, ${prop_names});
@init(this, { target: this.shadowRoot }, ${definition}, ${has_create_fragment ? 'create_fragment': 'null'}, ${not_equal}, this.exportProps);
${dev_props_check}
@ -493,8 +494,9 @@ export default function dom(
class ${name} extends ${superclass} {
constructor(options) {
super(${options.dev && `options`});
this.exportProps = ${prop_names};
${should_add_css && b`if (!@_document.getElementById("${component.stylesheet.id}-style")) ${add_css}();`}
@init(this, options, ${definition}, ${has_create_fragment ? 'create_fragment': 'null'}, ${not_equal}, ${prop_names});
@init(this, options, ${definition}, ${has_create_fragment ? 'create_fragment': 'null'}, ${not_equal}, this.exportProps);
${options.dev && b`@dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "${name.name}", options, id: create_fragment.name });`}
${dev_props_check}

Loading…
Cancel
Save