@je-es/client 0.2.4 → 0.2.5

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.
package/dist/main.d.ts CHANGED
@@ -125,6 +125,9 @@ interface I18nConfig {
125
125
  supportedLanguages?: LanguageCode[];
126
126
  staticPath?: string;
127
127
  }
128
+ interface FAConfig {
129
+ theme?: 'solid' | 'regular' | 'light' | 'thin' | 'duotone' | 'brands' | 'sharp-solid' | 'sharp-regular' | 'sharp-light' | 'sharp-thin' | 'sharp-duotone-solid' | 'sharp-duotone-regular' | 'sharp-duotone-light' | 'sharp-duotone-thin' | 'notdog' | 'notdog-duo' | 'jelly' | 'jelly-fill' | 'jelly-duo' | 'chisel' | 'etch' | 'slab' | 'slab-press' | 'thumbprint' | 'utility' | 'utility-fill' | 'utility-duo' | 'whiteboard';
130
+ }
128
131
  interface ClientConfig {
129
132
  build?: BuildConfig;
130
133
  app?: AppConfig;
@@ -133,6 +136,7 @@ interface ClientConfig {
133
136
  router?: RouterConfig;
134
137
  api?: ApiConfig;
135
138
  devTools?: DevToolsConfig;
139
+ fa?: FAConfig;
136
140
  }
137
141
  interface Route {
138
142
  path: string;
@@ -183,13 +187,17 @@ interface FieldButtonConfig {
183
187
  type: 'rules' | 'togglePassword' | 'custom';
184
188
  icon?: string;
185
189
  label?: string;
186
- tooltip?: string;
190
+ title?: string;
187
191
  onClick?: () => void | Promise<void>;
188
192
  }
193
+ interface LabelConfig {
194
+ text?: string;
195
+ icon?: string;
196
+ title?: string;
197
+ }
189
198
  interface FormFieldConfig {
190
199
  name: string;
191
- label?: string;
192
- icon?: string;
200
+ label?: string | LabelConfig;
193
201
  type?: string;
194
202
  placeholder?: string;
195
203
  value?: unknown;
@@ -742,253 +750,606 @@ declare class StyleManager {
742
750
  */
743
751
  declare function css(strings: TemplateStringsArray, ...values: (string | number | boolean | null | undefined)[]): string;
744
752
 
745
- declare const ClassMaker: {
753
+ interface ButtonConfig {
754
+ label?: string;
755
+ className?: string;
756
+ icon?: string;
757
+ title?: string;
758
+ loadingLabel?: string;
759
+ onClick?: 'submit' | (() => void | Promise<void>);
760
+ }
761
+ interface FormConfig {
762
+ fields: (FormFieldConfig | (FormFieldConfig | VNode)[])[];
763
+ endpoint?: string;
764
+ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
765
+ onSubmit?: (data: Record<string, unknown>, event: Event) => void | Promise<void>;
766
+ onSuccess?: (data: unknown) => void;
767
+ onError?: (error: unknown) => void;
768
+ onValidationError?: (errors: Record<string, string>) => void;
769
+ buttons?: Record<string, ButtonConfig>;
770
+ className?: string;
771
+ autoValidate?: boolean;
772
+ }
773
+ interface FormField extends FormFieldConfig {
774
+ error?: string;
775
+ touched?: boolean;
776
+ }
777
+ /**
778
+ * SmartForm Component
779
+ * Auto-validation, CSRF protection, API submission
780
+ */
781
+ declare class SmartFormComponent extends Component<FormConfig> {
782
+ fields: FormField[];
783
+ formData: Record<string, unknown>;
784
+ isSubmitting: boolean;
785
+ submitError: string;
786
+ submitSuccess: boolean;
787
+ passwordVisibility: Record<string, boolean>;
788
+ constructor(props: FormConfig);
789
+ onMount(): void;
746
790
  /**
747
- * Generate Font Awesome icon classes
748
- * @param icon Icon name (without 'fa-' prefix)
749
- * @param style Font Awesome style (default: 'solid')
791
+ * Handle field change
750
792
  */
751
- fa: (icon: string, style?: "solid" | "regular" | "light" | "thin" | "duotone" | "brands" | "sharp-solid" | "sharp-regular" | "sharp-light" | "sharp-thin" | "sharp-duotone-solid" | "sharp-duotone-regular" | "sharp-duotone-light" | "sharp-duotone-thin" | "notdog" | "notdog-duo" | "jelly" | "jelly-fill" | "jelly-duo" | "chisel" | "etch" | "slab" | "slab-press" | "thumbprint" | "utility" | "utility-fill" | "utility-duo" | "whiteboard") => string;
793
+ handleChange(fieldName: string, value: unknown): void;
752
794
  /**
753
- * Generate button classes
754
- * @param level Button level (primary, secondary, tertiary)
755
- * @param className Additional classes
795
+ * Handle field blur
756
796
  */
757
- btn: (level: "primary" | "secondary" | "tertiary", className?: string) => string;
758
- };
759
- declare const CM: {
797
+ handleBlur(fieldName: string): void;
760
798
  /**
761
- * Generate Font Awesome icon classes
762
- * @param icon Icon name (without 'fa-' prefix)
763
- * @param style Font Awesome style (default: 'solid')
799
+ * Validate single field
764
800
  */
765
- fa: (icon: string, style?: "solid" | "regular" | "light" | "thin" | "duotone" | "brands" | "sharp-solid" | "sharp-regular" | "sharp-light" | "sharp-thin" | "sharp-duotone-solid" | "sharp-duotone-regular" | "sharp-duotone-light" | "sharp-duotone-thin" | "notdog" | "notdog-duo" | "jelly" | "jelly-fill" | "jelly-duo" | "chisel" | "etch" | "slab" | "slab-press" | "thumbprint" | "utility" | "utility-fill" | "utility-duo" | "whiteboard") => string;
801
+ validateField(field: FormField, value: unknown): string | undefined;
766
802
  /**
767
- * Generate button classes
768
- * @param level Button level (primary, secondary, tertiary)
769
- * @param className Additional classes
803
+ * Validate all fields
770
804
  */
771
- btn: (level: "primary" | "secondary" | "tertiary", className?: string) => string;
772
- };
773
- declare const ElementCreator: {
774
- div: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
775
- span: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
776
- h1: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
777
- h2: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
778
- h3: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
779
- h4: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
780
- h5: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
781
- h6: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
782
- p: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
783
- i: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
784
- img: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
785
- a: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
786
- button: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
787
- input: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
788
- select: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
789
- option: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
790
- textarea: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
791
- form: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
805
+ validateForm(): boolean;
792
806
  /**
793
- * Create icon element with Font Awesome classes
794
- * @param icon Icon name (without 'fa-' prefix)
795
- * @param style Font Awesome style (default: 'solid')
807
+ * Handle form submission
796
808
  */
797
- icon: (icon: string, style?: "solid" | "regular" | "light" | "thin" | "duotone" | "brands" | "sharp-solid" | "sharp-regular" | "sharp-light" | "sharp-thin" | "sharp-duotone-solid" | "sharp-duotone-regular" | "sharp-duotone-light" | "sharp-duotone-thin" | "notdog" | "notdog-duo" | "jelly" | "jelly-fill" | "jelly-duo" | "chisel" | "etch" | "slab" | "slab-press" | "thumbprint" | "utility" | "utility-fill" | "utility-duo" | "whiteboard") => VNode;
809
+ handleSubmit(event: Event): Promise<void>;
798
810
  /**
799
- * Create button element
811
+ * Render label with optional icon
800
812
  */
801
- btn: (args: {
802
- label: string;
803
- onClick?: () => void | Promise<void>;
804
- className?: string;
805
- icon?: string;
806
- iconStyle?: "solid" | "regular" | "light" | "thin" | "duotone" | "brands" | "sharp-solid" | "sharp-regular" | "sharp-light" | "sharp-thin" | "sharp-duotone-solid" | "sharp-duotone-regular" | "sharp-duotone-light" | "sharp-duotone-thin" | "notdog" | "notdog-duo" | "jelly" | "jelly-fill" | "jelly-duo" | "chisel" | "etch" | "slab" | "slab-press" | "thumbprint" | "utility" | "utility-fill" | "utility-duo" | "whiteboard";
807
- level?: "primary" | "secondary" | "tertiary";
808
- disabled?: boolean;
809
- }) => VNode;
810
- };
811
- declare const EC: {
812
- div: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
813
- span: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
814
- h1: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
815
- h2: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
816
- h3: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
817
- h4: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
818
- h5: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
819
- h6: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
820
- p: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
821
- i: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
822
- img: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
823
- a: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
824
- button: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
825
- input: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
826
- select: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
827
- option: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
828
- textarea: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
829
- form: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
813
+ renderLabel(field: FormField): VNode | string;
830
814
  /**
831
- * Create icon element with Font Awesome classes
832
- * @param icon Icon name (without 'fa-' prefix)
833
- * @param style Font Awesome style (default: 'solid')
815
+ * Get field buttons configuration
834
816
  */
835
- icon: (icon: string, style?: "solid" | "regular" | "light" | "thin" | "duotone" | "brands" | "sharp-solid" | "sharp-regular" | "sharp-light" | "sharp-thin" | "sharp-duotone-solid" | "sharp-duotone-regular" | "sharp-duotone-light" | "sharp-duotone-thin" | "notdog" | "notdog-duo" | "jelly" | "jelly-fill" | "jelly-duo" | "chisel" | "etch" | "slab" | "slab-press" | "thumbprint" | "utility" | "utility-fill" | "utility-duo" | "whiteboard") => VNode;
817
+ getFieldButtons(field: FormField): FieldButtonConfig[];
836
818
  /**
837
- * Create button element
819
+ * Handle field button click
838
820
  */
839
- btn: (args: {
840
- label: string;
841
- onClick?: () => void | Promise<void>;
842
- className?: string;
843
- icon?: string;
844
- iconStyle?: "solid" | "regular" | "light" | "thin" | "duotone" | "brands" | "sharp-solid" | "sharp-regular" | "sharp-light" | "sharp-thin" | "sharp-duotone-solid" | "sharp-duotone-regular" | "sharp-duotone-light" | "sharp-duotone-thin" | "notdog" | "notdog-duo" | "jelly" | "jelly-fill" | "jelly-duo" | "chisel" | "etch" | "slab" | "slab-press" | "thumbprint" | "utility" | "utility-fill" | "utility-duo" | "whiteboard";
845
- level?: "primary" | "secondary" | "tertiary";
846
- disabled?: boolean;
847
- }) => VNode;
848
- };
849
-
850
- declare class I18nManager {
851
- private translations;
852
- private currentLanguage;
853
- private defaultLanguage;
854
- private supportedLanguages;
855
- private cachePath;
856
- private readyListeners;
857
- constructor(config?: I18nConfig);
821
+ handleFieldButton(field: FormField, buttonType: string): void;
858
822
  /**
859
- * Load translations for a specific language
860
- * @param lang Language code (e.g., 'en', 'ar', 'fr')
861
- * @param translations Translation object (can be nested)
823
+ * Render validation rules popup
862
824
  */
863
- loadLanguage(lang: LanguageCode, translations: Record<string, any>): void;
825
+ renderValidationRules(field: FormField): VNode | string;
864
826
  /**
865
- * Flatten nested object into dot notation
866
- * @param obj Nested object
867
- * @param prefix Current prefix
868
- * @returns Flattened object with dot notation keys
827
+ * Render field input buttons
869
828
  */
870
- private flattenObject;
829
+ renderFieldButtons(field: FormField): VNode | string;
871
830
  /**
872
- * Load all translations from static files
873
- * @param translations Object with language codes as keys and translation objects as values
831
+ * Render form field
874
832
  */
875
- loadTranslations(translations: TranslationSet): void;
833
+ renderField(field: FormField): VNode;
876
834
  /**
877
- * Set the current language
878
- * @param lang Language code
835
+ * Render buttons section
879
836
  */
880
- setLanguage(lang: LanguageCode): void;
837
+ renderButtons(): VNode;
838
+ render(): VNode;
839
+ styles(): string;
840
+ }
841
+ /**
842
+ * SmartForm helper function
843
+ */
844
+ declare function SmartForm(config: FormConfig): VNode;
845
+
846
+ type PopupType = 'confirm' | 'alert' | 'form' | 'custom' | 'prompt';
847
+ type PopupVariant = 'default' | 'danger' | 'warning' | 'success' | 'info';
848
+ type PopupSize = 'small' | 'medium' | 'large' | 'xlarge' | 'fullscreen';
849
+ interface PopupButton {
850
+ label: string;
851
+ translateKey?: string;
852
+ variant?: 'primary' | 'secondary' | 'danger' | 'success';
853
+ icon?: string;
854
+ onClick: () => void | Promise<void>;
855
+ loading?: boolean;
856
+ }
857
+ interface PopupFormOptions {
858
+ title: string;
859
+ titleTranslateKey?: string;
860
+ description?: string;
861
+ descriptionTranslateKey?: string;
862
+ formConfig: FormConfig;
863
+ variant?: PopupVariant;
864
+ icon?: string;
865
+ size?: PopupSize;
866
+ closeOnOverlay?: boolean;
867
+ closeOnEscape?: boolean;
868
+ showCloseButton?: boolean;
869
+ }
870
+ interface PopupOptions {
871
+ title: string;
872
+ titleTranslateKey?: string;
873
+ message?: string;
874
+ messageTranslateKey?: string;
875
+ description?: string;
876
+ descriptionTranslateKey?: string;
877
+ type?: PopupType;
878
+ variant?: PopupVariant;
879
+ size?: PopupSize;
880
+ buttons?: PopupButton[];
881
+ customContent?: VNode;
882
+ formConfig?: FormConfig;
883
+ closeOnOverlay?: boolean;
884
+ closeOnEscape?: boolean;
885
+ showCloseButton?: boolean;
886
+ icon?: string;
887
+ onConfirm?: () => void | Promise<void>;
888
+ onCancel?: () => void | Promise<void>;
889
+ }
890
+ interface ActivePopup extends PopupOptions {
891
+ id: number;
892
+ resolve?: (value: boolean | string | null | Record<string, unknown>) => void;
893
+ inputValue?: string;
894
+ isSubmitting?: boolean;
895
+ }
896
+ declare class Popup extends Component {
897
+ popups: ActivePopup[];
898
+ private nextId;
899
+ private handleEscapeKey?;
900
+ onMount(): Promise<void>;
901
+ onUnmount(): void;
902
+ render(): VNode;
903
+ renderPopup(popup: ActivePopup): VNode;
881
904
  /**
882
- * Get the current language
905
+ * Show a custom popup
883
906
  */
884
- getLanguage(): LanguageCode;
907
+ show(options: PopupOptions): Promise<boolean | string | null | Record<string, unknown>>;
885
908
  /**
886
- * Get all supported languages
909
+ * Show a form popup
887
910
  */
888
- getSupportedLanguages(): LanguageCode[];
911
+ showForm(options: PopupFormOptions): Promise<boolean | string | null | Record<string, unknown>>;
889
912
  /**
890
- * Translate a key with smart parameter replacement
891
- * Supports nested translation keys as parameter values
892
- *
893
- * @example
894
- * // Simple translation
895
- * t('button.login') // => "Login" or "دخـول" depending on current language
896
- *
897
- * @example
898
- * // With parameters
899
- * t('nav.credits', { count: '100' })
900
- * // => "Available Credits: 100"
901
- *
902
- * @example
903
- * // With nested translation keys as parameters
904
- * t('language.switching_to', { language: 'button.login' })
905
- * // => "Switching to Login..."
906
- *
907
- * @param key Translation key (supports dot notation for nested keys)
908
- * @param params Optional parameters for replacement
909
- * @param defaultValue Optional default translation key
910
- * @returns Translated string with replaced parameters
913
+ * Show a confirmation dialog
911
914
  */
912
- t(key: string, params?: Record<string, string>, defaultValue?: string): string;
913
- private getTranslation;
915
+ confirm(options: {
916
+ title: string;
917
+ titleTranslateKey?: string;
918
+ message: string;
919
+ messageTranslateKey?: string;
920
+ confirmLabel?: string;
921
+ confirmTranslateKey?: string;
922
+ cancelLabel?: string;
923
+ cancelTranslateKey?: string;
924
+ variant?: PopupVariant;
925
+ icon?: string;
926
+ size?: PopupSize;
927
+ onConfirm?: () => void | Promise<void>;
928
+ onCancel?: () => void | Promise<void>;
929
+ }): Promise<boolean>;
914
930
  /**
915
- * Translate with a specific language (overrides current language temporarily)
916
- *
917
- * @param key Translation key
918
- * @param lang Language code
919
- * @param params Optional parameters
920
- * @returns Translated string
931
+ * Show an alert dialog
921
932
  */
922
- tLang(key: string, lang: LanguageCode, params?: Record<string, string>): string;
933
+ alert(options: {
934
+ title: string;
935
+ titleTranslateKey?: string;
936
+ message: string;
937
+ messageTranslateKey?: string;
938
+ okLabel?: string;
939
+ okTranslateKey?: string;
940
+ variant?: PopupVariant;
941
+ icon?: string;
942
+ size?: PopupSize;
943
+ onConfirm?: () => void | Promise<void>;
944
+ }): Promise<boolean>;
923
945
  /**
924
- * Translate a key and convert HTML tags in the translation to VNode elements
925
- * Supports tags like <br>, <strong>, <em>, <b>, <i>, etc.
926
- * Useful for multiline translations with formatting
927
- *
928
- * @example
929
- * // Translation: "Hello <br> World"
930
- * tHtml('page.home.title') // => [text node, br element, text node]
931
- *
932
- * @param key Translation key
933
- * @param params Optional parameters for replacement
934
- * @param defaultValue Optional default translation key
935
- * @returns Array of VNode and string elements that can be used as children
946
+ * Show a prompt dialog
936
947
  */
937
- tHtml(key: string, params?: Record<string, string>, defaultValue?: string): (VNode | string)[];
948
+ prompt(options: {
949
+ title: string;
950
+ titleTranslateKey?: string;
951
+ message: string;
952
+ messageTranslateKey?: string;
953
+ defaultValue?: string;
954
+ confirmLabel?: string;
955
+ confirmTranslateKey?: string;
956
+ cancelLabel?: string;
957
+ cancelTranslateKey?: string;
958
+ icon?: string;
959
+ onConfirm?: (value: string) => void | Promise<void>;
960
+ onCancel?: () => void | Promise<void>;
961
+ }): Promise<string | null>;
938
962
  /**
939
- * Parse HTML string into VNode and text elements
940
- * Converts \n and /n sequences to <br> tags
941
- * @private
963
+ * Close a specific popup
942
964
  */
943
- private parseHtmlString;
965
+ closePopup(id: number, result: boolean | string | null | Record<string, unknown>): void;
944
966
  /**
945
- * Get all translations for current language
967
+ * Close all popups
946
968
  */
947
- getTranslations(): Record<string, string>;
969
+ closeAll(): void;
970
+ private applyBodyLock;
971
+ private removeBodyLock;
972
+ private setupKeyboardListener;
973
+ }
974
+ declare function initPopup(container?: HTMLElement): Popup;
975
+ declare function getPopup$1(): Popup;
976
+ declare const popup: {
977
+ show: (options: PopupOptions) => Promise<string | boolean | Record<string, unknown> | null>;
978
+ confirm: (options: Parameters<Popup["confirm"]>[0]) => Promise<boolean>;
979
+ alert: (options: Parameters<Popup["alert"]>[0]) => Promise<boolean>;
980
+ prompt: (options: {
981
+ title: string;
982
+ titleTranslateKey?: string;
983
+ message: string;
984
+ icon?: string;
985
+ messageTranslateKey?: string;
986
+ onConfirm?: () => void | Promise<void>;
987
+ }) => Promise<string | null>;
988
+ showForm: (options: PopupFormOptions) => Promise<string | boolean | Record<string, unknown> | null>;
989
+ closePopup: (id: number, result: boolean | string | null | Record<string, unknown>) => void;
990
+ closeLastPopup: () => void;
991
+ closeFirstPopup: () => void;
992
+ closeAll: () => void;
993
+ };
994
+
995
+ type ToastType = 'success' | 'error' | 'info' | 'warning';
996
+ interface ToastMessage {
997
+ id: number;
998
+ message: string;
999
+ type: ToastType;
1000
+ translateKey?: string;
1001
+ }
1002
+ declare class Toast extends Component {
1003
+ messages: ToastMessage[];
1004
+ private nextId;
948
1005
  /**
949
- * Check if a translation key exists
950
- * @param key Translation key
951
- * @returns true if key exists in current or default language
1006
+ * Show a toast notification
952
1007
  */
953
- hasKey(key: string): boolean;
1008
+ show(message: string, type?: ToastType, duration?: number, translateKey?: string): void;
954
1009
  /**
955
- * Create a reactive translation function that listens to language changes
956
- * @param updateCallback Callback function to execute when language changes
957
- * @returns Function to unsubscribe from language changes
1010
+ * Convenience methods
958
1011
  */
959
- createTranslator(updateCallback: () => void): () => void;
1012
+ success(message: string, duration?: number, translateKey?: string): void;
1013
+ error(message: string, duration?: number, translateKey?: string): void;
1014
+ info(message: string, duration?: number, translateKey?: string): void;
1015
+ warning(message: string, duration?: number, translateKey?: string): void;
1016
+ render(): VNode;
1017
+ renderToast(msg: ToastMessage): VNode;
1018
+ }
1019
+ declare function initToast(container?: HTMLElement): Toast;
1020
+ declare function getToast$1(): Toast;
1021
+ declare const toast: {
1022
+ show: (message: string, type?: ToastType, duration?: number, translateKey?: string) => void;
1023
+ success: (message: string, duration?: number, translateKey?: string) => void;
1024
+ error: (message: string, duration?: number, translateKey?: string) => void;
1025
+ info: (message: string, duration?: number, translateKey?: string) => void;
1026
+ warning: (message: string, duration?: number, translateKey?: string) => void;
1027
+ };
1028
+
1029
+ type LoaderSize = 'small' | 'medium' | 'large';
1030
+ type LoaderVariant = 'spinner' | 'dots' | 'pulse';
1031
+ interface LoaderOptions {
1032
+ message?: string;
1033
+ variant?: LoaderVariant;
1034
+ size?: LoaderSize;
1035
+ overlay?: boolean;
1036
+ }
1037
+ declare class Loader extends Component {
1038
+ visible: boolean;
1039
+ message: string;
1040
+ variant: LoaderVariant;
1041
+ size: LoaderSize;
1042
+ overlay: boolean;
1043
+ progress: number;
1044
+ showProgress: boolean;
1045
+ private animationFrame;
1046
+ private hideTimeout;
1047
+ onMount(): Promise<void>;
1048
+ onUnmount(): void;
1049
+ render(): VNode;
1050
+ renderSpinner(): VNode;
1051
+ renderMessage(): VNode;
1052
+ renderProgressBar(): VNode;
1053
+ show(options?: LoaderOptions | string): void;
1054
+ hide(delay?: number): void;
1055
+ setMessage(message: string): void;
1056
+ setProgress(progress: number): void;
1057
+ updateProgress(increment: number): void;
1058
+ private performHide;
1059
+ private applyBodyLock;
1060
+ private removeBodyLock;
1061
+ private setupKeyboardListener;
1062
+ private handleKeyPress;
1063
+ private initializeAccessibility;
1064
+ isVisible(): boolean;
1065
+ getStatus(): {
1066
+ visible: boolean;
1067
+ message: string;
1068
+ progress: number;
1069
+ };
1070
+ }
1071
+
1072
+ declare const ClassMaker: {
960
1073
  /**
961
- * Load translations from URL(s)
962
- * Supports patterns like '/static/i18n/*.json' or specific URLs
963
- *
964
- * @example
965
- * // Load from a pattern
966
- * await loadFromUrl('/static/i18n/*.json');
967
- *
968
- * @example
969
- * // Load specific language files
970
- * await loadFromUrl(['/static/i18n/en.json', '/static/i18n/ar.json']);
971
- *
972
- * @param urlPattern String pattern or array of URLs
973
- * @returns Promise that resolves when all translations are loaded
1074
+ * Generate Font Awesome icon classes
1075
+ * @param icon Icon name (without 'fa-' prefix)
1076
+ * @param style Font Awesome style (default: global default theme or 'solid')
974
1077
  */
975
- loadFromUrl(urlPattern: string | string[]): Promise<void>;
1078
+ fa: (icon: string, style?: "solid" | "regular" | "light" | "thin" | "duotone" | "brands" | "sharp-solid" | "sharp-regular" | "sharp-light" | "sharp-thin" | "sharp-duotone-solid" | "sharp-duotone-regular" | "sharp-duotone-light" | "sharp-duotone-thin" | "notdog" | "notdog-duo" | "jelly" | "jelly-fill" | "jelly-duo" | "chisel" | "etch" | "slab" | "slab-press" | "thumbprint" | "utility" | "utility-fill" | "utility-duo" | "whiteboard") => string;
976
1079
  /**
977
- * Register a callback for when i18n is ready
1080
+ * Generate button classes
1081
+ * @param level Button level (primary, secondary, tertiary)
1082
+ * @param className Additional classes
978
1083
  */
979
- onReady(callback: () => void): void;
1084
+ btn: (level: "primary" | "secondary" | "tertiary", className?: string) => string;
1085
+ };
1086
+ declare const CM: {
980
1087
  /**
981
- * Notify all listeners that i18n is ready
1088
+ * Generate Font Awesome icon classes
1089
+ * @param icon Icon name (without 'fa-' prefix)
1090
+ * @param style Font Awesome style (default: global default theme or 'solid')
982
1091
  */
983
- private notifyReady;
1092
+ fa: (icon: string, style?: "solid" | "regular" | "light" | "thin" | "duotone" | "brands" | "sharp-solid" | "sharp-regular" | "sharp-light" | "sharp-thin" | "sharp-duotone-solid" | "sharp-duotone-regular" | "sharp-duotone-light" | "sharp-duotone-thin" | "notdog" | "notdog-duo" | "jelly" | "jelly-fill" | "jelly-duo" | "chisel" | "etch" | "slab" | "slab-press" | "thumbprint" | "utility" | "utility-fill" | "utility-duo" | "whiteboard") => string;
984
1093
  /**
985
- * Get language from localStorage
1094
+ * Generate button classes
1095
+ * @param level Button level (primary, secondary, tertiary)
1096
+ * @param className Additional classes
986
1097
  */
987
- private getStoredLanguage;
1098
+ btn: (level: "primary" | "secondary" | "tertiary", className?: string) => string;
1099
+ };
1100
+ declare const ElementCreator: {
1101
+ div: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1102
+ span: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1103
+ h1: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1104
+ h2: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1105
+ h3: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1106
+ h4: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1107
+ h5: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1108
+ h6: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1109
+ p: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1110
+ i: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1111
+ img: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1112
+ a: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1113
+ button: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1114
+ input: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1115
+ select: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1116
+ option: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1117
+ textarea: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1118
+ form: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
988
1119
  /**
989
- * Store language in localStorage
990
- */
991
- private storeLanguage;
1120
+ * Create icon element with Font Awesome classes
1121
+ * @param icon Icon name (without 'fa-' prefix)
1122
+ * @param style Font Awesome style (default: 'solid')
1123
+ */
1124
+ icon: (icon: string, style?: "solid" | "regular" | "light" | "thin" | "duotone" | "brands" | "sharp-solid" | "sharp-regular" | "sharp-light" | "sharp-thin" | "sharp-duotone-solid" | "sharp-duotone-regular" | "sharp-duotone-light" | "sharp-duotone-thin" | "notdog" | "notdog-duo" | "jelly" | "jelly-fill" | "jelly-duo" | "chisel" | "etch" | "slab" | "slab-press" | "thumbprint" | "utility" | "utility-fill" | "utility-duo" | "whiteboard") => VNode;
1125
+ /**
1126
+ * Create button element
1127
+ */
1128
+ btn: (args: {
1129
+ label: string;
1130
+ onClick?: () => void | Promise<void>;
1131
+ className?: string;
1132
+ icon?: string;
1133
+ iconStyle?: "solid" | "regular" | "light" | "thin" | "duotone" | "brands" | "sharp-solid" | "sharp-regular" | "sharp-light" | "sharp-thin" | "sharp-duotone-solid" | "sharp-duotone-regular" | "sharp-duotone-light" | "sharp-duotone-thin" | "notdog" | "notdog-duo" | "jelly" | "jelly-fill" | "jelly-duo" | "chisel" | "etch" | "slab" | "slab-press" | "thumbprint" | "utility" | "utility-fill" | "utility-duo" | "whiteboard";
1134
+ level?: "primary" | "secondary" | "tertiary";
1135
+ disabled?: boolean;
1136
+ }) => VNode;
1137
+ };
1138
+ declare const EC: {
1139
+ div: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1140
+ span: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1141
+ h1: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1142
+ h2: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1143
+ h3: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1144
+ h4: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1145
+ h5: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1146
+ h6: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1147
+ p: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1148
+ i: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1149
+ img: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1150
+ a: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1151
+ button: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1152
+ input: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1153
+ select: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1154
+ option: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1155
+ textarea: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1156
+ form: (props?: _je_es_vdom.VNodeProps | string | null | undefined, ...children: _je_es_vdom.VNodeChildren[]) => VNode;
1157
+ /**
1158
+ * Create icon element with Font Awesome classes
1159
+ * @param icon Icon name (without 'fa-' prefix)
1160
+ * @param style Font Awesome style (default: 'solid')
1161
+ */
1162
+ icon: (icon: string, style?: "solid" | "regular" | "light" | "thin" | "duotone" | "brands" | "sharp-solid" | "sharp-regular" | "sharp-light" | "sharp-thin" | "sharp-duotone-solid" | "sharp-duotone-regular" | "sharp-duotone-light" | "sharp-duotone-thin" | "notdog" | "notdog-duo" | "jelly" | "jelly-fill" | "jelly-duo" | "chisel" | "etch" | "slab" | "slab-press" | "thumbprint" | "utility" | "utility-fill" | "utility-duo" | "whiteboard") => VNode;
1163
+ /**
1164
+ * Create button element
1165
+ */
1166
+ btn: (args: {
1167
+ label: string;
1168
+ onClick?: () => void | Promise<void>;
1169
+ className?: string;
1170
+ icon?: string;
1171
+ iconStyle?: "solid" | "regular" | "light" | "thin" | "duotone" | "brands" | "sharp-solid" | "sharp-regular" | "sharp-light" | "sharp-thin" | "sharp-duotone-solid" | "sharp-duotone-regular" | "sharp-duotone-light" | "sharp-duotone-thin" | "notdog" | "notdog-duo" | "jelly" | "jelly-fill" | "jelly-duo" | "chisel" | "etch" | "slab" | "slab-press" | "thumbprint" | "utility" | "utility-fill" | "utility-duo" | "whiteboard";
1172
+ level?: "primary" | "secondary" | "tertiary";
1173
+ disabled?: boolean;
1174
+ }) => VNode;
1175
+ };
1176
+ declare class EventsManager {
1177
+ private _handlers;
1178
+ constructor();
1179
+ add(event: string, listener: EventListener): void;
1180
+ remove(event: string, listener: EventListener): void;
1181
+ removeAll(event?: string): void;
1182
+ get(event: string): Set<EventListener> | undefined;
1183
+ has(event: string): boolean;
1184
+ count(event?: string): number;
1185
+ }
1186
+ declare function getToast(): Toast;
1187
+ declare function getPopup(): Popup;
1188
+ declare function getLoader(): Loader;
1189
+ declare function hideLoader(): void;
1190
+ declare function showLoader(message?: string): void;
1191
+ declare const Window$1: {
1192
+ Events: EventsManager;
1193
+ toast: typeof getToast;
1194
+ popup: typeof getPopup;
1195
+ loader: typeof getLoader;
1196
+ showLoader: typeof showLoader;
1197
+ hideLoader: typeof hideLoader;
1198
+ reload: () => void;
1199
+ getPathName: () => string;
1200
+ setAttributes: (key: string, value: string) => void;
1201
+ getAttributes: (key: string) => string | null;
1202
+ setLocalStorage: (key: string, value: string) => void;
1203
+ getLocalStorage: (key: string) => string | null;
1204
+ addEventListener: (event: string, listener: EventListener) => void;
1205
+ removeEventListener: (event: string, listener: EventListener) => void;
1206
+ dispatchEvent: (event: CustomEvent) => void;
1207
+ onScroll: (callback: () => void) => void;
1208
+ getScrollY: () => number;
1209
+ };
1210
+
1211
+ declare class I18nManager {
1212
+ private translations;
1213
+ private currentLanguage;
1214
+ private defaultLanguage;
1215
+ private supportedLanguages;
1216
+ private cachePath;
1217
+ private readyListeners;
1218
+ constructor(config?: I18nConfig);
1219
+ /**
1220
+ * Load translations for a specific language
1221
+ * @param lang Language code (e.g., 'en', 'ar', 'fr')
1222
+ * @param translations Translation object (can be nested)
1223
+ */
1224
+ loadLanguage(lang: LanguageCode, translations: Record<string, any>): void;
1225
+ /**
1226
+ * Flatten nested object into dot notation
1227
+ * @param obj Nested object
1228
+ * @param prefix Current prefix
1229
+ * @returns Flattened object with dot notation keys
1230
+ */
1231
+ private flattenObject;
1232
+ /**
1233
+ * Load all translations from static files
1234
+ * @param translations Object with language codes as keys and translation objects as values
1235
+ */
1236
+ loadTranslations(translations: TranslationSet): void;
1237
+ /**
1238
+ * Set the current language
1239
+ * @param lang Language code
1240
+ */
1241
+ setLanguage(lang: LanguageCode): void;
1242
+ /**
1243
+ * Get the current language
1244
+ */
1245
+ getLanguage(): LanguageCode;
1246
+ /**
1247
+ * Get all supported languages
1248
+ */
1249
+ getSupportedLanguages(): LanguageCode[];
1250
+ /**
1251
+ * Translate a key with smart parameter replacement
1252
+ * Supports nested translation keys as parameter values
1253
+ *
1254
+ * @example
1255
+ * // Simple translation
1256
+ * t('button.login') // => "Login" or "دخـول" depending on current language
1257
+ *
1258
+ * @example
1259
+ * // With parameters
1260
+ * t('nav.credits', { count: '100' })
1261
+ * // => "Available Credits: 100"
1262
+ *
1263
+ * @example
1264
+ * // With nested translation keys as parameters
1265
+ * t('language.switching_to', { language: 'button.login' })
1266
+ * // => "Switching to Login..."
1267
+ *
1268
+ * @param key Translation key (supports dot notation for nested keys)
1269
+ * @param params Optional parameters for replacement
1270
+ * @param defaultValue Optional default translation key
1271
+ * @returns Translated string with replaced parameters
1272
+ */
1273
+ t(key: string, params?: Record<string, string>, defaultValue?: string): string;
1274
+ private getTranslation;
1275
+ /**
1276
+ * Translate with a specific language (overrides current language temporarily)
1277
+ *
1278
+ * @param key Translation key
1279
+ * @param lang Language code
1280
+ * @param params Optional parameters
1281
+ * @returns Translated string
1282
+ */
1283
+ tLang(key: string, lang: LanguageCode, params?: Record<string, string>): string;
1284
+ /**
1285
+ * Translate a key and convert HTML tags in the translation to VNode elements
1286
+ * Supports tags like <br>, <strong>, <em>, <b>, <i>, etc.
1287
+ * Useful for multiline translations with formatting
1288
+ *
1289
+ * @example
1290
+ * // Translation: "Hello <br> World"
1291
+ * tHtml('page.home.title') // => [text node, br element, text node]
1292
+ *
1293
+ * @param key Translation key
1294
+ * @param params Optional parameters for replacement
1295
+ * @param defaultValue Optional default translation key
1296
+ * @returns Array of VNode and string elements that can be used as children
1297
+ */
1298
+ tHtml(key: string, params?: Record<string, string>, defaultValue?: string): (VNode | string)[];
1299
+ /**
1300
+ * Parse HTML string into VNode and text elements
1301
+ * Converts \n and /n sequences to <br> tags
1302
+ * @private
1303
+ */
1304
+ private parseHtmlString;
1305
+ /**
1306
+ * Get all translations for current language
1307
+ */
1308
+ getTranslations(): Record<string, string>;
1309
+ /**
1310
+ * Check if a translation key exists
1311
+ * @param key Translation key
1312
+ * @returns true if key exists in current or default language
1313
+ */
1314
+ hasKey(key: string): boolean;
1315
+ /**
1316
+ * Create a reactive translation function that listens to language changes
1317
+ * @param updateCallback Callback function to execute when language changes
1318
+ * @returns Function to unsubscribe from language changes
1319
+ */
1320
+ createTranslator(updateCallback: () => void): () => void;
1321
+ /**
1322
+ * Load translations from URL(s)
1323
+ * Supports patterns like '/static/i18n/*.json' or specific URLs
1324
+ *
1325
+ * @example
1326
+ * // Load from a pattern
1327
+ * await loadFromUrl('/static/i18n/*.json');
1328
+ *
1329
+ * @example
1330
+ * // Load specific language files
1331
+ * await loadFromUrl(['/static/i18n/en.json', '/static/i18n/ar.json']);
1332
+ *
1333
+ * @param urlPattern String pattern or array of URLs
1334
+ * @returns Promise that resolves when all translations are loaded
1335
+ */
1336
+ loadFromUrl(urlPattern: string | string[]): Promise<void>;
1337
+ /**
1338
+ * Register a callback for when i18n is ready
1339
+ */
1340
+ onReady(callback: () => void): void;
1341
+ /**
1342
+ * Notify all listeners that i18n is ready
1343
+ */
1344
+ private notifyReady;
1345
+ /**
1346
+ * Get language from localStorage
1347
+ */
1348
+ private getStoredLanguage;
1349
+ /**
1350
+ * Store language in localStorage
1351
+ */
1352
+ private storeLanguage;
992
1353
  /**
993
1354
  * Dispatch language change event
994
1355
  */
@@ -1133,323 +1494,21 @@ declare function setupI18n(config: I18nConfig): Promise<void>;
1133
1494
  */
1134
1495
  declare function loadLanguageFile(lang: string, staticPath?: string): Promise<void>;
1135
1496
 
1136
- type ToastType = 'success' | 'error' | 'info' | 'warning';
1137
- interface ToastMessage {
1138
- id: number;
1139
- message: string;
1140
- type: ToastType;
1141
- translateKey?: string;
1142
- }
1143
- declare class Toast extends Component {
1144
- messages: ToastMessage[];
1145
- private nextId;
1146
- /**
1147
- * Show a toast notification
1148
- */
1149
- show(message: string, type?: ToastType, duration?: number, translateKey?: string): void;
1150
- /**
1151
- * Convenience methods
1152
- */
1153
- success(message: string, duration?: number, translateKey?: string): void;
1154
- error(message: string, duration?: number, translateKey?: string): void;
1155
- info(message: string, duration?: number, translateKey?: string): void;
1156
- warning(message: string, duration?: number, translateKey?: string): void;
1157
- render(): VNode;
1158
- renderToast(msg: ToastMessage): VNode;
1159
- }
1160
- declare function initToast(container?: HTMLElement): Toast;
1161
- declare function getToast(): Toast;
1162
- declare const toast: {
1163
- show: (message: string, type?: ToastType, duration?: number, translateKey?: string) => void;
1164
- success: (message: string, duration?: number, translateKey?: string) => void;
1165
- error: (message: string, duration?: number, translateKey?: string) => void;
1166
- info: (message: string, duration?: number, translateKey?: string) => void;
1167
- warning: (message: string, duration?: number, translateKey?: string) => void;
1168
- };
1169
-
1170
- type LoaderSize = 'small' | 'medium' | 'large';
1171
- type LoaderVariant = 'spinner' | 'dots' | 'pulse';
1172
- interface LoaderOptions {
1173
- message?: string;
1174
- variant?: LoaderVariant;
1175
- size?: LoaderSize;
1176
- overlay?: boolean;
1177
- }
1178
- declare class Loader extends Component {
1179
- visible: boolean;
1180
- message: string;
1181
- variant: LoaderVariant;
1182
- size: LoaderSize;
1183
- overlay: boolean;
1184
- progress: number;
1185
- showProgress: boolean;
1186
- private animationFrame;
1187
- private hideTimeout;
1188
- onMount(): Promise<void>;
1189
- onUnmount(): void;
1190
- render(): VNode;
1191
- renderSpinner(): VNode;
1192
- renderMessage(): VNode;
1193
- renderProgressBar(): VNode;
1194
- show(options?: LoaderOptions | string): void;
1195
- hide(delay?: number): void;
1196
- setMessage(message: string): void;
1197
- setProgress(progress: number): void;
1198
- updateProgress(increment: number): void;
1199
- private performHide;
1200
- private applyBodyLock;
1201
- private removeBodyLock;
1202
- private setupKeyboardListener;
1203
- private handleKeyPress;
1204
- private initializeAccessibility;
1205
- isVisible(): boolean;
1206
- getStatus(): {
1207
- visible: boolean;
1208
- message: string;
1209
- progress: number;
1210
- };
1211
- }
1212
-
1213
- interface ButtonConfig {
1214
- label: string;
1215
- className?: string;
1216
- icon?: string;
1217
- loadingLabel?: string;
1218
- onClick?: 'submit' | (() => void | Promise<void>);
1219
- }
1220
- interface FormConfig {
1221
- fields: (FormFieldConfig | (FormFieldConfig | VNode)[])[];
1222
- endpoint?: string;
1223
- method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
1224
- onSubmit?: (data: Record<string, unknown>, event: Event) => void | Promise<void>;
1225
- onSuccess?: (data: unknown) => void;
1226
- onError?: (error: unknown) => void;
1227
- onValidationError?: (errors: Record<string, string>) => void;
1228
- buttons?: Record<string, ButtonConfig>;
1229
- className?: string;
1230
- autoValidate?: boolean;
1231
- }
1232
- interface FormField extends FormFieldConfig {
1233
- error?: string;
1234
- touched?: boolean;
1235
- }
1497
+ type FATheme = 'solid' | 'regular' | 'light' | 'thin' | 'duotone' | 'brands' | 'sharp-solid' | 'sharp-regular' | 'sharp-light' | 'sharp-thin' | 'sharp-duotone-solid' | 'sharp-duotone-regular' | 'sharp-duotone-light' | 'sharp-duotone-thin' | 'notdog' | 'notdog-duo' | 'jelly' | 'jelly-fill' | 'jelly-duo' | 'chisel' | 'etch' | 'slab' | 'slab-press' | 'thumbprint' | 'utility' | 'utility-fill' | 'utility-duo' | 'whiteboard';
1236
1498
  /**
1237
- * SmartForm Component
1238
- * Auto-validation, CSRF protection, API submission
1499
+ * Get the default FontAwesome theme
1239
1500
  */
1240
- declare class SmartFormComponent extends Component<FormConfig> {
1241
- fields: FormField[];
1242
- formData: Record<string, unknown>;
1243
- isSubmitting: boolean;
1244
- submitError: string;
1245
- submitSuccess: boolean;
1246
- passwordVisibility: Record<string, boolean>;
1247
- constructor(props: FormConfig);
1248
- onMount(): void;
1249
- /**
1250
- * Handle field change
1251
- */
1252
- handleChange(fieldName: string, value: unknown): void;
1253
- /**
1254
- * Handle field blur
1255
- */
1256
- handleBlur(fieldName: string): void;
1257
- /**
1258
- * Validate single field
1259
- */
1260
- validateField(field: FormField, value: unknown): string | undefined;
1261
- /**
1262
- * Validate all fields
1263
- */
1264
- validateForm(): boolean;
1265
- /**
1266
- * Handle form submission
1267
- */
1268
- handleSubmit(event: Event): Promise<void>;
1269
- /**
1270
- * Render label with optional icon
1271
- */
1272
- renderLabel(field: FormField): VNode | string;
1273
- /**
1274
- * Get field buttons configuration
1275
- */
1276
- getFieldButtons(field: FormField): FieldButtonConfig[];
1277
- /**
1278
- * Handle field button click
1279
- */
1280
- handleFieldButton(field: FormField, buttonType: string): void;
1281
- /**
1282
- * Render validation rules popup
1283
- */
1284
- renderValidationRules(field: FormField): VNode | string;
1285
- /**
1286
- * Render field input buttons
1287
- */
1288
- renderFieldButtons(field: FormField): VNode | string;
1289
- /**
1290
- * Render form field
1291
- */
1292
- renderField(field: FormField): VNode;
1293
- /**
1294
- * Render buttons section
1295
- */
1296
- renderButtons(): VNode;
1297
- render(): VNode;
1298
- styles(): string;
1299
- }
1501
+ declare function getDefaultFATheme(): FATheme;
1300
1502
  /**
1301
- * SmartForm helper function
1503
+ * Set the default FontAwesome theme
1504
+ * @param theme The FontAwesome theme to use as default
1302
1505
  */
1303
- declare function SmartForm(config: FormConfig): VNode;
1304
-
1305
- type PopupType = 'confirm' | 'alert' | 'form' | 'custom' | 'prompt';
1306
- type PopupVariant = 'default' | 'danger' | 'warning' | 'success' | 'info';
1307
- type PopupSize = 'small' | 'medium' | 'large' | 'xlarge' | 'fullscreen';
1308
- interface PopupButton {
1309
- label: string;
1310
- translateKey?: string;
1311
- variant?: 'primary' | 'secondary' | 'danger' | 'success';
1312
- icon?: string;
1313
- onClick: () => void | Promise<void>;
1314
- loading?: boolean;
1315
- }
1316
- interface PopupFormOptions {
1317
- title: string;
1318
- titleTranslateKey?: string;
1319
- description?: string;
1320
- descriptionTranslateKey?: string;
1321
- formConfig: FormConfig;
1322
- variant?: PopupVariant;
1323
- icon?: string;
1324
- size?: PopupSize;
1325
- closeOnOverlay?: boolean;
1326
- closeOnEscape?: boolean;
1327
- showCloseButton?: boolean;
1328
- }
1329
- interface PopupOptions {
1330
- title: string;
1331
- titleTranslateKey?: string;
1332
- message?: string;
1333
- messageTranslateKey?: string;
1334
- description?: string;
1335
- descriptionTranslateKey?: string;
1336
- type?: PopupType;
1337
- variant?: PopupVariant;
1338
- size?: PopupSize;
1339
- buttons?: PopupButton[];
1340
- customContent?: VNode;
1341
- formConfig?: FormConfig;
1342
- closeOnOverlay?: boolean;
1343
- closeOnEscape?: boolean;
1344
- showCloseButton?: boolean;
1345
- icon?: string;
1346
- onConfirm?: () => void | Promise<void>;
1347
- onCancel?: () => void | Promise<void>;
1348
- }
1349
- interface ActivePopup extends PopupOptions {
1350
- id: number;
1351
- resolve?: (value: boolean | string | null | Record<string, unknown>) => void;
1352
- inputValue?: string;
1353
- isSubmitting?: boolean;
1354
- }
1355
- declare class Popup extends Component {
1356
- popups: ActivePopup[];
1357
- private nextId;
1358
- private handleEscapeKey?;
1359
- onMount(): Promise<void>;
1360
- onUnmount(): void;
1361
- render(): VNode;
1362
- renderPopup(popup: ActivePopup): VNode;
1363
- /**
1364
- * Show a custom popup
1365
- */
1366
- show(options: PopupOptions): Promise<boolean | string | null | Record<string, unknown>>;
1367
- /**
1368
- * Show a form popup
1369
- */
1370
- showForm(options: PopupFormOptions): Promise<boolean | string | null | Record<string, unknown>>;
1371
- /**
1372
- * Show a confirmation dialog
1373
- */
1374
- confirm(options: {
1375
- title: string;
1376
- titleTranslateKey?: string;
1377
- message: string;
1378
- messageTranslateKey?: string;
1379
- confirmLabel?: string;
1380
- confirmTranslateKey?: string;
1381
- cancelLabel?: string;
1382
- cancelTranslateKey?: string;
1383
- variant?: PopupVariant;
1384
- icon?: string;
1385
- size?: PopupSize;
1386
- onConfirm?: () => void | Promise<void>;
1387
- onCancel?: () => void | Promise<void>;
1388
- }): Promise<boolean>;
1389
- /**
1390
- * Show an alert dialog
1391
- */
1392
- alert(options: {
1393
- title: string;
1394
- titleTranslateKey?: string;
1395
- message: string;
1396
- messageTranslateKey?: string;
1397
- okLabel?: string;
1398
- okTranslateKey?: string;
1399
- variant?: PopupVariant;
1400
- icon?: string;
1401
- size?: PopupSize;
1402
- onConfirm?: () => void | Promise<void>;
1403
- }): Promise<boolean>;
1404
- /**
1405
- * Show a prompt dialog
1406
- */
1407
- prompt(options: {
1408
- title: string;
1409
- titleTranslateKey?: string;
1410
- message: string;
1411
- messageTranslateKey?: string;
1412
- defaultValue?: string;
1413
- confirmLabel?: string;
1414
- confirmTranslateKey?: string;
1415
- cancelLabel?: string;
1416
- cancelTranslateKey?: string;
1417
- icon?: string;
1418
- onConfirm?: (value: string) => void | Promise<void>;
1419
- onCancel?: () => void | Promise<void>;
1420
- }): Promise<string | null>;
1421
- /**
1422
- * Close a specific popup
1423
- */
1424
- closePopup(id: number, result: boolean | string | null | Record<string, unknown>): void;
1425
- /**
1426
- * Close all popups
1427
- */
1428
- closeAll(): void;
1429
- private applyBodyLock;
1430
- private removeBodyLock;
1431
- private setupKeyboardListener;
1432
- }
1433
- declare function initPopup(container?: HTMLElement): Popup;
1434
- declare function getPopup(): Popup;
1435
- declare const popup: {
1436
- show: (options: PopupOptions) => Promise<string | boolean | Record<string, unknown> | null>;
1437
- confirm: (options: Parameters<Popup["confirm"]>[0]) => Promise<boolean>;
1438
- alert: (options: Parameters<Popup["alert"]>[0]) => Promise<boolean>;
1439
- prompt: (options: {
1440
- title: string;
1441
- titleTranslateKey?: string;
1442
- message: string;
1443
- icon?: string;
1444
- messageTranslateKey?: string;
1445
- onConfirm?: () => void | Promise<void>;
1446
- }) => Promise<string | null>;
1447
- showForm: (options: PopupFormOptions) => Promise<string | boolean | Record<string, unknown> | null>;
1448
- closePopup: (id: number, result: boolean | string | null | Record<string, unknown>) => void;
1449
- closeLastPopup: () => void;
1450
- closeFirstPopup: () => void;
1451
- closeAll: () => void;
1452
- };
1506
+ declare function setDefaultFATheme(theme: FATheme): void;
1507
+ /**
1508
+ * Initialize FontAwesome config from ClientConfig
1509
+ * @param faConfig The FA configuration from ClientConfig
1510
+ */
1511
+ declare function initializeFAConfig(faConfig?: FAConfig): void;
1453
1512
 
1454
1513
  type TabPosition = 'top' | 'side';
1455
1514
  type TabStyle = 'default' | 'pills' | 'minimal';
@@ -1985,4 +2044,4 @@ declare const bbMap: {
1985
2044
  };
1986
2045
  };
1987
2046
 
1988
- export { type ApiConfig, type AppConfig, type BuildConfig, type ButtonConfig, CM, ClassMaker, type ClassValue, type ClientConfig, CombinedContext, Component, type ComponentConstructor, Context, type ContextSubscriber, type DeepPartial, type DevToolsConfig, Dropdown, type DropdownConfig, type DropdownItemConfig, EC, ElementCreator, type EventHandler, type FieldButtonConfig, type FormConfig, type FormFieldConfig, type FormFieldOption, type FormSubmitHandler, type FormsConfig, type I18nConfig, I18nManager, type IntersectionConfig, ItemsLoader, type ItemsLoaderConfig, type LanguageCode, Loader, type LoaderOptions, type LoaderSize, type LoaderVariant, type NavigationGuard, Popup, type PopupButton, type PopupFormOptions, type PopupOptions, type PopupSize, type PopupType, type PopupVariant, Provider, type ProviderProps, type Route, type RouteConfig, Router, type RouterConfig, SmartForm, SmartFormComponent, type StateConfig, Store, type StoreMiddleware, type StoreOptions, type StoreSubscriber, StyleManager, type Tab, type TabPosition, type TabStyle, TabbedView, type TabbedViewOptions, Toast, type ToastMessage, type ToastType, type TranslationSet, type ValidationRule, VisibilityObserver, bbMap, camelCase, capitalize, clamp, classNames, clearHookContext, client, computed, connect, createCombinedContext, createComputedStore, createContext, createDropdown, createFunctionalComponent, createItemsLoader, createStore, createTabbedView, createTranslator, css, debounce, deepClone, deepMerge, formatDate, formatRelativeTime, formatTimeAgo, getCurrentLanguage, getCurrentPath, getI18n, getPopup, getQueryParam, getQueryParams, getSupportedLanguages, getTimeDisplay, getTimeTitle, getToast, getTranslations, goBack, goForward, hasKey, initPopup, initToast, initializeI18n, isBrowser, isCurrentPath, isCurrentPathPrefix, isEmpty, kebabCase, loadFromUrl, loadLanguage, loadLanguageFile, loadTranslations, mountTabbedView, navigate, navigateWithQuery, observeVisibility, parseQuery, pascalCase, popup, reloadRoute, router, safeJsonParse, scheduler, setHookContext, setLanguage, setLanguageAsync, setupI18n, sleep, state, stringifyQuery, t, tHtml, tLang, throttle, toast, truncate, uniqueId, useCallback, useContext, useDebounce, useEffect, useEventListener, useFetch, useInterval, useLocalStorage, useMemo, usePrevious, useReducer, useRef, useState, useToggle, useWindowSize, utils, watch };
2047
+ export { type ApiConfig, type AppConfig, type BuildConfig, type ButtonConfig, CM, ClassMaker, type ClassValue, type ClientConfig, CombinedContext, Component, type ComponentConstructor, Context, type ContextSubscriber, type DeepPartial, type DevToolsConfig, Dropdown, type DropdownConfig, type DropdownItemConfig, EC, ElementCreator, type EventHandler, type FAConfig, type FieldButtonConfig, type FormConfig, type FormFieldConfig, type FormFieldOption, type FormSubmitHandler, type FormsConfig, type I18nConfig, I18nManager, type IntersectionConfig, ItemsLoader, type ItemsLoaderConfig, type LabelConfig, type LanguageCode, Loader, type LoaderOptions, type LoaderSize, type LoaderVariant, type NavigationGuard, Popup, type PopupButton, type PopupFormOptions, type PopupOptions, type PopupSize, type PopupType, type PopupVariant, Provider, type ProviderProps, type Route, type RouteConfig, Router, type RouterConfig, SmartForm, SmartFormComponent, type StateConfig, Store, type StoreMiddleware, type StoreOptions, type StoreSubscriber, StyleManager, type Tab, type TabPosition, type TabStyle, TabbedView, type TabbedViewOptions, Toast, type ToastMessage, type ToastType, type TranslationSet, type ValidationRule, VisibilityObserver, Window$1 as Window, bbMap, camelCase, capitalize, clamp, classNames, clearHookContext, client, computed, connect, createCombinedContext, createComputedStore, createContext, createDropdown, createFunctionalComponent, createItemsLoader, createStore, createTabbedView, createTranslator, css, debounce, deepClone, deepMerge, formatDate, formatRelativeTime, formatTimeAgo, getCurrentLanguage, getCurrentPath, getDefaultFATheme, getI18n, getPopup$1 as getPopup, getQueryParam, getQueryParams, getSupportedLanguages, getTimeDisplay, getTimeTitle, getToast$1 as getToast, getTranslations, goBack, goForward, hasKey, initPopup, initToast, initializeFAConfig, initializeI18n, isBrowser, isCurrentPath, isCurrentPathPrefix, isEmpty, kebabCase, loadFromUrl, loadLanguage, loadLanguageFile, loadTranslations, mountTabbedView, navigate, navigateWithQuery, observeVisibility, parseQuery, pascalCase, popup, reloadRoute, router, safeJsonParse, scheduler, setDefaultFATheme, setHookContext, setLanguage, setLanguageAsync, setupI18n, sleep, state, stringifyQuery, t, tHtml, tLang, throttle, toast, truncate, uniqueId, useCallback, useContext, useDebounce, useEffect, useEventListener, useFetch, useInterval, useLocalStorage, useMemo, usePrevious, useReducer, useRef, useState, useToggle, useWindowSize, utils, watch };