import type TomSelectCtor from 'tom-select'; import type { TomSettings } from 'tom-select/dist/esm/types/settings.js'; import type { RecursivePartial } from 'tom-select/dist/esm/types/core.js'; import { Component, BaseOptions, InitElements, MElement } from '../../src/component'; import { loadPeer } from '../../src/peer-loader'; import { FormSelect } from '../textfield/select'; export interface RemoteDataSpec { url: string; value: string; label: string; search?: string; dataKey?: string; } export interface TomSelectFieldOptions extends BaseOptions { remote?: RemoteDataSpec; settings?: RecursivePartial; } const _defaults: TomSelectFieldOptions = {}; function readRemoteSpec(el: HTMLSelectElement): RemoteDataSpec | undefined { const raw = el.dataset.selectRemote; if (!raw) return undefined; try { return JSON.parse(raw); } catch { return undefined; } } // @implement /Users/kzarshenas/Sites/CrazyProject/CrazyPHP/src/Front/Library/Utility/Form/Select.ts // Enhances an EXISTING native `