@contributte/datagrid 0.0.0-20250625-7fda2aa → 0.0.0-20250630-e270140

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,8 +15,7 @@ import type {
15
15
  SuccessEventDetail as BaseSuccessEventDetail,
16
16
  } from "../types";
17
17
  import { Datagrid } from "../datagrid";
18
- import { BeforeEvent, ErrorEvent, Payload as NajaPayload, SuccessEvent } from "naja/dist/Naja";
19
- import { InteractionEvent } from "naja/dist/core/UIHandler";
18
+ import { BeforeEvent, ErrorEvent, Payload as NajaPayload, SuccessEvent, InteractionEvent } from "naja";
20
19
 
21
20
  export interface BaseRequestParams extends AjaxBaseRequestParams, Request {
22
21
  url: string;
@@ -14,17 +14,16 @@ export class TomSelect implements Selectpicker {
14
14
  const Select = this.select ?? window()?.TomSelect ?? null;
15
15
 
16
16
  if (Select) {
17
- for (const element of elements) {
18
- // Check if TomSelect is already initialized on the element
19
- if (element.tomselect) {
20
- continue;
17
+ elements.forEach(element => {
18
+ if(element.hasAttribute('data-Tom-Initialised')){
19
+ return;
21
20
  }
21
+ element.setAttribute('data-Tom-Initialised','true');
22
22
 
23
23
  new Select(
24
24
  element as TomInput,
25
- typeof this.opts === "function" ? this.opts(element) : this.opts
26
- )
27
- }
25
+ typeof this.opts === "function" ? this.opts(element) : this.opts)
26
+ })
28
27
  }
29
28
  }
30
29
  }
@@ -0,0 +1,7 @@
1
+ declare module 'tom-select/dist/types/types' {
2
+ export type RecursivePartial<T> = {
3
+ [P in keyof T]?: RecursivePartial<T[P]>;
4
+ };
5
+ export type TomInput = HTMLInputElement | HTMLSelectElement;
6
+ export interface TomSettings { /* minimal needed interface */ }
7
+ }
@@ -15,12 +15,22 @@ export class TreeViewPlugin implements DatagridPlugin {
15
15
  if (childrenBlock.classList.contains('showed')) {
16
16
  childrenBlock.innerHTML = '';
17
17
  childrenBlock.classList.remove('showed');
18
- rowBlock.querySelector(`a.chevron`).style.transform = "rotate(0deg)";
18
+ if (rowBlock) {
19
+ const chevron = rowBlock.querySelector<HTMLAnchorElement>(`a.chevron`);
20
+ if (chevron) {
21
+ chevron.style.transform = "rotate(0deg)";
22
+ }
23
+ }
19
24
  return;
20
25
  }
21
26
 
22
27
  childrenBlock.classList.add('showed');
23
- rowBlock.querySelector(`a.chevron`).style.transform = "rotate(90deg)";
28
+ if (rowBlock) {
29
+ const chevron = rowBlock.querySelector<HTMLAnchorElement>(`a.chevron`);
30
+ if (chevron) {
31
+ chevron.style.transform = "rotate(90deg)";
32
+ }
33
+ }
24
34
  const snippets = payload.snippets;
25
35
  for (const snippetName in snippets) {
26
36
  const snippet = snippets[snippetName];