@apia/components 4.0.8 → 4.0.11

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/index.d.ts CHANGED
@@ -11,7 +11,7 @@ export { INotification, TDispatchedNotification } from '@apia/notifications';
11
11
  import { MenuItemProps, ControlledMenuProps } from '@szhsin/react-menu';
12
12
  export { ControlledMenuProps, MenuItemProps } from '@szhsin/react-menu';
13
13
 
14
- type TModalSize = 'editGrid' | 'sm' | 'md' | 'md-fixed' | 'lg' | 'lg-fixed' | 'xl' | 'xl-fixed' | 'xxl' | 'xxxl' | 'xxxl-fixed' | 'flex' | 'cal' | 'finder';
14
+ type TModalSize = 'editGrid' | 'sm' | 'md' | 'md-fixed' | 'lg' | 'lg-fixed' | 'xl' | 'xl-fixed' | 'xxl' | 'xxxl' | 'xxxl-fixed' | 'flex' | 'cal' | 'finder' | 'fileModal';
15
15
  type TApiaButtonType = 'primary' | 'primary-sm' | 'secondary' | 'light-secondary' | 'secondary-sm' | 'danger' | 'danger-sm' | 'outline' | 'outline-sm' | 'warning' | 'warning-sm' | 'link';
16
16
 
