@cute-widgets/base 20.0.1

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.
Files changed (183) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/LICENSE.md +191 -0
  3. package/README.md +190 -0
  4. package/abstract/index.d.ts +327 -0
  5. package/alert/index.d.ts +68 -0
  6. package/autocomplete/index.d.ts +442 -0
  7. package/badge/index.d.ts +26 -0
  8. package/bottom-sheet/index.d.ts +231 -0
  9. package/button/index.d.ts +182 -0
  10. package/button-toggle/index.d.ts +225 -0
  11. package/card/index.d.ts +163 -0
  12. package/checkbox/index.d.ts +174 -0
  13. package/chips/index.d.ts +963 -0
  14. package/collapse/index.d.ts +97 -0
  15. package/core/animation/index.d.ts +43 -0
  16. package/core/datetime/index.d.ts +404 -0
  17. package/core/directives/index.d.ts +168 -0
  18. package/core/error/index.d.ts +74 -0
  19. package/core/index.d.ts +1039 -0
  20. package/core/interfaces/index.d.ts +114 -0
  21. package/core/layout/index.d.ts +53 -0
  22. package/core/line/index.d.ts +37 -0
  23. package/core/nav/index.d.ts +321 -0
  24. package/core/observers/index.d.ts +124 -0
  25. package/core/option/index.d.ts +185 -0
  26. package/core/pipes/index.d.ts +53 -0
  27. package/core/ripple/index.d.ts +66 -0
  28. package/core/testing/index.d.ts +154 -0
  29. package/core/theming/index.d.ts +118 -0
  30. package/core/types/index.d.ts +53 -0
  31. package/core/utils/index.d.ts +129 -0
  32. package/cute-widgets-base-20.0.1.tgz +0 -0
  33. package/datepicker/index.d.ts +1817 -0
  34. package/dialog/index.d.ts +484 -0
  35. package/divider/index.d.ts +24 -0
  36. package/expansion/README.md +8 -0
  37. package/expansion/index.d.ts +308 -0
  38. package/fesm2022/cute-widgets-base-abstract.mjs +547 -0
  39. package/fesm2022/cute-widgets-base-abstract.mjs.map +1 -0
  40. package/fesm2022/cute-widgets-base-alert.mjs +198 -0
  41. package/fesm2022/cute-widgets-base-alert.mjs.map +1 -0
  42. package/fesm2022/cute-widgets-base-autocomplete.mjs +1217 -0
  43. package/fesm2022/cute-widgets-base-autocomplete.mjs.map +1 -0
  44. package/fesm2022/cute-widgets-base-badge.mjs +75 -0
  45. package/fesm2022/cute-widgets-base-badge.mjs.map +1 -0
  46. package/fesm2022/cute-widgets-base-bottom-sheet.mjs +416 -0
  47. package/fesm2022/cute-widgets-base-bottom-sheet.mjs.map +1 -0
  48. package/fesm2022/cute-widgets-base-button-toggle.mjs +640 -0
  49. package/fesm2022/cute-widgets-base-button-toggle.mjs.map +1 -0
  50. package/fesm2022/cute-widgets-base-button.mjs +546 -0
  51. package/fesm2022/cute-widgets-base-button.mjs.map +1 -0
  52. package/fesm2022/cute-widgets-base-card.mjs +471 -0
  53. package/fesm2022/cute-widgets-base-card.mjs.map +1 -0
  54. package/fesm2022/cute-widgets-base-checkbox.mjs +390 -0
  55. package/fesm2022/cute-widgets-base-checkbox.mjs.map +1 -0
  56. package/fesm2022/cute-widgets-base-chips.mjs +2360 -0
  57. package/fesm2022/cute-widgets-base-chips.mjs.map +1 -0
  58. package/fesm2022/cute-widgets-base-collapse.mjs +259 -0
  59. package/fesm2022/cute-widgets-base-collapse.mjs.map +1 -0
  60. package/fesm2022/cute-widgets-base-core-animation.mjs +53 -0
  61. package/fesm2022/cute-widgets-base-core-animation.mjs.map +1 -0
  62. package/fesm2022/cute-widgets-base-core-datetime.mjs +568 -0
  63. package/fesm2022/cute-widgets-base-core-datetime.mjs.map +1 -0
  64. package/fesm2022/cute-widgets-base-core-directives.mjs +404 -0
  65. package/fesm2022/cute-widgets-base-core-directives.mjs.map +1 -0
  66. package/fesm2022/cute-widgets-base-core-error.mjs +105 -0
  67. package/fesm2022/cute-widgets-base-core-error.mjs.map +1 -0
  68. package/fesm2022/cute-widgets-base-core-interfaces.mjs +22 -0
  69. package/fesm2022/cute-widgets-base-core-interfaces.mjs.map +1 -0
  70. package/fesm2022/cute-widgets-base-core-layout.mjs +74 -0
  71. package/fesm2022/cute-widgets-base-core-layout.mjs.map +1 -0
  72. package/fesm2022/cute-widgets-base-core-line.mjs +87 -0
  73. package/fesm2022/cute-widgets-base-core-line.mjs.map +1 -0
  74. package/fesm2022/cute-widgets-base-core-nav.mjs +863 -0
  75. package/fesm2022/cute-widgets-base-core-nav.mjs.map +1 -0
  76. package/fesm2022/cute-widgets-base-core-observers.mjs +304 -0
  77. package/fesm2022/cute-widgets-base-core-observers.mjs.map +1 -0
  78. package/fesm2022/cute-widgets-base-core-option.mjs +373 -0
  79. package/fesm2022/cute-widgets-base-core-option.mjs.map +1 -0
  80. package/fesm2022/cute-widgets-base-core-pipes.mjs +97 -0
  81. package/fesm2022/cute-widgets-base-core-pipes.mjs.map +1 -0
  82. package/fesm2022/cute-widgets-base-core-ripple.mjs +172 -0
  83. package/fesm2022/cute-widgets-base-core-ripple.mjs.map +1 -0
  84. package/fesm2022/cute-widgets-base-core-testing.mjs +210 -0
  85. package/fesm2022/cute-widgets-base-core-testing.mjs.map +1 -0
  86. package/fesm2022/cute-widgets-base-core-theming.mjs +314 -0
  87. package/fesm2022/cute-widgets-base-core-theming.mjs.map +1 -0
  88. package/fesm2022/cute-widgets-base-core-types.mjs +22 -0
  89. package/fesm2022/cute-widgets-base-core-types.mjs.map +1 -0
  90. package/fesm2022/cute-widgets-base-core-utils.mjs +257 -0
  91. package/fesm2022/cute-widgets-base-core-utils.mjs.map +1 -0
  92. package/fesm2022/cute-widgets-base-core.mjs +1600 -0
  93. package/fesm2022/cute-widgets-base-core.mjs.map +1 -0
  94. package/fesm2022/cute-widgets-base-datepicker.mjs +4827 -0
  95. package/fesm2022/cute-widgets-base-datepicker.mjs.map +1 -0
  96. package/fesm2022/cute-widgets-base-dialog.mjs +1046 -0
  97. package/fesm2022/cute-widgets-base-dialog.mjs.map +1 -0
  98. package/fesm2022/cute-widgets-base-divider.mjs +86 -0
  99. package/fesm2022/cute-widgets-base-divider.mjs.map +1 -0
  100. package/fesm2022/cute-widgets-base-expansion.mjs +623 -0
  101. package/fesm2022/cute-widgets-base-expansion.mjs.map +1 -0
  102. package/fesm2022/cute-widgets-base-form-field.mjs +969 -0
  103. package/fesm2022/cute-widgets-base-form-field.mjs.map +1 -0
  104. package/fesm2022/cute-widgets-base-grid-list.mjs +715 -0
  105. package/fesm2022/cute-widgets-base-grid-list.mjs.map +1 -0
  106. package/fesm2022/cute-widgets-base-icon.mjs +1105 -0
  107. package/fesm2022/cute-widgets-base-icon.mjs.map +1 -0
  108. package/fesm2022/cute-widgets-base-input.mjs +726 -0
  109. package/fesm2022/cute-widgets-base-input.mjs.map +1 -0
  110. package/fesm2022/cute-widgets-base-layout-container.mjs +95 -0
  111. package/fesm2022/cute-widgets-base-layout-container.mjs.map +1 -0
  112. package/fesm2022/cute-widgets-base-layout-stack.mjs +166 -0
  113. package/fesm2022/cute-widgets-base-layout-stack.mjs.map +1 -0
  114. package/fesm2022/cute-widgets-base-layout.mjs +250 -0
  115. package/fesm2022/cute-widgets-base-layout.mjs.map +1 -0
  116. package/fesm2022/cute-widgets-base-list.mjs +1557 -0
  117. package/fesm2022/cute-widgets-base-list.mjs.map +1 -0
  118. package/fesm2022/cute-widgets-base-menu.mjs +1283 -0
  119. package/fesm2022/cute-widgets-base-menu.mjs.map +1 -0
  120. package/fesm2022/cute-widgets-base-navbar.mjs +359 -0
  121. package/fesm2022/cute-widgets-base-navbar.mjs.map +1 -0
  122. package/fesm2022/cute-widgets-base-paginator.mjs +485 -0
  123. package/fesm2022/cute-widgets-base-paginator.mjs.map +1 -0
  124. package/fesm2022/cute-widgets-base-progress.mjs +321 -0
  125. package/fesm2022/cute-widgets-base-progress.mjs.map +1 -0
  126. package/fesm2022/cute-widgets-base-radio.mjs +637 -0
  127. package/fesm2022/cute-widgets-base-radio.mjs.map +1 -0
  128. package/fesm2022/cute-widgets-base-select.mjs +1208 -0
  129. package/fesm2022/cute-widgets-base-select.mjs.map +1 -0
  130. package/fesm2022/cute-widgets-base-sidenav.mjs +1095 -0
  131. package/fesm2022/cute-widgets-base-sidenav.mjs.map +1 -0
  132. package/fesm2022/cute-widgets-base-slider.mjs +99 -0
  133. package/fesm2022/cute-widgets-base-slider.mjs.map +1 -0
  134. package/fesm2022/cute-widgets-base-snack-bar.mjs +897 -0
  135. package/fesm2022/cute-widgets-base-snack-bar.mjs.map +1 -0
  136. package/fesm2022/cute-widgets-base-sort.mjs +639 -0
  137. package/fesm2022/cute-widgets-base-sort.mjs.map +1 -0
  138. package/fesm2022/cute-widgets-base-spinner.mjs +154 -0
  139. package/fesm2022/cute-widgets-base-spinner.mjs.map +1 -0
  140. package/fesm2022/cute-widgets-base-stepper.mjs +673 -0
  141. package/fesm2022/cute-widgets-base-stepper.mjs.map +1 -0
  142. package/fesm2022/cute-widgets-base-table.mjs +1023 -0
  143. package/fesm2022/cute-widgets-base-table.mjs.map +1 -0
  144. package/fesm2022/cute-widgets-base-tabs.mjs +729 -0
  145. package/fesm2022/cute-widgets-base-tabs.mjs.map +1 -0
  146. package/fesm2022/cute-widgets-base-timepicker.mjs +965 -0
  147. package/fesm2022/cute-widgets-base-timepicker.mjs.map +1 -0
  148. package/fesm2022/cute-widgets-base-toolbar.mjs +120 -0
  149. package/fesm2022/cute-widgets-base-toolbar.mjs.map +1 -0
  150. package/fesm2022/cute-widgets-base-tooltip.mjs +947 -0
  151. package/fesm2022/cute-widgets-base-tooltip.mjs.map +1 -0
  152. package/fesm2022/cute-widgets-base-tree.mjs +598 -0
  153. package/fesm2022/cute-widgets-base-tree.mjs.map +1 -0
  154. package/fesm2022/cute-widgets-base.mjs +68 -0
  155. package/fesm2022/cute-widgets-base.mjs.map +1 -0
  156. package/form-field/index.d.ts +401 -0
  157. package/grid-list/index.d.ts +361 -0
  158. package/icon/index.d.ts +477 -0
  159. package/index.d.ts +3 -0
  160. package/input/index.d.ts +256 -0
  161. package/layout/container/index.d.ts +31 -0
  162. package/layout/index.d.ts +78 -0
  163. package/layout/stack/index.d.ts +52 -0
  164. package/list/index.d.ts +659 -0
  165. package/menu/index.d.ts +497 -0
  166. package/navbar/index.d.ts +91 -0
  167. package/package.json +279 -0
  168. package/paginator/index.d.ts +216 -0
  169. package/progress/index.d.ts +130 -0
  170. package/radio/index.d.ts +259 -0
  171. package/select/index.d.ts +426 -0
  172. package/sidenav/index.d.ts +369 -0
  173. package/slider/index.d.ts +48 -0
  174. package/snack-bar/index.d.ts +374 -0
  175. package/sort/index.d.ts +334 -0
  176. package/spinner/index.d.ts +70 -0
  177. package/stepper/index.d.ts +295 -0
  178. package/table/index.d.ts +395 -0
  179. package/tabs/index.d.ts +307 -0
  180. package/timepicker/index.d.ts +350 -0
  181. package/toolbar/index.d.ts +36 -0
  182. package/tooltip/index.d.ts +299 -0
  183. package/tree/index.d.ts +314 -0
