diff --git a/lib/components/JsonSchema/json-schema-common.scss b/lib/components/JsonSchema/json-schema-common.scss index 78a260bf..7276e414 100644 --- a/lib/components/JsonSchema/json-schema-common.scss +++ b/lib/components/JsonSchema/json-schema-common.scss @@ -30,8 +30,9 @@ $sub-schema-offset: ($bullet-size/2) + $bullet-margin; } .param-name { + display: inline-block; font-size: 14px; - padding: $cell-padding $cell-spacing $cell-padding 0; + padding: $cell-padding 0 $cell-padding 0; font-weight: bold; box-sizing: border-box; line-height: $param-name-height; @@ -40,11 +41,17 @@ $sub-schema-offset: ($bullet-size/2) + $bullet-margin; position: relative; } +.param-name-content { + padding-right: $cell-spacing; + display: inline-block; +} + .param-info { width: 100%; padding: $cell-padding 0; box-sizing: border-box; border-bottom: 1px solid #ccc; + display: inline-block; } .param { diff --git a/lib/components/JsonSchema/json-schema.html b/lib/components/JsonSchema/json-schema.html index 9828a49a..14cf99ca 100644 --- a/lib/components/JsonSchema/json-schema.html +++ b/lib/components/JsonSchema/json-schema.html @@ -6,7 +6,7 @@
- {{prop._name}} + {{prop._name}}
diff --git a/lib/components/JsonSchema/json-schema.js b/lib/components/JsonSchema/json-schema.js index a55aff42..1128f072 100644 --- a/lib/components/JsonSchema/json-schema.js +++ b/lib/components/JsonSchema/json-schema.js @@ -86,12 +86,12 @@ export default class JsonSchema extends BaseComponent { adjustNameColumnWidth() { // TODO handle internal schemes differently - let names = [].slice.call(this.element.querySelectorAll('.param-name')); + let names = [].slice.call(this.element.querySelectorAll('.param-name-content')); let widths = names.map(el => el.offsetWidth); let maxWidth = Math.max(...widths); if (!maxWidth) return; names.forEach(el => { - el.style.minWidth = maxWidth + 'px'; + el.parentNode.style.minWidth = maxWidth + 'px'; }); let discrValues = this.element.querySelector('tabs ul'); @@ -141,8 +141,8 @@ export default class JsonSchema extends BaseComponent { return propData; } - init() { - setTimeout(() => this.adjustNameColumnWidth()); + ngAfterViewInit() { + this.adjustNameColumnWidth(); } } JsonSchema.parameters = JsonSchema.parameters.concat([[ElementRef]]); diff --git a/lib/components/JsonSchema/json-schema.scss b/lib/components/JsonSchema/json-schema.scss index 50948819..a8793f9e 100644 --- a/lib/components/JsonSchema/json-schema.scss +++ b/lib/components/JsonSchema/json-schema.scss @@ -3,6 +3,7 @@ /* styles for array-schema for array */ $array-marker-font-sz: 12px; $array-marker-line-height: 1.5; + .params-wrap.params-array:before, .params-wrap.params-array:after { display: block; font-weight: bold; diff --git a/lib/components/ParamsList/params-list.html b/lib/components/ParamsList/params-list.html index 86e66c5c..2a51db6a 100644 --- a/lib/components/ParamsList/params-list.html +++ b/lib/components/ParamsList/params-list.html @@ -2,7 +2,7 @@
- {{param.name}} + {{param.name}}