@@ -2,7 +2,7 @@ import { Data } from "./data.js"
22import { SettingsContainer } from "./settings/settings-container.js"
33import "./table.js"
44
5- export class DataViewer extends HTMLElement {
5+ export class FlatbreadTable extends HTMLElement {
66 static get observedAttributes ( ) {
77 return [
88 "src" , "type" , "hide-settings-menu" ,
@@ -48,7 +48,7 @@ export class DataViewer extends HTMLElement {
4848 constructor ( ) {
4949 super ( )
5050 this . attachShadow ( { mode : "open" } )
51- this . options = { ...DataViewer . defaults }
51+ this . options = { ...FlatbreadTable . defaults }
5252
5353 this . handleDataChange = this . handleDataChange . bind ( this )
5454 this . handleTableClick = this . handleTableClick . bind ( this )
@@ -88,17 +88,17 @@ export class DataViewer extends HTMLElement {
8888 this . loadDataFromSrc ( newValue )
8989 return
9090 case "type" :
91- this . options . type = newValue ?? DataViewer . defaults . type
91+ this . options . type = newValue ?? FlatbreadTable . defaults . type
9292 break
9393 case "hide-settings-menu" :
9494 // currently handled only with css (see styles)
95- this . options . settingsMenu = ! this . getBooleanAttribute ( newValue ) ?? DataViewer . defaults . settingsMenu
95+ this . options . settingsMenu = ! this . getBooleanAttribute ( newValue ) ?? FlatbreadTable . defaults . settingsMenu
9696 break
9797 case "locale" :
98- this . options . locale = newValue ?? DataViewer . defaults . locale
98+ this . options . locale = newValue ?? FlatbreadTable . defaults . locale
9999 break
100100 case "na-rep" :
101- this . options . naRep = newValue ?? DataViewer . defaults . naRep
101+ this . options . naRep = newValue ?? FlatbreadTable . defaults . naRep
102102 break
103103 case "hide-column-borders" :
104104 this . options . styling . columnBorders = ! this . getBooleanAttribute ( newValue )
@@ -124,7 +124,7 @@ export class DataViewer extends HTMLElement {
124124 case "column-border-levels" : {
125125 const level = parseInt ( newValue )
126126 this . options . styling . columnBorderLevels = Number . isNaN ( level )
127- ? DataViewer . defaults . styling . columnBorderLevels
127+ ? FlatbreadTable . defaults . styling . columnBorderLevels
128128 : level
129129 break
130130 }
@@ -135,21 +135,21 @@ export class DataViewer extends HTMLElement {
135135 case "section-levels" : {
136136 const level = parseInt ( newValue )
137137 this . options . styling . sectionLevels = Number . isNaN ( level )
138- ? DataViewer . defaults . styling . sectionLevels
138+ ? FlatbreadTable . defaults . styling . sectionLevels
139139 : Math . max ( 0 , level )
140140 break
141141 }
142142 case "max-rows" :
143- this . options . truncation . maxRows = parseInt ( newValue ) ?? DataViewer . defaults . maxRows
143+ this . options . truncation . maxRows = parseInt ( newValue ) ?? FlatbreadTable . defaults . maxRows
144144 break
145145 case "max-columns" :
146- this . options . truncation . maxColumns = parseInt ( newValue ) ?? DataViewer . defaults . maxColumns
146+ this . options . truncation . maxColumns = parseInt ( newValue ) ?? FlatbreadTable . defaults . maxColumns
147147 break
148148 case "trim-size" :
149- this . options . truncation . trimSize = parseInt ( newValue ) ?? DataViewer . defaults . trimSize
149+ this . options . truncation . trimSize = parseInt ( newValue ) ?? FlatbreadTable . defaults . trimSize
150150 break
151151 case "separator" :
152- this . options . truncation . separator = newValue ?? DataViewer . defaults . separator
152+ this . options . truncation . separator = newValue ?? FlatbreadTable . defaults . separator
153153 break
154154 }
155155 this . update ( )
@@ -356,4 +356,4 @@ export class DataViewer extends HTMLElement {
356356 }
357357}
358358
359- window . customElements . define ( 'flatbread-table' , DataViewer )
359+ window . customElements . define ( 'flatbread-table' , FlatbreadTable )
0 commit comments