17
17
  interface IDialogHeader {
@@ -236,6 +236,7 @@ declare class ApiaUtilModalHandler {
236
236
  declare class ApiaUtilModals {
237
237
  #private;
238
238
  constructor();
239
+ close(id: string): void;
239
240
  open(props: TOpenModal): ApiaUtilModalHandler;
240
241
  Component: () => React$1.JSX.Element;
241
242
  }
@@ -264,6 +265,7 @@ declare class Tab<TabType extends TTab = TTab> {
264
265
  */
265
266
  close(force?: boolean): Promise<boolean>;
266
267
  open(): void;
268
+ toggle(isShown?: boolean): void;
267
269
  }
268
270
  declare class TabsController<TabType extends TTab = TTab> {
269
271
  #private;
@@ -281,16 +283,18 @@ declare class TabsController<TabType extends TTab = TTab> {
281
283
  /**
282
284
  * Obviamente agrega un tab al listado de tabs
283
285
  */
284
- append(tab: TabType): void;
286
+ append(tab: TabType, closeOthers?: boolean): void;
285
287
  closeAll(closeFixedTabsAsWell?: boolean, force?: boolean): Promise<void>;
286
288
  closeOpenTab(force?: boolean): void;
287
289
  closeToRight(targetId: string, force?: boolean): Promise<void>;
288
290
  closeToLeft(targetId: string, force?: boolean): Promise<void>;
289
291
  closeOthers(targetId: string, force?: boolean): Promise<void>;
290
292
  closeTab(tabId: string, force?: boolean): Promise<boolean>;
293
+ private checkAtLeastOneOpen;
294
+ toggleTab(tabId: string, isShown?: boolean): Promise<void>;
291
295
  focusNextTab(): Tab<TabType> | null;
292
296
  focusPreviousTab(): Tab<TabType> | null;
293
- focusTab(tabId: string): void;
297
+ focusTab(tabId: string, closeOthers?: boolean): void;
294
298
  getTabElement(tabId: string): Element | null;
295
299
  handleKeyDown(ev: React__default.KeyboardEvent): void;
296
300
  openNextTab(): Tab<TabType> | null;
@@ -298,7 +302,7 @@ declare class TabsController<TabType extends TTab = TTab> {
298
302
  /**
299
303
  * Se utiliza para hacer que el tab aparezca visible en el listado
300
304
  */
301
- openTab(tabId: string): void;
305
+ openTab(tabId: string, closeOthers?: boolean): void;
302
306
  }
303
307
 
304
308
  type TOrientation = 'horizontal' | 'vertical';
@@ -306,6 +310,7 @@ type TabsControllerProps<TabType extends TTab> = {
306
310
  id: string;
307
311
  initialTabs?: TabType[];
308
312
  getController?: (controller: TabsController) => unknown;
313
+ initialState?: Pick<Partial<TTabsListState<TabType>>, 'isMultiple'>;
309
314
  onCloseTab?: (tan: Tab) => void;
310
315
  orientation: TOrientation;
311
316
  };
@@ -313,6 +318,7 @@ type TTab = {
313
318
  addEvent?: (ev: 'onFocusTab', cb: (ev: {
314
319
  stop: () => void;
315
320
  }) => unknown) => unknown;
321
+ asAccordion?: boolean;
316
322
  content: React__default.FunctionComponent<{
317
323
  tab: Tab;
318
324
  }>;
@@ -374,7 +380,13 @@ type TTabLabelRenderer = (props: {
374
380
  tab: Tab<TTab>;
375
381
  }) => React__default.ReactElement;
376
382
  type TTabsListState<TabType extends TTab> = {
377
- openTabs: Set<Tab<TabType>>;
383
+ isMultiple: boolean;
384
+ openTabsHistory: Set<Tab<TabType>>;
385
+ /**
386
+ * If this property is true, then it could never happen that all tabs are closed.
387
+ * The TabsController will open the first available tab when no tab is open.
388
+ */
389
+ showAtLeastOneTab: boolean;
378
390
  tabs: Map<string, Tab<TabType>>;
379
391
  timestamp: number;
380
392
  };
@@ -385,7 +397,9 @@ declare const TabsContent: ((props: Omit<BoxProps, 'children'>) => React$1.JSX.E
385
397
  displayName: string;
386
398
  };
387
399
 
388
- declare const Tabs: ({ id, getController, initialTabs, orientation, ...props }: TabsControllerProps<TTab> & Omit<BoxProps, 'id' | 'as' | 'role'>, ref: React__default.ForwardedRef<HTMLDivElement>) => React__default.JSX.Element | null;
400
+ declare function useTabsContext(): TabsController<TTab> | null;
401
+
402
+ declare const Tabs: ({ id, getController, initialTabs, orientation, initialState, ...props }: TabsControllerProps<TTab> & Omit<BoxProps, 'id' | 'as' | 'role'>, ref: React__default.ForwardedRef<HTMLDivElement>) => React__default.JSX.Element | null;
389
403
 
390
404
  declare class ApiaUtilTabsController {
391
405
  get currentTab(): Tab<TTab>;
@@ -626,6 +640,7 @@ type TSubmenu = {
626
640
  items: TMenuItems;
627
641
  };
628
642
  type TMenuItem = (MenuItemProps & {
643
+ icon?: TIconName;
629
644
  key: string;
630
645
  }) | 'separator' | TSubmenu;
631
646
  type TMenuItems = TMenuItem[];
@@ -751,7 +766,7 @@ type AutocompleteProps = {
751
766
  * Si este flag es true, la búsqueda se realiza con .toLowerCase() en el valor y en la cadena de búsqueda.
752
767
  */
753
768
  caseInsensitive?: boolean;
754
- onChange?: (value: string, controller: AutocompleteController) => unknown;
769
+ onChange?: (value: string, controller: AutocompleteController) => void | Promise<boolean>;
755
770
  /**
756
771
  * Si se pasa una función de búsqueda, cuando el usuario busque se llamará a esta función para determinar qué opciones deberán mostrarse. Las opciones devueltas deberán tener filtered !== true para mostrarse.
757
772
  *
@@ -778,6 +793,7 @@ type AutocompleteState = {
778
793
  loading: boolean;
779
794
  showValue: string;
780
795
  value: string;
796
+ width: number;
781
797
  };
782
798
  /**
783
799
  * El componente buscará dentro de las opciones disponibles cuando el usuario realice una búsqueda en el cuadro de texto. Para ello, compara cada opción contra str según:
@@ -826,7 +842,7 @@ declare class AutocompleteController {
826
842
  toggleOpen(): void;
827
843
  search(str: string): void;
828
844
  selectFocused(): void;
829
- setValue(value: string): void;
845
+ setValue(value: string): Promise<void>;
830
846
  tooltipRef: ApiaUtilTooltip | null;
831
847
  }
832
848
 
@@ -1240,6 +1256,7 @@ interface ICollapsiblePanel {
1240
1256
  label: React.ReactNode;
1241
1257
  rememberCollapsedState?: boolean;
1242
1258
  titleButtons?: React.ReactNode;
1259
+ collapseIconToRight?: boolean;
1243
1260
  }
1244
1261
 
1245
1262
  declare const CollapsiblePanel: React__default.ForwardRefExoticComponent<ICollapsiblePanel & React__default.RefAttributes<HTMLDivElement>>;
@@ -1365,6 +1382,10 @@ declare const LoaderSpinner: ((props: {
1365
1382
  displayName: string;
1366
1383
  };
1367
1384
 
1385
+ declare const ListSkeletonLoader: ({ items }: {
1386
+ items?: number | undefined;
1387
+ }) => React$1.JSX.Element;
1388
+
1368
1389
  type TModalContext = {
1369
1390
  changeTitle: (newTitle: string) => void;
1370
1391
  close: () => unknown;
@@ -1782,5 +1803,388 @@ declare const SortableList: ((props: {
1782
1803
  displayName: string;
1783
1804
  };
1784
1805
 
1785
- export { Accordion, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, AutoEllipsis, Autocomplete, type AutocompleteCmpProps, AutocompleteController, type AutocompleteOption, type AutocompleteProps, BaseButton, CalendarModal, Captcha, Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DefaultAccordionItemButton, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, FieldErrorMessage, FieldLabel, type IAccordionItemButton, type IAccordionItemProps, type IAccordionProps, type IAlert, type IApiaFilter, type ICalendarModal, type IConfirm, type IDialogButtonBar, type IDialogHeader, type IField, type IFieldErrorMessage, type IIconInput, type IOverlay, type IRequiredMark, type IResponsiveComponent, type ISimpleButton, IconButton, IconInput, IconsList, LabelBox, LinearLoader, Listbox, ListboxItem, LoaderSpinner, Modal, NumberInput, Overlay, ProgressBar, RequiredMark, ScreenLocker, SimpleButton, SortableList, SortableListItem, type TAccordionHandler, type TAccordionItemButton, type TApiaButtonType, type TApiaIconButton, type TCheckbox, type TDateProps, type TFieldLabel, type TGetTabsController, type TIcon, type TIconButton, type TIconRenderer, type TIconSize, type TIconsList, type TListbox, type TMenuItem, type TModal, type TModalSize, type TNumberInput, type TNumberInputChangeEvent, type TOnClickNode, type TOnConfirmSelection, type TOnSelectionChange, type TOpenModal, type TSubmenu, type TTab, type TTabLabelRenderer as TTabRenderer, type TToolbarIconButton as TToolDefinition, type TTooltip, type TUseModalConfiguration, Tab, Tabs, TabsContent, TabsController, TabsList, Toolbar, ToolbarController, ToolbarIconButton, ToolbarInput, ToolbarSelect, ToolbarSeparator, ToolbarTextButton, UnstyledSortableList, WaiTypeAhead, getFieldErrorStyles, getFieldTouchedStyles, importComponent, makeResponsiveComponent, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useModal, useModalContext, useOtherTagButton };
1806
+ declare class TableParameter extends Parameter<ITableParameterProps> {
1807
+ constructor(params: ITableParameterProps);
1808
+ }
1809
+
1810
+ declare class ParametersGroup implements ParameterObject {
1811
+ component?: string;
1812
+ name: string;
1813
+ parameters: Record<string, TableParameter>;
1814
+ selection: Set<number>;
1815
+ constructor(params: {
1816
+ name: string;
1817
+ parameters: Record<string, IParameter>;
1818
+ component?: string;
1819
+ });
1820
+ removeAll(): void;
1821
+ asPayloadElement(): Record<string, any>;
1822
+ }
1823
+
1824
+ declare class FilterDTO<T extends IFilterDTOState = IFilterDTOState> {
1825
+ type: string;
1826
+ state: T;
1827
+ isTd: boolean;
1828
+ ref: HTMLElement | null;
1829
+ constructor(params: T, filterType?: TFilterType, isTd?: boolean);
1830
+ private isCheckBox;
1831
+ getStoreValue(): TFilterValue | undefined;
1832
+ getValue(): TFilterValue | undefined;
1833
+ getValueTypeLabel(): string;
1834
+ setMultipleValue(value: string | Date | number, idx?: number): void;
1835
+ setValue(value: string | number | Date): void;
1836
+ private resolveMultipleValueInPayload;
1837
+ asPayloadElement(): TFilterPayload;
1838
+ asFilterValue(): IFilterValue | null;
1839
+ getInputType(): "text" | "date" | "number";
1840
+ removeMultipleValue(value: TFilterValue): void;
1841
+ isUndefined(value: TFilterValue): boolean;
1842
+ Component: (({ renderers, multipleInputBoxProps, }: {
1843
+ renderers?: {
1844
+ input?: FC<InputProps & {
1845
+ label?: string | undefined;
1846
+ }> | undefined;
1847
+ } | undefined;
1848
+ multipleInputBoxProps?: BoxProps | undefined;
1849
+ }) => React$1.JSX.Element) & {
1850
+ displayName: string;
1851
+ };
1852
+ getLabel(): string;
1853
+ validate(): boolean;
1854
+ clear(): void;
1855
+ hasFilledValue(): boolean | TFilterValue | undefined;
1856
+ }
1857
+
1858
+ declare class FilterConditionDTO {
1859
+ state: IFilterCondition;
1860
+ parent: FilterDTO;
1861
+ private allowedOps;
1862
+ private static opLabels;
1863
+ constructor(props: IFilterCondition, type: TFilterValueType, parent: FilterDTO);
1864
+ getLabelByFilterOp(): {
1865
+ text: string;
1866
+ title: string;
1867
+ };
1868
+ getOpMap(): Record<TFilterOp, {
1869
+ text: string;
1870
+ title: string;
1871
+ }>;
1872
+ setOp(op: TFilterOp): void;
1873
+ Component: (() => React$1.JSX.Element) & {
1874
+ displayName: string;
1875
+ };
1876
+ }
1877
+
1878
+ type ParameterPossibleValue = {
1879
+ text: string;
1880
+ value: string;
1881
+ };
1882
+ interface ParameterObject extends Payload {
1883
+ }
1884
+ interface Payload {
1885
+ asPayloadElement(): any;
1886
+ }
1887
+ type TParameterType = 'input' | 'check' | 'combo' | 'group' | 'hidden' | 'label' | 'text_area' | 'mdl_attribute' | 'mdl_doc_type' | 'mdl_entity' | 'mdl_metadata' | 'mdl_ai_connector' | 'mdl_ai_embeddings_model' | 'mdl_ai_completion_model';
1888
+ type TVisualizationType = 'I' | 'C';
1889
+ type TFilterOp = 'EQUAL' | 'STARTS_WITH' | 'ENDS_WITH' | 'CONTAINS' | 'DISTINCT' | 'NOT_STARTS_WITH' | 'NOT_ENDS_WITH' | 'NOT_CONTAINS' | 'NOT_NULL' | 'NULL' | 'LOWER_THAN' | 'LOWER_OR_EQUAL_THAN' | 'GREATER_THAN' | 'GREATER_OR_EQUAL_THAN' | 'IN' | 'NOT_IN' | 'RANGE';
1890
+ type TFilterType = 'U' | 'F';
1891
+ type TFilterValueType = 'S' | 'D' | 'N';
1892
+ interface IFilterValue {
1893
+ condition: TFilterOp;
1894
+ value?: string | number | Date;
1895
+ type: TFilterValueType;
1896
+ }
1897
+ type TFilterPayload = Omit<IFilterDTOState, 'filterCondition'> & {
1898
+ filterCondition: TFilterOp;
1899
+ };
1900
+ type TFilterValue = string | number | Date;
1901
+ interface IFilterDTOState {
1902
+ visualizationType: TVisualizationType;
1903
+ filterCondition: FilterConditionDTO;
1904
+ value?: TFilterValue;
1905
+ multipleValue?: TFilterValue[];
1906
+ name: string;
1907
+ title: string;
1908
+ semSerDatSouid?: number;
1909
+ valueType: TFilterValueType;
1910
+ refId: number;
1911
+ hasFixedType: boolean;
1912
+ id: number;
1913
+ filterType: TFilterType;
1914
+ validationError?: string;
1915
+ }
1916
+ interface IFilterCondition {
1917
+ label?: string;
1918
+ op: TFilterOp;
1919
+ }
1920
+ interface IParameter {
1921
+ component?: string;
1922
+ description: string;
1923
+ name: string;
1924
+ possibleValues?: ParameterPossibleValue | ParameterPossibleValue[];
1925
+ required: boolean;
1926
+ title: string;
1927
+ type: TParameterType;
1928
+ values: string[];
1929
+ }
1930
+ interface IParametersGroup {
1931
+ name: string;
1932
+ parameters: Record<string, IParameter>;
1933
+ }
1934
+ interface ITableParameterProps extends IParameter {
1935
+ cssProps: Record<'TH', TCssProps>;
1936
+ }
1937
+ type TCssProps = {
1938
+ backgroundColor?: string;
1939
+ width?: string;
1940
+ color?: string;
1941
+ };
1942
+ type ParameterType = 'input' | 'check' | 'combo' | 'custom';
1943
+ type ParameterRendererProps = {
1944
+ index?: number;
1945
+ parameter: Parameter;
1946
+ };
1947
+ type ParameterRenderer = FC<ParameterRendererProps>;
1948
+ type ParametersGroupRenderer = FC<{
1949
+ group: ParametersGroup;
1950
+ }>;
1951
+ type ParametersDefinition = Record<string, IParameter>;
1952
+
1953
+ declare class Parameter<T extends IParameter = IParameter> implements ParameterObject {
1954
+ state: T & {
1955
+ validationError?: string;
1956
+ };
1957
+ constructor(params: T);
1958
+ clear(): void;
1959
+ getValues(): string[];
1960
+ private removeEmptyValues;
1961
+ setValue(value: string, index?: number): void;
1962
+ addValue(value: string): void;
1963
+ setValues(values: string[], index?: number): void;
1964
+ removeValue(value: string): void;
1965
+ asPayloadElement(): string[] | null;
1966
+ includes(value: string): boolean;
1967
+ validate(): boolean;
1968
+ }
1969
+
1970
+ declare const ParameterRender: (({ index, omitLabel, parameter, }: {
1971
+ index: number;
1972
+ omitLabel?: boolean | undefined;
1973
+ parameter: Parameter;
1974
+ }) => string | React$1.JSX.Element | null) & {
1975
+ displayName: string;
1976
+ };
1977
+
1978
+ type ParametersMap = Record<string, ParameterObject>;
1979
+ declare const Parameters: (({ label, ownerName, parameters, }: {
1980
+ label?: ReactNode;
1981
+ ownerName?: string | undefined;
1982
+ parameters?: ParametersMap | undefined;
1983
+ }) => React$1.JSX.Element | undefined) & {
1984
+ displayName: string;
1985
+ };
1986
+
1987
+ declare function isParametersGroup(param: IParameter | IParametersGroup): param is IParametersGroup;
1988
+ declare class ParametersStore {
1989
+ private static instance;
1990
+ static getInstance(): ParametersStore;
1991
+ private parameters;
1992
+ private constructor();
1993
+ /**
1994
+ * Takes the string generated by the ParametersStore in the server
1995
+ * and assigns it to the current parameters
1996
+ */
1997
+ fromResponse(owner: string, response: string): void;
1998
+ static getParametersFromResponse(response: string): Record<string, ParameterObject>;
1999
+ static getParametersFromObject(response: Record<string, IParameter | IParametersGroup>): Record<string, ParameterObject>;
2000
+ /**
2001
+ * Returns the parameters for a given owner name.
2002
+ */
2003
+ getParameters(ownerName: string): Record<string, ParameterObject>;
2004
+ /**
2005
+ * Returns an object that can be used to submit the parameters to the server
2006
+ * in a format that the ParametersStore in the server expects.
2007
+ */
2008
+ getSubmitValue(owner: string): string;
2009
+ /**
2010
+ * Resets the parameters store.
2011
+ */
2012
+ reset(): void;
2013
+ static validate(parameters: Record<string, ParameterObject>): boolean;
2014
+ }
2015
+
2016
+ declare const ParametersTable: ParametersGroupRenderer;
2017
+
2018
+ declare class FiltersStore {
2019
+ private static instance;
2020
+ available: Record<string, FilterDTO<IFilterDTOState>>;
2021
+ fixed: Record<string, FilterDTO<IFilterDTOState>>;
2022
+ dynamic: Record<string, FilterDTO<IFilterDTOState>>;
2023
+ private constructor();
2024
+ /**
2025
+ * Takes the string generated by the ParametersStore in the server
2026
+ * and assigns it to the current filters
2027
+ */
2028
+ static getFiltersFromResponse(response: string, from?: 'fixed' | 'dynamic' | 'available'): Record<string, FilterDTO<IFilterDTOState>>;
2029
+ static setFiltersFromObject(response: {
2030
+ available: Record<string, FilterDTO<IFilterDTOState>>;
2031
+ fixed: Record<string, FilterDTO<IFilterDTOState>>;
2032
+ dynamic: Record<string, FilterDTO<IFilterDTOState>>;
2033
+ }): void;
2034
+ static getFiltersFromObject(response: Record<string, FilterDTO>): Record<string, FilterDTO<IFilterDTOState>>;
2035
+ /**
2036
+ * Returns the filters for a given name.
2037
+ */
2038
+ static getFilter(name: string, type?: TFilterType): FilterDTO<IFilterDTOState>;
2039
+ /**
2040
+ * Set filter into store given owner name
2041
+ */
2042
+ static setFilter(value: FilterDTO<IFilterDTOState>, type?: TFilterType, replace?: boolean): void;
2043
+ /**
2044
+ * Remove into store given owner name
2045
+ */
2046
+ static removeFilter(x: FilterDTO<IFilterDTOState>, type?: TFilterType): void;
2047
+ /**
2048
+ * Resets the parameters store.
2049
+ */
2050
+ static reset(): void;
2051
+ static size(): number;
2052
+ static setFilters(filters: Record<string, FilterDTO<IFilterDTOState>>, type?: TFilterType): void;
2053
+ static filters(type?: TFilterType): Record<string, FilterDTO<IFilterDTOState>>;
2054
+ static parseFiltersAsFilterValue(values: FilterDTO[]): Record<string, IFilterValue>;
2055
+ static getFiltersAsFilterValue(type?: TFilterType): Record<string, IFilterValue>;
2056
+ static getAllFilters(includeAvailable?: boolean): FilterDTO<IFilterDTOState>[];
2057
+ static values(type?: TFilterType): FilterDTO<IFilterDTOState>[];
2058
+ static entries(type?: TFilterType): [string, FilterDTO<IFilterDTOState>][];
2059
+ static keys(type?: TFilterType): string[];
2060
+ static getFiltersById(id: number): Promise<Record<string, FilterDTO<IFilterDTOState>>>;
2061
+ static asPayloadElement(): TFilterPayload[];
2062
+ static validate(): boolean;
2063
+ }
2064
+
2065
+ interface IReplacer<ContentType, ReturnType> {
2066
+ /**
2067
+ * This regExp will be used by the templater to determine if it should call
2068
+ * the parse function or not.
2069
+ */
2070
+ match: RegExp;
2071
+ /**
2072
+ * The parse method should take the RegExpMatchArray and the value of the
2073
+ * original attribute and return whatever the replacer is intended for.
2074
+ * */
2075
+ parse: (result: RegExpMatchArray, value: ContentType) => ReturnType;
2076
+ }
2077
+ /**
2078
+ * The Attribute parsers are intended to parse some attributes whose names
2079
+ * match in one of the following array items' match property. If the match
2080
+ * property matches the attribute name, the parse function will be called with
2081
+ * the result of the match and the original Value passed to that attribute.
2082
+ * This way, it can be modified not only the name but the value as well.
2083
+ */
2084
+ declare const AttributeParsers: IReplacer<string, {
2085
+ newName: string;
2086
+ newValue: unknown;
2087
+ }[] | null>[];
2088
+
2089
+ interface IAlterDefaultOptions {
2090
+ /**
2091
+ * It's possible to replace some attributes and parse the value with
2092
+ * a specific replacement function you provide, in order to provide
2093
+ * custom behavior to the template.
2094
+ *
2095
+ * @example
2096
+ *
2097
+ * attributeParsers: [
2098
+ * {
2099
+ * match: /^data-say-([\w]+)$/,
2100
+ * parse: (matchResult, originalValue) => ({ newName: 'onLoad', newValue:
2101
+ * () => alert(matchResult[1]) })
2102
+ * }
2103
+ * ]
2104
+ */
2105
+ attributeParsers?: typeof AttributeParsers;
2106
+ /**
2107
+ * It's possible to replace some attributes with this property. Each
2108
+ * attribute will be searched in the dictionary and if it's found,
2109
+ * then it will be replaced with the value which pairs that key.
2110
+ *
2111
+ * @example
2112
+ *
2113
+ * attributesReplacement: {
2114
+ * class: 'className' // Very common in react, it's implemented by default
2115
+ * }
2116
+ */
2117
+ attributesReplacement?: Record<string, string>;
2118
+ /**
2119
+ * With this parameter the templater shouts to the console the important
2120
+ * events it goes through.
2121
+ */
2122
+ debug?: boolean;
2123
+ /**
2124
+ * It's possible to filter some attributes passing an array of undesired
2125
+ * values
2126
+ *
2127
+ * @example
2128
+ *
2129
+ * filterAttributes: ['data-dangerous']
2130
+ */
2131
+ filterAttributes?: string[];
2132
+ /**
2133
+ * WARNING: If
2134
+ *
2135
+ * The props object can be accessed from the template, in this way,
2136
+ * it's possible to pass any kind of javascript data to be used
2137
+ * when generating the template's structure.
2138
+ */
2139
+ props?: Record<string, unknown>;
2140
+ }
2141
+ type TTemplateParser = (document: Document) => void;
2142
+ declare global {
2143
+ interface Window {
2144
+ onPreParseTemplate: TTemplateParser;
2145
+ }
2146
+ }
2147
+ declare class Templater {
2148
+ #private;
2149
+ private static _instance;
2150
+ static get instance(): Templater;
2151
+ isDownloadingTemplate: boolean;
2152
+ templates: Record<string, string>;
2153
+ private constructor();
2154
+ private initTemplates;
2155
+ /**
2156
+ * This method parses the string looking for <script class="context"> tags
2157
+ * and placeholders, run that code and make the replacements in the template
2158
+ * string.
2159
+ *
2160
+ * @param content The HTML string
2161
+ */
2162
+ private parseContent;
2163
+ /**
2164
+ * This method takes a template from the HTML Document and parses it to React
2165
+ * Components.
2166
+ *
2167
+ * @param name The name of the template you are looking for, it must be specified as
2168
+ * data-template="name" in the HTML element you want to use as template.
2169
+ * @param options This argument allows you to alter the behavior of the parser, for example
2170
+ * to replace some attribute names, parse some attributes with a custom parser function or
2171
+ * discard some attributes. See the type IAlterDefaultOptions to get more information
2172
+ *
2173
+ * @returns A ReactComponent as the result of the parsed HTML template.
2174
+ */
2175
+ getTemplateByName(name: string, options?: IAlterDefaultOptions): string | JSX.Element | JSX.Element[];
2176
+ /**
2177
+ * This method parses a string in HTML to React Components.
2178
+ *
2179
+ * @param content The HTML string to parse to React Components
2180
+ * @param options This argument allows you to alter the behavior of the parser, for example
2181
+ * to replace some attribute names, parse some attributes with a custom parser function or
2182
+ * discard some attributes. See the type IAlterDefaultOptions to get more information
2183
+ *
2184
+ * @returns A ReactComponent as the result of the parsed HTML template.
2185
+ */
2186
+ parseString(content: string, options?: IAlterDefaultOptions): string | JSX.Element | JSX.Element[];
2187
+ }
2188
+
2189
+ export { Accordion, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, AutoEllipsis, Autocomplete, type AutocompleteCmpProps, AutocompleteController, type AutocompleteOption, type AutocompleteProps, BaseButton, CalendarModal, Captcha, Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DefaultAccordionItemButton, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, FieldErrorMessage, FieldLabel, FilterConditionDTO, FilterDTO, FiltersStore, type IAccordionItemButton, type IAccordionItemProps, type IAccordionProps, type IAlert, type IApiaFilter, type ICalendarModal, type IConfirm, type IDialogButtonBar, type IDialogHeader, type IField, type IFieldErrorMessage, type IFilterCondition, type IFilterDTOState, type IFilterValue, type IIconInput, type IOverlay, type IParameter, type IParametersGroup, type IRequiredMark, type IResponsiveComponent, type ISimpleButton, type ITableParameterProps, IconButton, IconInput, IconsList, LabelBox, LinearLoader, ListSkeletonLoader, Listbox, ListboxItem, LoaderSpinner, Modal, NumberInput, Overlay, Parameter, type ParameterObject, type ParameterPossibleValue, ParameterRender, type ParameterRenderer, type ParameterRendererProps, type ParameterType, Parameters, type ParametersDefinition, ParametersGroup, type ParametersGroupRenderer, ParametersStore, ParametersTable, type Payload, ProgressBar, RequiredMark, ScreenLocker, SimpleButton, SortableList, SortableListItem, type TAccordionHandler, type TAccordionItemButton, type TApiaButtonType, type TApiaIconButton, type TCheckbox, type TCssProps, type TDateProps, type TFieldLabel, type TFilterOp, type TFilterPayload, type TFilterType, type TFilterValue, type TFilterValueType, type TGetTabsController, type TIcon, type TIconButton, type TIconRenderer, type TIconSize, type TIconsList, type TListbox, type TMenuItem, type TModal, type TModalSize, type TNumberInput, type TNumberInputChangeEvent, type TOnClickNode, type TOnConfirmSelection, type TOnSelectionChange, type TOpenModal, type TParameterType, type TSubmenu, type TTab, type TTabLabelRenderer as TTabRenderer, type TToolbarIconButton as TToolDefinition, type TTooltip, type TUseModalConfiguration, type TVisualizationType, Tab, Tabs, TabsContent, TabsController, TabsList, Templater, Toolbar, ToolbarController, ToolbarIconButton, ToolbarInput, ToolbarSelect, ToolbarSeparator, ToolbarTextButton, UnstyledSortableList, WaiTypeAhead, getFieldErrorStyles, getFieldTouchedStyles, importComponent, isParametersGroup, makeResponsiveComponent, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useModal, useModalContext, useOtherTagButton, useTabsContext };
1786
2190
  //# sourceMappingURL=index.d.ts.map