@@ -0,0 +1,477 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, AfterViewChecked, OnDestroy, ErrorHandler, Optional } from '@angular/core';
3
+ import { CuteBaseControl } from '@cute-widgets/base/abstract';
4
+ import { RichThemeColor, RelativeSize3, toColorCssClass } from '@cute-widgets/base/core';
5
+ import { HttpClient } from '@angular/common/http';
6
+ import { SafeResourceUrl, SafeHtml, DomSanitizer } from '@angular/platform-browser';
7
+ import { Observable } from 'rxjs';
8
+
9
+ /**
10
+ * @license Apache-2.0
11
+ *
12
+ * Copyright (c) 2025 CuteWidgets Team. All Rights Reserved.
13
+ *
14
+ * You may not use this file except in compliance with the License
15
+ * that can be found at http://www.apache.org/licenses/LICENSE-2.0
16
+ *
17
+ * This code is a modification of the `@angular/material` original
18
+ * code licensed under MIT-style License (https://angular.dev/license).
19
+ */
20
+
21
+ /** Default options for `cute-icon`. */
22
+ interface CuteIconDefaultOptions {
23
+ /** Default color of the icon. */
24
+ color?: RichThemeColor;
25
+ /** Font set that the icon is a part of. */
26
+ fontSet?: string;
27
+ }
28
+ /** Injection token to be used to override the default options for `cute-icon`. */
29
+ declare const CUTE_ICON_DEFAULT_OPTIONS: InjectionToken<CuteIconDefaultOptions>;
30
+ /**
31
+ * Injection token used to provide the current location to `CuteIcon`.
32
+ * Used to handle server-side rendering and to stub out during unit tests.
33
+ */
34
+ declare const CUTE_ICON_LOCATION: InjectionToken<CuteIconLocation>;
35
+ /**
36
+ * Stubbed out location for `CuteIcon`.
37
+ */
38
+ interface CuteIconLocation {
39
+ getPathname: () => string;
40
+ }
41
+ /** @docs-private */
42
+ declare function CUTE_ICON_LOCATION_FACTORY(): CuteIconLocation;
43
+ /**
44
+ * Component to display an icon. It can be used in the following ways:
45
+ *
46
+ * - Specify the svgIcon input to load an SVG icon from a URL previously registered with the
47
+ * addSvgIcon, addSvgIconInNamespace, addSvgIconSet, or addSvgIconSetInNamespace methods of
48
+ * CuteIconRegistry. If the svgIcon value contains a colon, it is assumed to be in the format
49
+ * "[namespace]:[name]", if not, the value will be the name of an icon in the default namespace.
50
+ * Examples:
51
+ * `<cute-icon svgIcon="left-arrow"></cute-icon>
52
+ * <cute-icon svgIcon="animals:cat"></cute-icon>`
53
+ *
54
+ * - Use a font ligature as an icon by putting the ligature text in the `fontIcon` attribute or the
55
+ * content of the `<cute-icon>` component. If you register a custom font class, remember to also
56
+ * include the special class `cute-ligature-font`. It is recommended to use the attribute alternative
57
+ * to prevent the ligature text from being selectable and to appear in search engine results.
58
+ * By default, the `bootstrap-icons` font family is used as described at
59
+ * https://icons.getbootstrap.com#install. You can specify an
60
+ * alternate font by setting the fontSet input to either the CSS class to apply to use the
61
+ * desired font, or to an alias previously registered with CuteIconRegistry.registerFontClassAlias.
62
+ * Examples:
63
+ * `<cute-icon fontIcon="home"></cute-icon>
64
+ * <cute-icon>home</cute-icon>
65
+ * <cute-icon fontSet="myfont" fontIcon="sun"></cute-icon>
66
+ * <cute-icon fontSet="myfont">sun</cute-icon>`
67
+ * <cute-icon fontIcon="myFont:sun"></cute-icon>
68
+ *
69
+ * - Specify a font glyph to be included via CSS rules by setting the fontSet input to specify the
70
+ * font, and the fontIcon input to specify the icon. Typically, the fontIcon will specify a
71
+ * CSS class which causes the glyph to be displayed via a :before selector, as in
72
+ * https://fortawesome.github.io/Font-Awesome/examples/
73
+ * Example:
74
+ * `<cute-icon fontSet="fa-solid" fontIcon="fa-user"></cute-icon>`
75
+ */
76
+ declare class CuteIcon extends CuteBaseControl implements AfterViewChecked {
77
+ private _iconRegistry;
78
+ private _location;
79
+ private readonly _errorHandler;
80
+ protected _textContentChanged: boolean;
81
+ /**
82
+ * Whether the icon should be inlined, automatically sizing the icon to match the font size of
83
+ * the element the icon is contained in.
84
+ */
85
+ get inline(): boolean;
86
+ set inline(inline: boolean);
87
+ private _inline;
88
+ /** Name of the icon in the SVG icon set. */
89
+ get svgIcon(): string | undefined;
90
+ set svgIcon(value: string | undefined);
91
+ private _svgIcon;
92
+ /** Font set that the icon is a part of. */
93
+ get fontSet(): string | undefined;
94
+ set fontSet(value: string | undefined);
95
+ private _fontSet;
96
+ /** Name of an icon within a font set. */
97
+ get fontIcon(): string | undefined;
98
+ set fontIcon(value: string | undefined);
99
+ private _fontIcon;
100
+ /** Should the font icon name be automatically prefixed if it is not explicitly specified for not `cute-ligature-font` fonts. */
101
+ autoPrefix: boolean;
102
+ /** Angle of rotation in degrees. */
103
+ rotation: number;
104
+ /** Whether to display an icon as a rounded square feature icon. */
105
+ featureIcon: RelativeSize3 | "" | undefined;
106
+ private _previousFontSetClass;
107
+ private _previousFontIconClass;
108
+ protected _fontIconPrefixed: string | undefined;
109
+ _svgName: string | null;
110
+ _svgNamespace: string | null;
111
+ /** Keeps track of the current page path. */
112
+ private _previousPath?;
113
+ /** Keeps track of the elements and attributes that we've prefixed with the current path. */
114
+ private _elementsWithExternalReferences?;
115
+ /** Subscription to the current in-progress SVG icon request. */
116
+ private _currentIconFetch;
117
+ constructor(...args: unknown[]);
118
+ protected generateId(): string;
119
+ /**
120
+ * Splits an svgIcon binding value into its icon set and icon name components.
121
+ * Returns a 2-element array of [(icon set), (icon name)].
122
+ * The separator for the two fields is ':'. If there is no separator, an empty
123
+ * string is returned for the icon set and the entire value is returned for
124
+ * the icon name. If the argument is falsy, returns an array of two empty strings.
125
+ * Throws an error if the name contains two or more ':' separators.
126
+ * Examples:
127
+ * `'social:cake' -> ['social', 'cake']
128
+ * 'penguin' -> ['', 'penguin']
129
+ * null -> ['', '']
130
+ * 'a:b:c' -> (throws Error)`
131
+ */
132
+ private _splitIconName;
133
+ ngOnInit(): void;
134
+ ngAfterViewChecked(): void;
135
+ ngOnDestroy(): void;
136
+ protected _usingFontIcon(): boolean;
137
+ private _setSvgElement;
138
+ private _clearSvgElement;
139
+ private _updateFontIconClasses;
140
+ /**
141
+ * Cleans up a value to be used as a fontIcon or fontSet.
142
+ * Since the value ends up being assigned as a CSS class, we
143
+ * have to trim the value and omit space-separated values.
144
+ */
145
+ private _cleanupFontValue;
146
+ /**
147
+ * Prepends the current path to all elements that have an attribute pointing to a `FuncIRI`
148
+ * reference. This is required because WebKit browsers require references to be prefixed with
149
+ * the current path if the page has a `base` tag.
150
+ */
151
+ private _prependPathToReferences;
152
+ /**
153
+ * Caches the children of an SVG element that have `url()`
154
+ * references that we need to prefix with the current path.
155
+ */
156
+ private _cacheChildrenWithExternalReferences;
157
+ /** Sets a new SVG icon with a particular name. */
158
+ private _updateSvgIcon;
159
+ protected readonly toColorCssClass: typeof toColorCssClass;
160
+ static ɵfac: i0.ɵɵFactoryDeclaration<CuteIcon, never>;
161
+ static ɵcmp: i0.ɵɵComponentDeclaration<CuteIcon, "cute-icon", ["cuteIcon"], { "color": { "alias": "color"; "required": false; }; "inline": { "alias": "inline"; "required": false; }; "svgIcon": { "alias": "svgIcon"; "required": false; }; "fontSet": { "alias": "fontSet"; "required": false; }; "fontIcon": { "alias": "fontIcon"; "required": false; }; "autoPrefix": { "alias": "autoPrefix"; "required": false; }; "rotation": { "alias": "rotation"; "required": false; }; "featureIcon": { "alias": "featureIcon"; "required": false; }; }, {}, never, ["*"], true, never>;
162
+ static ngAcceptInputType_inline: unknown;
163
+ static ngAcceptInputType_autoPrefix: unknown;
164
+ static ngAcceptInputType_rotation: unknown;
165
+ }
166
+
167
+ /**
168
+ * @license Apache-2.0
169
+ *
170
+ * Copyright (c) 2025 CuteWidgets Team. All Rights Reserved.
171
+ *
172
+ * You may not use this file except in compliance with the License
173
+ * that can be found at http://www.apache.org/licenses/LICENSE-2.0
174
+ *
175
+ * This code is a modification of the `@angular/material` original
176
+ * code licensed under MIT-style License (https://angular.dev/license).
177
+ */
178
+
179
+ /** Material icons font CSS classes */
180
+ declare const FS_MATERIAL_ICONS: string[];
181
+ /** Bootstrap icons font CSS classes */
182
+ declare const FS_BOOTSTRAP_ICONS: string[];
183
+ /** FontAwesome icons font CSS classes */
184
+ declare const FS_FONTAWESOME_ICONS: string[];
185
+ /** FontAwesome solid icons font CSS classes */
186
+ declare const FS_FONTAWESOME_SOLID: string[];
187
+ /** FontAwesome regular icons font CSS classes */
188
+ declare const FS_FONTAWESOME_REGULAR: string[];
189
+ /** FontAwesome brand icons font CSS classes */
190
+ declare const FS_FONTAWESOME_BRAND: string[];
191
+ /**
192
+ * Returns an exception to be thrown in the case when attempting to
193
+ * load an icon with a name that cannot be found.
194
+ */
195
+ declare function getCuteIconNameNotFoundError(iconName: string): Error;
196
+ /**
197
+ * Returns an exception to be thrown when the consumer attempts to use
198
+ * `<cute-icon>` without including @angular/common/http.
199
+ */
200
+ declare function getCuteIconNoHttpProviderError(): Error;
201
+ /**
202
+ * Returns an exception to be thrown when a URL couldn't be sanitized.
203
+ * @param url URL that was attempted to be sanitized.
204
+ */
205
+ declare function getCuteIconFailedToSanitizeUrlError(url: SafeResourceUrl): Error;
206
+ /**
207
+ * Returns an exception to be thrown when a HTML string couldn't be sanitized.
208
+ * @param literal HTML that was attempted to be sanitized.
209
+ */
210
+ declare function getCuteIconFailedToSanitizeLiteralError(literal: SafeHtml): Error;
211
+ /** Options that can be used to configure how an icon or the icons in an icon set are presented. */
212
+ interface IconOptions {
213
+ /** View box to set on the icon. */
214
+ viewBox?: string;
215
+ /** Whether to fetch the icon or icon set using HTTP credentials. */
216
+ withCredentials?: boolean;
217
+ /** The horizontal size of the icon. */
218
+ width?: string;
219
+ /** The vertical size of the icon. */
220
+ height?: string;
221
+ }
222
+ /**
223
+ * Function that will be invoked by the icon registry when trying to resolve the
224
+ * URL from which to fetch an icon. The returned URL will be used to make a request for the icon.
225
+ */
226
+ type IconResolver = (name: string, namespace: string) => SafeResourceUrl | SafeResourceUrlWithIconOptions | null;
227
+ /** Object that specifies a URL from which to fetch an icon and the options to use for it. */
228
+ interface SafeResourceUrlWithIconOptions {
229
+ url: SafeResourceUrl;
230
+ options: IconOptions;
231
+ }
232
+ /**
233
+ * Service to register and display icons used by the `<cute-icon>` component.
234
+ * - Registers icon URLs by namespace and name.
235
+ * - Registers icon set URLs by namespace.
236
+ * - Registers aliases for CSS classes, for use with icon fonts.
237
+ * - Loads icons from URLs and extracts individual icons from icon sets.
238
+ */
239
+ declare class CuteIconRegistry implements OnDestroy {
240
+ private _httpClient;
241
+ private _sanitizer;
242
+ private readonly _errorHandler;
243
+ private _document;
244
+ /**
245
+ * URLs and cached SVG elements for individual icons. Keys are of the format "[namespace]:[icon]".
246
+ */
247
+ private _svgIconConfigs;
248
+ /**
249
+ * SvgIconConfig objects and cached SVG elements for icon sets, keyed by namespace.
250
+ * Multiple icon sets can be registered under the same namespace.
251
+ */
252
+ private _iconSetConfigs;
253
+ /** Cache for icons loaded by direct URLs. */
254
+ private _cachedIconsByUrl;
255
+ /** In-progress icon fetches. Used to coalesce multiple requests to the same URL. */
256
+ private _inProgressUrlFetches;
257
+ /** Map from font identifiers to their CSS class names. Used for icon fonts. */
258
+ private _fontCssClassesByAlias;
259
+ /** Registered icon resolver functions. */
260
+ private _resolvers;
261
+ /**
262
+ * The CSS classes to apply when a `<cute-icon>` component has no icon name, url, or font
263
+ * specified. The default 'bootstrap-icons' value assumes that the bootstrap's icon font has been
264
+ * loaded as described at https://icons.getbootstrap.com/?q=home#usage
265
+ */
266
+ private _defaultFontSetClass;
267
+ constructor(_httpClient: HttpClient, _sanitizer: DomSanitizer, document: any, _errorHandler: ErrorHandler);
268
+ /**
269
+ * Registers an icon by URL in the default namespace.
270
+ * @param iconName Name under which the icon should be registered.
271
+ * @param url A value that's safe to use as a URL to load SVG icon
272
+ * @param options Icon's configuration options
273
+ */
274
+ addSvgIcon(iconName: string, url: SafeResourceUrl, options?: IconOptions): this;
275
+ /**
276
+ * Registers an icon using an HTML string in the default namespace.
277
+ * @param iconName Name under which the icon should be registered.
278
+ * @param literal SVG source of the icon.
279
+ * @param options Icon's configuration options
280
+ */
281
+ addSvgIconLiteral(iconName: string, literal: SafeHtml, options?: IconOptions): this;
282
+ /**
283
+ * Registers an icon by URL in the specified namespace.
284
+ * @param namespace Namespace in which the icon should be registered.
285
+ * @param iconName Name under which the icon should be registered.
286
+ * @param url A value that's safe to use as a URL to load SVG icon
287
+ * @param options Icon's configuration options
288
+ */
289
+ addSvgIconInNamespace(namespace: string, iconName: string, url: SafeResourceUrl, options?: IconOptions): this;
290
+ /**
291
+ * Registers an icon resolver function with the registry. The function will be invoked with the
292
+ * name and namespace of an icon when the registry tries to resolve the URL from which to fetch
293
+ * the icon. The resolver is expected to return a `SafeResourceUrl` that points to the icon,
294
+ * an object with the icon URL and icon options, or `null` if the icon is not supported. Resolvers
295
+ * will be invoked in the order in which they have been registered.
296
+ * @param resolver Resolver function to be registered.
297
+ */
298
+ addSvgIconResolver(resolver: IconResolver): this;
299
+ /**
300
+ * Registers an icon using an HTML string in the specified namespace.
301
+ * @param namespace Namespace in which the icon should be registered.
302
+ * @param iconName Name under which the icon should be registered.
303
+ * @param literal SVG source of the icon.
304
+ * @param options Configurable options for the icon
305
+ */
306
+ addSvgIconLiteralInNamespace(namespace: string, iconName: string, literal: SafeHtml, options?: IconOptions): this;
307
+ /**
308
+ * Registers an icon set by URL in the default namespace.
309
+ * @param url URL of an icon set
310
+ * @param options Configurable options
311
+ */
312
+ addSvgIconSet(url: SafeResourceUrl, options?: IconOptions): this;
313
+ /**
314
+ * Registers an icon set using an HTML string in the default namespace.
315
+ * @param literal SVG source of the icon set.
316
+ * @param options Configurable options
317
+ */
318
+ addSvgIconSetLiteral(literal: SafeHtml, options?: IconOptions): this;
319
+ /**
320
+ * Registers an icon set by URL in the specified namespace.
321
+ * @param namespace Namespace in which to register the icon set.
322
+ * @param url URL of an icon set
323
+ * @param options
324
+ */
325
+ addSvgIconSetInNamespace(namespace: string, url: SafeResourceUrl, options?: IconOptions): this;
326
+ /**
327
+ * Registers an icon set using an HTML string in the specified namespace.
328
+ * @param namespace Namespace in which to register the icon set.
329
+ * @param literal SVG source of the icon set.
330
+ * @param options
331
+ */
332
+ addSvgIconSetLiteralInNamespace(namespace: string, literal: SafeHtml, options?: IconOptions): this;
333
+ /**
334
+ * Defines an alias for CSS class names to be used for icon fonts. Creating a `cuteIcon`
335
+ * component with the alias as the `fontSet` input will cause the class name to be applied
336
+ * to the `<cute-icon>` element.
337
+ *
338
+ * If the registered font is a ligature font, then remember to also include the special
339
+ * class `cute-ligature-font` to allow the usage via attribute. So register like this:
340
+ *
341
+ * ```ts
342
+ * iconRegistry.registerFontClassAlias('f1', 'font1 cute-ligature-font');
343
+ * ```
344
+ *
345
+ * And use like this:
346
+ *
347
+ * ```html
348
+ * <cute-icon fontSet="f1" fontIcon="home"></cute-icon>
349
+ * ```
350
+ *
351
+ * @param alias Alias for the font.
352
+ * @param classNames Class names override to be used instead of the alias.
353
+ */
354
+ registerFontClassAlias(alias: string, classNames?: string): this;
355
+ /**
356
+ * Returns the CSS class name associated with the alias by a previous call to
357
+ * registerFontClassAlias. If no CSS class has been associated, returns the alias unmodified.
358
+ */
359
+ classNameForFontAlias(alias: string): string;
360
+ /**
361
+ * Sets the CSS classes to be used for icon fonts when a `<cute-icon>` component does not
362
+ * have a fontSet input value, and is not loading an icon by name or URL.
363
+ */
364
+ setDefaultFontSetClass(...classNames: string[]): this;
365
+ /**
366
+ * Returns the CSS classes to be used for icon fonts when a `<cute-icon>` component does not
367
+ * have a fontSet input value, and is not loading an icon by name or URL.
368
+ */
369
+ getDefaultFontSetClass(): string[];
370
+ /**
371
+ * Returns an Observable that produces the icon (as an `<svg>` DOM element) from the given URL.
372
+ * The response from the URL may be cached so this will not always cause an HTTP request, but
373
+ * the produced element will always be a new copy of the originally fetched icon. (That is,
374
+ * it will not contain any modifications made to elements previously returned).
375
+ *
376
+ * @param safeUrl URL from which to fetch the SVG icon.
377
+ */
378
+ getSvgIconFromUrl(safeUrl: SafeResourceUrl): Observable<SVGElement>;
379
+ /**
380
+ * Returns an Observable that produces the icon (as an `<svg>` DOM element) with the given name
381
+ * and namespace. The icon must have been previously registered with addIcon or addIconSet;
382
+ * if not, the Observable will throw an error.
383
+ *
384
+ * @param name Name of the icon to be retrieved.
385
+ * @param namespace Namespace in which to look for the icon.
386
+ */
387
+ getNamedSvgIcon(name: string, namespace?: string): Observable<SVGElement>;
388
+ ngOnDestroy(): void;
389
+ /**
390
+ * Returns the cached icon for a SvgIconConfig if available, or fetches it from its URL if not.
391
+ */
392
+ private _getSvgFromConfig;
393
+ /**
394
+ * Attempts to find an icon with the specified name in any of the SVG icon sets.
395
+ * First search the available cached icons for a nested element with a matching name, and
396
+ * if found copies the element to a new `<svg>` element. If not found, fetches all icon sets
397
+ * that have not been cached, and searches again after all fetches are completed.
398
+ * The returned Observable produces the SVG element if possible, and throws
399
+ * an error if no icon with the specified name can be found.
400
+ */
401
+ private _getSvgFromIconSetConfigs;
402
+ /**
403
+ * Searches the cached SVG elements for the given icon sets for a nested icon element whose "id"
404
+ * tag matches the specified name. If found, copies the nested element to a new SVG element and
405
+ * returns it. Returns null if no matching element is found.
406
+ */
407
+ private _extractIconWithNameFromAnySet;
408
+ /**
409
+ * Loads the content of the icon URL specified in the SvgIconConfig and creates an SVG element
410
+ * from it.
411
+ */
412
+ private _loadSvgIconFromConfig;
413
+ /**
414
+ * Loads the content of the icon set URL specified in the
415
+ * SvgIconConfig and attaches it to the config.
416
+ */
417
+ private _loadSvgIconSetFromConfig;
418
+ /**
419
+ * Searches the cached element of the given SvgIconConfig for a nested icon element whose "id"
420
+ * tag matches the specified name. If found, copies the nested element to a new SVG element and
421
+ * returns it. Returns null if no matching element is found.
422
+ */
423
+ private _extractSvgIconFromSet;
424
+ /**
425
+ * Creates a DOM element from the given SVG string.
426
+ */
427
+ private _svgElementFromString;
428
+ /**
429
+ * Converts an element into an SVG node by cloning all of its children.
430
+ */
431
+ private _toSvgElement;
432
+ /**
433
+ * Sets the default attributes for an SVG element to be used as an icon.
434
+ */
435
+ private _setSvgAttributes;
436
+ /**
437
+ * Returns an Observable which produces the string contents of the given icon. Results may be
438
+ * cached, so future calls with the same URL may not cause another HTTP request.
439
+ */
440
+ private _fetchIcon;
441
+ /**
442
+ * Registers an icon config by name in the specified namespace.
443
+ * @param namespace Namespace in which to register the icon config.
444
+ * @param iconName Name under which to register the config.
445
+ * @param config Config to be registered.
446
+ */
447
+ private _addSvgIconConfig;
448
+ /**
449
+ * Registers an icon set config in the specified namespace.
450
+ * @param namespace Namespace in which to register the icon config.
451
+ * @param config Config to be registered.
452
+ */
453
+ private _addSvgIconSetConfig;
454
+ /** Parses a config's text into an SVG element. */
455
+ private _svgElementFromConfig;
456
+ /** Tries to create an icon config through the registered resolver functions. */
457
+ private _getIconConfigFromResolvers;
458
+ static ɵfac: i0.ɵɵFactoryDeclaration<CuteIconRegistry, [{ optional: true; }, null, { optional: true; }, null]>;
459
+ static ɵprov: i0.ɵɵInjectableDeclaration<CuteIconRegistry>;
460
+ }
461
+ /** @docs-private */
462
+ declare function CUTE_ICON_REGISTRY_PROVIDER_FACTORY(parentRegistry: CuteIconRegistry, httpClient: HttpClient, sanitizer: DomSanitizer, errorHandler: ErrorHandler, document?: any): CuteIconRegistry;
463
+ /** @docs-private */
464
+ declare const CUTE_ICON_REGISTRY_PROVIDER: {
465
+ provide: typeof CuteIconRegistry;
466
+ deps: (Optional[] | typeof DomSanitizer | typeof ErrorHandler)[];
467
+ useFactory: typeof CUTE_ICON_REGISTRY_PROVIDER_FACTORY;
468
+ };
469
+
470
+ declare class CuteIconModule {
471
+ static ɵfac: i0.ɵɵFactoryDeclaration<CuteIconModule, never>;
472
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CuteIconModule, never, [typeof CuteIcon], [typeof CuteIcon]>;
473
+ static ɵinj: i0.ɵɵInjectorDeclaration<CuteIconModule>;
474
+ }
475
+
476
+ export { CUTE_ICON_DEFAULT_OPTIONS, CUTE_ICON_LOCATION, CUTE_ICON_LOCATION_FACTORY, CUTE_ICON_REGISTRY_PROVIDER, CUTE_ICON_REGISTRY_PROVIDER_FACTORY, CuteIcon, CuteIconModule, CuteIconRegistry, FS_BOOTSTRAP_ICONS, FS_FONTAWESOME_BRAND, FS_FONTAWESOME_ICONS, FS_FONTAWESOME_REGULAR, FS_FONTAWESOME_SOLID, FS_MATERIAL_ICONS, getCuteIconFailedToSanitizeLiteralError, getCuteIconFailedToSanitizeUrlError, getCuteIconNameNotFoundError, getCuteIconNoHttpProviderError };
477
+ export type { CuteIconDefaultOptions, CuteIconLocation, IconOptions, IconResolver, SafeResourceUrlWithIconOptions };
package/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ declare const CUTE_WIDGETS_VERSION: string;
2
+
3
+ export { CUTE_WIDGETS_VERSION };