1fb726d48Sopenharmony_ci/*
2fb726d48Sopenharmony_ci * Copyright (C) 2022 Huawei Device Co., Ltd.
3fb726d48Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4fb726d48Sopenharmony_ci * you may not use this file except in compliance with the License.
5fb726d48Sopenharmony_ci * You may obtain a copy of the License at
6fb726d48Sopenharmony_ci *
7fb726d48Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8fb726d48Sopenharmony_ci *
9fb726d48Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10fb726d48Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11fb726d48Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12fb726d48Sopenharmony_ci * See the License for the specific language governing permissions and
13fb726d48Sopenharmony_ci * limitations under the License.
14fb726d48Sopenharmony_ci */
15fb726d48Sopenharmony_ci
16fb726d48Sopenharmony_ciimport '../icon/LitIcon';
17fb726d48Sopenharmony_ciimport { BaseElement, element } from '../BaseElement';
18fb726d48Sopenharmony_ciimport { type LitIcon } from '../icon/LitIcon';
19fb726d48Sopenharmony_ciimport { type TreeItemData } from './LitTree';
20fb726d48Sopenharmony_ciimport { LitTreeNodeHtmlStyle } from './LitTreeNode.html';
21fb726d48Sopenharmony_ci
22fb726d48Sopenharmony_ci@element('lit-tree-node')
23fb726d48Sopenharmony_ciexport class LitTreeNode extends BaseElement {
24fb726d48Sopenharmony_ci  private arrowElement: HTMLSpanElement | null | undefined;
25fb726d48Sopenharmony_ci  private itemElement: HTMLDivElement | null | undefined;
26fb726d48Sopenharmony_ci  private checkboxElement: HTMLInputElement | null | undefined;
27fb726d48Sopenharmony_ci  private iconElement: LitIcon | null | undefined;
28fb726d48Sopenharmony_ci  private _data: TreeItemData | null | undefined;
29fb726d48Sopenharmony_ci
30fb726d48Sopenharmony_ci  static get observedAttributes(): string[] {
31fb726d48Sopenharmony_ci    return [
32fb726d48Sopenharmony_ci      'icon-name',
33fb726d48Sopenharmony_ci      'icon-size',
34fb726d48Sopenharmony_ci      'color',
35fb726d48Sopenharmony_ci      'path',
36fb726d48Sopenharmony_ci      'title',
37fb726d48Sopenharmony_ci      'arrow',
38fb726d48Sopenharmony_ci      'checkable',
39fb726d48Sopenharmony_ci      'selected',
40fb726d48Sopenharmony_ci      'checked',
41fb726d48Sopenharmony_ci      'missing',
42fb726d48Sopenharmony_ci      'multiple',
43fb726d48Sopenharmony_ci      'top-depth',
44fb726d48Sopenharmony_ci    ];
45fb726d48Sopenharmony_ci  }
46fb726d48Sopenharmony_ci
47fb726d48Sopenharmony_ci  get checkable(): string {
48fb726d48Sopenharmony_ci    return this.getAttribute('checkable') || 'false';
49fb726d48Sopenharmony_ci  }
50fb726d48Sopenharmony_ci
51fb726d48Sopenharmony_ci  set data(value: TreeItemData | null | undefined) {
52fb726d48Sopenharmony_ci    this._data = value;
53fb726d48Sopenharmony_ci  }
54fb726d48Sopenharmony_ci
55fb726d48Sopenharmony_ci  get data(): TreeItemData | null | undefined {
56fb726d48Sopenharmony_ci    return this._data;
57fb726d48Sopenharmony_ci  }
58fb726d48Sopenharmony_ci
59fb726d48Sopenharmony_ci  set checkable(value) {
60fb726d48Sopenharmony_ci    if (value === 'true') {
61fb726d48Sopenharmony_ci      this.setAttribute('checkable', 'true');
62fb726d48Sopenharmony_ci    } else {
63fb726d48Sopenharmony_ci      this.setAttribute('checkable', 'false');
64fb726d48Sopenharmony_ci    }
65fb726d48Sopenharmony_ci  }
66fb726d48Sopenharmony_ci
67fb726d48Sopenharmony_ci  set multiple(value: boolean) {
68fb726d48Sopenharmony_ci    if (value) {
69fb726d48Sopenharmony_ci      this.setAttribute('multiple', '');
70fb726d48Sopenharmony_ci    } else {
71fb726d48Sopenharmony_ci      this.removeAttribute('multiple');
72fb726d48Sopenharmony_ci    }
73fb726d48Sopenharmony_ci  }
74fb726d48Sopenharmony_ci
75fb726d48Sopenharmony_ci  get multiple(): boolean {
76fb726d48Sopenharmony_ci    return this.hasAttribute('multiple');
77fb726d48Sopenharmony_ci  }
78fb726d48Sopenharmony_ci
79fb726d48Sopenharmony_ci  get iconName(): string {
80fb726d48Sopenharmony_ci    return this.getAttribute('icon-name') || '';
81fb726d48Sopenharmony_ci  }
82fb726d48Sopenharmony_ci
83fb726d48Sopenharmony_ci  set iconName(value) {
84fb726d48Sopenharmony_ci    this.setAttribute('icon-name', value);
85fb726d48Sopenharmony_ci  }
86fb726d48Sopenharmony_ci
87fb726d48Sopenharmony_ci  get topDepth(): boolean {
88fb726d48Sopenharmony_ci    return this.hasAttribute('top-depth');
89fb726d48Sopenharmony_ci  }
90fb726d48Sopenharmony_ci
91fb726d48Sopenharmony_ci  set topDepth(value) {
92fb726d48Sopenharmony_ci    if (value) {
93fb726d48Sopenharmony_ci      this.setAttribute('top-depth', '');
94fb726d48Sopenharmony_ci    } else {
95fb726d48Sopenharmony_ci      this.removeAttribute('top-depth');
96fb726d48Sopenharmony_ci    }
97fb726d48Sopenharmony_ci  }
98fb726d48Sopenharmony_ci
99fb726d48Sopenharmony_ci  get arrow(): boolean {
100fb726d48Sopenharmony_ci    return this.hasAttribute('arrow');
101fb726d48Sopenharmony_ci  }
102fb726d48Sopenharmony_ci
103fb726d48Sopenharmony_ci  set arrow(value) {
104fb726d48Sopenharmony_ci    if (value) {
105fb726d48Sopenharmony_ci      this.setAttribute('arrow', 'true');
106fb726d48Sopenharmony_ci    } else {
107fb726d48Sopenharmony_ci      this.removeAttribute('arrow');
108fb726d48Sopenharmony_ci    }
109fb726d48Sopenharmony_ci  }
110fb726d48Sopenharmony_ci
111fb726d48Sopenharmony_ci  get open(): string {
112fb726d48Sopenharmony_ci    return this.getAttribute('open') || 'true';
113fb726d48Sopenharmony_ci  }
114fb726d48Sopenharmony_ci
115fb726d48Sopenharmony_ci  set open(value) {
116fb726d48Sopenharmony_ci    this.setAttribute('open', value);
117fb726d48Sopenharmony_ci  }
118fb726d48Sopenharmony_ci
119fb726d48Sopenharmony_ci  get selected(): boolean {
120fb726d48Sopenharmony_ci    return this.hasAttribute('selected');
121fb726d48Sopenharmony_ci  }
122fb726d48Sopenharmony_ci
123fb726d48Sopenharmony_ci  set selected(value) {
124fb726d48Sopenharmony_ci    if (value) {
125fb726d48Sopenharmony_ci      this.setAttribute('selected', '');
126fb726d48Sopenharmony_ci    } else {
127fb726d48Sopenharmony_ci      this.removeAttribute('selected');
128fb726d48Sopenharmony_ci    }
129fb726d48Sopenharmony_ci  }
130fb726d48Sopenharmony_ci
131fb726d48Sopenharmony_ci  get checked(): boolean {
132fb726d48Sopenharmony_ci    return this.hasAttribute('checked');
133fb726d48Sopenharmony_ci  }
134fb726d48Sopenharmony_ci
135fb726d48Sopenharmony_ci  set checked(value) {
136fb726d48Sopenharmony_ci    if (value === null || !value) {
137fb726d48Sopenharmony_ci      this.removeAttribute('checked');
138fb726d48Sopenharmony_ci    } else {
139fb726d48Sopenharmony_ci      this.setAttribute('checked', '');
140fb726d48Sopenharmony_ci    }
141fb726d48Sopenharmony_ci  }
142fb726d48Sopenharmony_ci
143fb726d48Sopenharmony_ci  initElements(): void {
144fb726d48Sopenharmony_ci    this.arrowElement = this.shadowRoot!.querySelector<HTMLSpanElement>('#arrow');
145fb726d48Sopenharmony_ci    this.iconElement = this.shadowRoot!.querySelector<LitIcon>('#icon');
146fb726d48Sopenharmony_ci    this.itemElement = this.shadowRoot!.querySelector<HTMLDivElement>('#item');
147fb726d48Sopenharmony_ci    this.checkboxElement = this.shadowRoot!.querySelector<HTMLInputElement>('#checkbox');
148fb726d48Sopenharmony_ci    this.arrowElement!.onclick = (e): void => {
149fb726d48Sopenharmony_ci      e.stopPropagation();
150fb726d48Sopenharmony_ci      this.autoExpand();
151fb726d48Sopenharmony_ci    };
152fb726d48Sopenharmony_ci    this.itemElement!.onclick = (e): void => {
153fb726d48Sopenharmony_ci      e.stopPropagation();
154fb726d48Sopenharmony_ci      if (this._data && this._data.disable === true) {
155fb726d48Sopenharmony_ci        return;
156fb726d48Sopenharmony_ci      }
157fb726d48Sopenharmony_ci      this.onChange(!this.data?.checked);
158fb726d48Sopenharmony_ci    };
159fb726d48Sopenharmony_ci  }
160fb726d48Sopenharmony_ci
161fb726d48Sopenharmony_ci  onChange(checked: boolean): void {
162fb726d48Sopenharmony_ci    this.checked = checked;
163fb726d48Sopenharmony_ci    this.data!.checked = checked;
164fb726d48Sopenharmony_ci    this.checkHandler();
165fb726d48Sopenharmony_ci    this.dispatchEvent(new CustomEvent('change', { detail: checked }));
166fb726d48Sopenharmony_ci  }
167fb726d48Sopenharmony_ci
168fb726d48Sopenharmony_ci  initHtml(): string {
169fb726d48Sopenharmony_ci    return `
170fb726d48Sopenharmony_ci         ${LitTreeNodeHtmlStyle}
171fb726d48Sopenharmony_ci        </style>
172fb726d48Sopenharmony_ci        <span id="arrow" style="margin-right: 2px"></span>
173fb726d48Sopenharmony_ci        <div id="item" style="display: flex;align-items: center;padding-left: 2px">
174fb726d48Sopenharmony_ci<!--            <lit-check-box id="checkbox"></lit-check-box>-->
175fb726d48Sopenharmony_ci            <input id="checkbox" type="radio" style="cursor: pointer; pointer-events: none"/>
176fb726d48Sopenharmony_ci            <lit-icon id="icon" name="${this.iconName}"></lit-icon>
177fb726d48Sopenharmony_ci            <span id="title">${this.title}</span>
178fb726d48Sopenharmony_ci        </div>
179fb726d48Sopenharmony_ci        `;
180fb726d48Sopenharmony_ci  }
181fb726d48Sopenharmony_ci
182fb726d48Sopenharmony_ci  //当 custom element首次被插入文档DOM时,被调用。
183fb726d48Sopenharmony_ci  connectedCallback(): void {
184fb726d48Sopenharmony_ci    if (this.hasAttribute('checked')) {
185fb726d48Sopenharmony_ci      this.checkboxElement!.checked = true;
186fb726d48Sopenharmony_ci    }
187fb726d48Sopenharmony_ci    this.checkHandler();
188fb726d48Sopenharmony_ci  }
189fb726d48Sopenharmony_ci
190fb726d48Sopenharmony_ci  checkHandler(): void {
191fb726d48Sopenharmony_ci    if (this.checked) {
192fb726d48Sopenharmony_ci      this.removeAttribute('missing');
193fb726d48Sopenharmony_ci    }
194fb726d48Sopenharmony_ci    if (this.hasAttribute('multiple')) {
195fb726d48Sopenharmony_ci      if (this.nextElementSibling) {
196fb726d48Sopenharmony_ci        if (this.checked) {
197fb726d48Sopenharmony_ci          this.nextElementSibling.querySelectorAll('lit-tree-node').forEach((a: unknown) => {
198fb726d48Sopenharmony_ci            //@ts-ignore
199fb726d48Sopenharmony_ci            a.checked = true; //@ts-ignore
200fb726d48Sopenharmony_ci            a.removeAttribute('missing');
201fb726d48Sopenharmony_ci          });
202fb726d48Sopenharmony_ci        } else {
203fb726d48Sopenharmony_ci          //@ts-ignore
204fb726d48Sopenharmony_ci          this.nextElementSibling.querySelectorAll('lit-tree-node').forEach((a: unknown) => (a.checked = false));
205fb726d48Sopenharmony_ci        }
206fb726d48Sopenharmony_ci      }
207fb726d48Sopenharmony_ci      let setCheckStatus = (element: unknown): void => {
208fb726d48Sopenharmony_ci        if (
209fb726d48Sopenharmony_ci          //@ts-ignore
210fb726d48Sopenharmony_ci          element.parentElement.parentElement.previousElementSibling && //@ts-ignore
211fb726d48Sopenharmony_ci          element.parentElement.parentElement.previousElementSibling.tagName === 'LIT-TREE-NODE'
212fb726d48Sopenharmony_ci        ) {
213fb726d48Sopenharmony_ci          //@ts-ignore
214fb726d48Sopenharmony_ci          let allChecked = Array.from(element.parentElement.parentElement.querySelectorAll('lit-tree-node')).every(
215fb726d48Sopenharmony_ci            //@ts-ignore
216fb726d48Sopenharmony_ci            (item: unknown) => item.checked
217fb726d48Sopenharmony_ci          ); //@ts-ignore
218fb726d48Sopenharmony_ci          let someChecked = Array.from(element.parentElement.parentElement.querySelectorAll('lit-tree-node')).some(
219fb726d48Sopenharmony_ci            //@ts-ignore
220fb726d48Sopenharmony_ci            (item: unknown, index, array) => item.checked
221fb726d48Sopenharmony_ci          );
222fb726d48Sopenharmony_ci          if (allChecked === true) {
223fb726d48Sopenharmony_ci            //@ts-ignore
224fb726d48Sopenharmony_ci            element.parentElement.parentElement.previousElementSibling.checked = true; //@ts-ignore
225fb726d48Sopenharmony_ci            element.parentElement.parentElement.previousElementSibling.removeAttribute('missing');
226fb726d48Sopenharmony_ci          } else if (someChecked) {
227fb726d48Sopenharmony_ci            //@ts-ignore
228fb726d48Sopenharmony_ci            element.parentElement.parentElement.previousElementSibling.setAttribute('missing', ''); //@ts-ignore
229fb726d48Sopenharmony_ci            element.parentElement.parentElement.previousElementSibling.removeAttribute('checked');
230fb726d48Sopenharmony_ci          } else {
231fb726d48Sopenharmony_ci            //@ts-ignore
232fb726d48Sopenharmony_ci            element.parentElement.parentElement.previousElementSibling.removeAttribute('missing'); //@ts-ignore
233fb726d48Sopenharmony_ci            element.parentElement.parentElement.previousElementSibling.removeAttribute('checked');
234fb726d48Sopenharmony_ci          } //@ts-ignore
235fb726d48Sopenharmony_ci          setCheckStatus(element.parentElement.parentElement.previousElementSibling);
236fb726d48Sopenharmony_ci        }
237fb726d48Sopenharmony_ci      };
238fb726d48Sopenharmony_ci      setCheckStatus(this);
239fb726d48Sopenharmony_ci    }
240fb726d48Sopenharmony_ci  }
241fb726d48Sopenharmony_ci
242fb726d48Sopenharmony_ci  expand(): void {
243fb726d48Sopenharmony_ci    if (this.open === 'true') {
244fb726d48Sopenharmony_ci      return;
245fb726d48Sopenharmony_ci    }
246fb726d48Sopenharmony_ci    let uul = this.parentElement!.querySelector('ul');
247fb726d48Sopenharmony_ci    this.expandSection(uul);
248fb726d48Sopenharmony_ci    this.arrowElement!.style.transform = 'translateX(-50%) rotateZ(0deg)';
249fb726d48Sopenharmony_ci  }
250fb726d48Sopenharmony_ci
251fb726d48Sopenharmony_ci  collapse(): void {
252fb726d48Sopenharmony_ci    if (this.open === 'false') {
253fb726d48Sopenharmony_ci      return;
254fb726d48Sopenharmony_ci    }
255fb726d48Sopenharmony_ci    let uul = this.parentElement!.querySelector('ul');
256fb726d48Sopenharmony_ci    this.collapseSection(uul);
257fb726d48Sopenharmony_ci    this.arrowElement!.style.transform = 'translateX(-50%) rotateZ(-90deg)';
258fb726d48Sopenharmony_ci  }
259fb726d48Sopenharmony_ci
260fb726d48Sopenharmony_ci  autoExpand(): void {
261fb726d48Sopenharmony_ci    let uul = this.parentElement!.querySelector('ul');
262fb726d48Sopenharmony_ci    if (this.open === 'true') {
263fb726d48Sopenharmony_ci      this.collapseSection(uul);
264fb726d48Sopenharmony_ci      this.arrowElement!.style.transform = 'translateX(-50%) rotateZ(-90deg)';
265fb726d48Sopenharmony_ci    } else {
266fb726d48Sopenharmony_ci      this.expandSection(uul);
267fb726d48Sopenharmony_ci      this.arrowElement!.style.transform = 'translateX(-50%) rotateZ(0deg)';
268fb726d48Sopenharmony_ci    }
269fb726d48Sopenharmony_ci  }
270fb726d48Sopenharmony_ci
271fb726d48Sopenharmony_ci  //收起
272fb726d48Sopenharmony_ci  collapseSection(element: unknown): void {
273fb726d48Sopenharmony_ci    if (!element) {
274fb726d48Sopenharmony_ci      return;
275fb726d48Sopenharmony_ci    } //@ts-ignore
276fb726d48Sopenharmony_ci    let sectionHeight = element.scrollHeight; //@ts-ignore
277fb726d48Sopenharmony_ci    let elementTransition = element.style.transition; //@ts-ignore
278fb726d48Sopenharmony_ci    element.style.transition = '';
279fb726d48Sopenharmony_ci    requestAnimationFrame(function () {
280fb726d48Sopenharmony_ci      //@ts-ignore
281fb726d48Sopenharmony_ci      element.style.height = sectionHeight + 'px'; //@ts-ignore
282fb726d48Sopenharmony_ci      element.style.transition = elementTransition;
283fb726d48Sopenharmony_ci      requestAnimationFrame(function () {
284fb726d48Sopenharmony_ci        //@ts-ignore
285fb726d48Sopenharmony_ci        element.style.height = 0 + 'px';
286fb726d48Sopenharmony_ci      });
287fb726d48Sopenharmony_ci    });
288fb726d48Sopenharmony_ci    this.open = 'false';
289fb726d48Sopenharmony_ci  }
290fb726d48Sopenharmony_ci
291fb726d48Sopenharmony_ci  //展开
292fb726d48Sopenharmony_ci  expandSection(element: unknown): void {
293fb726d48Sopenharmony_ci    if (!element) {
294fb726d48Sopenharmony_ci      return;
295fb726d48Sopenharmony_ci    } //@ts-ignore
296fb726d48Sopenharmony_ci    let sectionHeight = element.scrollHeight; //@ts-ignore
297fb726d48Sopenharmony_ci    element.style.height = sectionHeight + 'px'; //@ts-ignore
298fb726d48Sopenharmony_ci    element.ontransitionend = (e: unknown): void => {
299fb726d48Sopenharmony_ci      //@ts-ignore
300fb726d48Sopenharmony_ci      element.ontransitionend = null; //@ts-ignore
301fb726d48Sopenharmony_ci      element.style.height = null;
302fb726d48Sopenharmony_ci      this.open = 'true';
303fb726d48Sopenharmony_ci    };
304fb726d48Sopenharmony_ci  }
305fb726d48Sopenharmony_ci
306fb726d48Sopenharmony_ci  //当 custom element从文档DOM中删除时,被调用。
307fb726d48Sopenharmony_ci  disconnectedCallback(): void {}
308fb726d48Sopenharmony_ci
309fb726d48Sopenharmony_ci  //当 custom element被移动到新的文档时,被调用。
310fb726d48Sopenharmony_ci  adoptedCallback(): void {}
311fb726d48Sopenharmony_ci
312fb726d48Sopenharmony_ci  //当 custom element增加、删除、修改自身属性时,被调用。
313fb726d48Sopenharmony_ci  attributeChangedCallback(name: string, oldValue: unknown, newValue: unknown): void {
314fb726d48Sopenharmony_ci    if (name === 'title') {
315fb726d48Sopenharmony_ci      //@ts-ignore
316fb726d48Sopenharmony_ci      this.shadowRoot!.querySelector('#title')!.textContent = newValue;
317fb726d48Sopenharmony_ci    } else if (name === 'icon-name') {
318fb726d48Sopenharmony_ci      if (this.iconElement) {
319fb726d48Sopenharmony_ci        if (newValue !== null && newValue !== '' && newValue !== 'null') {
320fb726d48Sopenharmony_ci          //@ts-ignore
321fb726d48Sopenharmony_ci          this.iconElement!.setAttribute('name', newValue);
322fb726d48Sopenharmony_ci          this.iconElement!.style.display = 'flex';
323fb726d48Sopenharmony_ci        } else {
324fb726d48Sopenharmony_ci          this.iconElement!.style.display = 'none';
325fb726d48Sopenharmony_ci        }
326fb726d48Sopenharmony_ci      }
327fb726d48Sopenharmony_ci    } else if (name === 'checkable') {
328fb726d48Sopenharmony_ci      if (this.checkboxElement) {
329fb726d48Sopenharmony_ci        if (newValue === 'true' && this._data!.disable !== true) {
330fb726d48Sopenharmony_ci          this.checkboxElement!.style.display = 'inline-block';
331fb726d48Sopenharmony_ci        } else {
332fb726d48Sopenharmony_ci          this.checkboxElement!.style.display = 'none';
333fb726d48Sopenharmony_ci        }
334fb726d48Sopenharmony_ci      }
335fb726d48Sopenharmony_ci    } else if (name === 'checked') {
336fb726d48Sopenharmony_ci      if (this.checkboxElement) {
337fb726d48Sopenharmony_ci        this.checkboxElement.checked = this.hasAttribute('checked');
338fb726d48Sopenharmony_ci      }
339fb726d48Sopenharmony_ci    }
340fb726d48Sopenharmony_ci    if (this.arrow) {
341fb726d48Sopenharmony_ci      this.checkboxElement!.style.display = 'none';
342fb726d48Sopenharmony_ci    }
343fb726d48Sopenharmony_ci  }
344fb726d48Sopenharmony_ci
345fb726d48Sopenharmony_ci  //在node top  top-right  bottom bottom-right 画线条
346fb726d48Sopenharmony_ci  drawLine(direction: string /*string[top|bottom|top-right|bottom-right]*/): void {
347fb726d48Sopenharmony_ci    let item = this.shadowRoot!.querySelector('#item');
348fb726d48Sopenharmony_ci    if (!item) {
349fb726d48Sopenharmony_ci      return;
350fb726d48Sopenharmony_ci    }
351fb726d48Sopenharmony_ci    item.removeAttribute('line-top');
352fb726d48Sopenharmony_ci    item.removeAttribute('line-top-right');
353fb726d48Sopenharmony_ci    item.removeAttribute('line-bottom');
354fb726d48Sopenharmony_ci    item.removeAttribute('line-bottom-right');
355fb726d48Sopenharmony_ci    switch (direction) {
356fb726d48Sopenharmony_ci      case 'top':
357fb726d48Sopenharmony_ci        item.setAttribute('line-top', '');
358fb726d48Sopenharmony_ci        break;
359fb726d48Sopenharmony_ci      case 'bottom':
360fb726d48Sopenharmony_ci        item.setAttribute('line-bottom', '');
361fb726d48Sopenharmony_ci        break;
362fb726d48Sopenharmony_ci      case 'top-right':
363fb726d48Sopenharmony_ci        item.setAttribute('line-top-right', '');
364fb726d48Sopenharmony_ci        break;
365fb726d48Sopenharmony_ci      case 'bottom-right':
366fb726d48Sopenharmony_ci        item.setAttribute('line-bottom-right', '');
367fb726d48Sopenharmony_ci        break;
368fb726d48Sopenharmony_ci    }
369fb726d48Sopenharmony_ci  }
370fb726d48Sopenharmony_ci}
371fb726d48Sopenharmony_ci
372fb726d48Sopenharmony_ciif (!customElements.get('lit-tree-node')) {
373fb726d48Sopenharmony_ci  customElements.define('lit-tree-node', LitTreeNode);
374fb726d48Sopenharmony_ci}
375