@taiga-ui/core 4.52.0-canary.a4e325d → 4.52.0-canary.e10b718
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/components/button/button.options.d.ts +1 -1
- package/components/dialog/active-zone-adapter.directive.d.ts +11 -0
- package/components/icon/icon.component.d.ts +6 -11
- package/components/notification/notification.options.d.ts +1 -1
- package/components/root/root.component.d.ts +5 -6
- package/components/scrollbar/scrollbar.options.d.ts +1 -1
- package/components/textfield/textfield-content.directive.d.ts +3 -2
- package/components/textfield/textfield-icon.d.ts +3 -3
- package/components/textfield/textfield.directive.d.ts +1 -1
- package/directives/appearance/appearance.directive.d.ts +5 -13
- package/directives/icons/icons.bindings.d.ts +5 -0
- package/directives/icons/icons.directive.d.ts +8 -16
- package/directives/icons/index.d.ts +1 -0
- package/fesm2022/taiga-ui-core-animations.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-classes.mjs +3 -3
- package/fesm2022/taiga-ui-core-classes.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-alert.mjs +16 -16
- package/fesm2022/taiga-ui-core-components-alert.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-button.mjs +7 -7
- package/fesm2022/taiga-ui-core-components-button.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-calendar.mjs +16 -19
- package/fesm2022/taiga-ui-core-components-calendar.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-data-list.mjs +24 -25
- package/fesm2022/taiga-ui-core-components-data-list.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-dialog.mjs +53 -20
- package/fesm2022/taiga-ui-core-components-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-error.mjs +5 -6
- package/fesm2022/taiga-ui-core-components-error.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-expand.mjs +9 -9
- package/fesm2022/taiga-ui-core-components-expand.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-fullscreen.mjs +15 -4
- package/fesm2022/taiga-ui-core-components-fullscreen.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-icon.mjs +22 -39
- package/fesm2022/taiga-ui-core-components-icon.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-label.mjs +6 -6
- package/fesm2022/taiga-ui-core-components-label.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-link.mjs +7 -7
- package/fesm2022/taiga-ui-core-components-link.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-loader.mjs +5 -6
- package/fesm2022/taiga-ui-core-components-loader.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-notification.mjs +9 -8
- package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-root.mjs +22 -40
- package/fesm2022/taiga-ui-core-components-root.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-scrollbar.mjs +26 -26
- package/fesm2022/taiga-ui-core-components-scrollbar.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-spin-button.mjs +6 -6
- package/fesm2022/taiga-ui-core-components-spin-button.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-textfield.mjs +61 -61
- package/fesm2022/taiga-ui-core-components-textfield.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-appearance.mjs +23 -57
- package/fesm2022/taiga-ui-core-directives-appearance.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-date-format.mjs +3 -3
- package/fesm2022/taiga-ui-core-directives-date-format.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-dropdown.mjs +57 -57
- package/fesm2022/taiga-ui-core-directives-dropdown.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-group.mjs +6 -6
- package/fesm2022/taiga-ui-core-directives-group.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-hint.mjs +51 -51
- package/fesm2022/taiga-ui-core-directives-hint.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-icons.mjs +33 -40
- package/fesm2022/taiga-ui-core-directives-icons.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-items-handlers.mjs +9 -9
- package/fesm2022/taiga-ui-core-directives-items-handlers.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-number-format.mjs +3 -3
- package/fesm2022/taiga-ui-core-directives-number-format.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-popup.mjs +9 -9
- package/fesm2022/taiga-ui-core-directives-popup.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-surface.mjs +6 -6
- package/fesm2022/taiga-ui-core-directives-surface.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-title.mjs +6 -6
- package/fesm2022/taiga-ui-core-directives-title.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-auto-color.mjs +3 -3
- package/fesm2022/taiga-ui-core-pipes-auto-color.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs +3 -3
- package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-flag.mjs +3 -3
- package/fesm2022/taiga-ui-core-pipes-flag.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-format-date.mjs +3 -3
- package/fesm2022/taiga-ui-core-pipes-format-date.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-format-number.mjs +3 -3
- package/fesm2022/taiga-ui-core-pipes-format-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-initials.mjs +3 -3
- package/fesm2022/taiga-ui-core-pipes-initials.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-month.mjs +3 -3
- package/fesm2022/taiga-ui-core-pipes-month.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs +3 -3
- package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes.mjs +0 -1
- package/fesm2022/taiga-ui-core-pipes.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-services.mjs +15 -15
- package/fesm2022/taiga-ui-core-services.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-tokens.mjs +18 -27
- package/fesm2022/taiga-ui-core-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-utils-dom.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-utils-format.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs +50 -3
- package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs.map +1 -1
- package/package.json +1 -5
- package/pipes/index.d.ts +0 -1
- package/styles/components/button.less +0 -2
- package/styles/components/icon.less +32 -26
- package/styles/components/icons.less +14 -12
- package/styles/components/link.less +0 -3
- package/styles/mixins/mixins.less +1 -2
- package/styles/mixins/mixins.scss +1 -2
- package/tokens/icon-resolver.d.ts +1 -1
- package/utils/miscellaneous/index.d.ts +1 -0
- package/utils/miscellaneous/provide-taiga.d.ts +13 -0
- package/fesm2022/taiga-ui-core-pipes-fallback-src.mjs +0 -29
- package/fesm2022/taiga-ui-core-pipes-fallback-src.mjs.map +0 -1
- package/pipes/fallback-src/fallback-src.pipe.d.ts +0 -9
- package/pipes/fallback-src/index.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-utils-format.mjs","sources":["../../../projects/core/utils/format/number-to-string-without-exp.ts","../../../projects/core/utils/format/get-fractional-part-padded.ts","../../../projects/core/utils/format/format-number.ts","../../../projects/core/utils/format/string-hash-to-hsl.ts","../../../projects/core/utils/format/taiga-ui-core-utils-format.ts"],"sourcesContent":["/**\n * Convert number to string with replacing exponent part on decimals\n *\n * @param value the number\n * @return string representation of a number\n */\nexport function tuiNumberToStringWithoutExp(value: number): string {\n const valueAsString = String(value);\n const [numberPart, expPart] = valueAsString.split('e-');\n\n let valueWithoutExp = valueAsString;\n\n if (expPart) {\n const [, fractionalPart = ''] = numberPart?.split('.') ?? [];\n const decimalDigits = Number(expPart) + (fractionalPart?.length || 0);\n\n valueWithoutExp = value.toFixed(decimalDigits);\n }\n\n return valueWithoutExp;\n}\n","import {tuiIsNumber} from '@taiga-ui/cdk/utils/miscellaneous';\n\nimport {tuiNumberToStringWithoutExp} from './number-to-string-without-exp';\n\n/**\n * Return fractional part of number\n *\n * @param value the number\n * @param precision number of digits of decimal part, null to keep untouched\n * @return the fractional part of number\n */\nexport function tuiGetFractionPartPadded(\n value: number,\n precision?: number | null,\n): string {\n const [, fractionPartPadded = ''] = tuiNumberToStringWithoutExp(value).split('.');\n\n return tuiIsNumber(precision)\n ? fractionPartPadded.slice(0, Math.max(0, precision))\n : fractionPartPadded;\n}\n","import {CHAR_HYPHEN} from '@taiga-ui/cdk/constants';\nimport {tuiRoundWith} from '@taiga-ui/cdk/utils/math';\nimport {\n TUI_DEFAULT_NUMBER_FORMAT,\n type TuiNumberFormatSettings,\n} from '@taiga-ui/core/tokens';\n\nimport {tuiGetFractionPartPadded} from './get-fractional-part-padded';\n\n/**\n * Formats number adding a thousand separators and correct decimal separator\n * padding decimal part with zeroes to given length\n *\n * @param value the input number\n * @param settings See {@link TuiNumberFormatSettings}\n * @return the formatted string\n */\nexport function tuiFormatNumber(\n value: number,\n settings: Partial<TuiNumberFormatSettings> = {},\n): string {\n const {precision, decimalSeparator, thousandSeparator, decimalMode, rounding} = {\n ...TUI_DEFAULT_NUMBER_FORMAT,\n decimalMode: 'always',\n precision: Infinity,\n ...settings,\n };\n\n const rounded = Number.isFinite(precision)\n ? tuiRoundWith({value, precision, method: rounding})\n : value;\n const integerPartString = String(Math.floor(Math.abs(rounded)));\n\n let fractionPartPadded = tuiGetFractionPartPadded(rounded, precision);\n const hasFraction = Number(fractionPartPadded) > 0;\n\n if (Number.isFinite(precision)) {\n if (decimalMode === 'always' || (hasFraction && decimalMode === 'pad')) {\n const zeroPaddingSize: number = Math.max(\n precision - fractionPartPadded.length,\n 0,\n );\n const zeroPartString = '0'.repeat(zeroPaddingSize);\n\n fractionPartPadded = `${fractionPartPadded}${zeroPartString}`;\n } else {\n fractionPartPadded = fractionPartPadded.replace(/0*$/, '');\n }\n }\n\n const remainder = integerPartString.length % 3;\n const sign = value < 0 ? CHAR_HYPHEN : '';\n let result = sign + integerPartString.charAt(0);\n\n for (let i = 1; i < integerPartString.length; i++) {\n if (i % 3 === remainder && integerPartString.length > 3) {\n result += thousandSeparator;\n }\n\n result += integerPartString.charAt(i);\n }\n\n return fractionPartPadded ? result + decimalSeparator + fractionPartPadded : result;\n}\n","/**\n * Converts a string to an HSL color\n * @param value string to convert\n * @return HSL color string\n */\n// @bad TODO: convert stringHashToHsl to stringHashToRgb\nexport function tuiStringHashToHsl(value: string): string {\n if (value === '') {\n return '';\n }\n\n let hash = 0;\n\n for (let i = 0; i < value.length; i++) {\n hash = value.charCodeAt(i) + ((hash << 5) - hash);\n hash &= hash;\n }\n\n const hue = hash % 360;\n const saturation = 60 + (hash % 5);\n const lightness = 80 + (hash % 5);\n\n return `hsl(${hue},${saturation}%,${lightness}%)`;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AACG,SAAU,2BAA2B,CAAC,KAAa,EAAA;AACrD,IAAA,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC;AACnC,IAAA,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC;IAEvD,IAAI,eAAe,GAAG,aAAa;IAEnC,IAAI,OAAO,EAAE;AACT,QAAA,MAAM,GAAG,cAAc,GAAG,EAAE,CAAC,GAAG,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE;AAC5D,QAAA,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,cAAc,EAAE,MAAM,IAAI,CAAC,CAAC;AAErE,QAAA,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-utils-format.mjs","sources":["../../../projects/core/utils/format/number-to-string-without-exp.ts","../../../projects/core/utils/format/get-fractional-part-padded.ts","../../../projects/core/utils/format/format-number.ts","../../../projects/core/utils/format/string-hash-to-hsl.ts","../../../projects/core/utils/format/taiga-ui-core-utils-format.ts"],"sourcesContent":["/**\n * Convert number to string with replacing exponent part on decimals\n *\n * @param value the number\n * @return string representation of a number\n */\nexport function tuiNumberToStringWithoutExp(value: number): string {\n const valueAsString = String(value);\n const [numberPart, expPart] = valueAsString.split('e-');\n\n let valueWithoutExp = valueAsString;\n\n if (expPart) {\n const [, fractionalPart = ''] = numberPart?.split('.') ?? [];\n const decimalDigits = Number(expPart) + (fractionalPart?.length || 0);\n\n valueWithoutExp = value.toFixed(decimalDigits);\n }\n\n return valueWithoutExp;\n}\n","import {tuiIsNumber} from '@taiga-ui/cdk/utils/miscellaneous';\n\nimport {tuiNumberToStringWithoutExp} from './number-to-string-without-exp';\n\n/**\n * Return fractional part of number\n *\n * @param value the number\n * @param precision number of digits of decimal part, null to keep untouched\n * @return the fractional part of number\n */\nexport function tuiGetFractionPartPadded(\n value: number,\n precision?: number | null,\n): string {\n const [, fractionPartPadded = ''] = tuiNumberToStringWithoutExp(value).split('.');\n\n return tuiIsNumber(precision)\n ? fractionPartPadded.slice(0, Math.max(0, precision))\n : fractionPartPadded;\n}\n","import {CHAR_HYPHEN} from '@taiga-ui/cdk/constants';\nimport {tuiRoundWith} from '@taiga-ui/cdk/utils/math';\nimport {\n TUI_DEFAULT_NUMBER_FORMAT,\n type TuiNumberFormatSettings,\n} from '@taiga-ui/core/tokens';\n\nimport {tuiGetFractionPartPadded} from './get-fractional-part-padded';\n\n/**\n * Formats number adding a thousand separators and correct decimal separator\n * padding decimal part with zeroes to given length\n *\n * @param value the input number\n * @param settings See {@link TuiNumberFormatSettings}\n * @return the formatted string\n */\nexport function tuiFormatNumber(\n value: number,\n settings: Partial<TuiNumberFormatSettings> = {},\n): string {\n const {precision, decimalSeparator, thousandSeparator, decimalMode, rounding} = {\n ...TUI_DEFAULT_NUMBER_FORMAT,\n decimalMode: 'always',\n precision: Infinity,\n ...settings,\n };\n\n const rounded = Number.isFinite(precision)\n ? tuiRoundWith({value, precision, method: rounding})\n : value;\n const integerPartString = String(Math.floor(Math.abs(rounded)));\n\n let fractionPartPadded = tuiGetFractionPartPadded(rounded, precision);\n const hasFraction = Number(fractionPartPadded) > 0;\n\n if (Number.isFinite(precision)) {\n if (decimalMode === 'always' || (hasFraction && decimalMode === 'pad')) {\n const zeroPaddingSize: number = Math.max(\n precision - fractionPartPadded.length,\n 0,\n );\n const zeroPartString = '0'.repeat(zeroPaddingSize);\n\n fractionPartPadded = `${fractionPartPadded}${zeroPartString}`;\n } else {\n fractionPartPadded = fractionPartPadded.replace(/0*$/, '');\n }\n }\n\n const remainder = integerPartString.length % 3;\n const sign = value < 0 ? CHAR_HYPHEN : '';\n let result = sign + integerPartString.charAt(0);\n\n for (let i = 1; i < integerPartString.length; i++) {\n if (i % 3 === remainder && integerPartString.length > 3) {\n result += thousandSeparator;\n }\n\n result += integerPartString.charAt(i);\n }\n\n return fractionPartPadded ? result + decimalSeparator + fractionPartPadded : result;\n}\n","/**\n * Converts a string to an HSL color\n * @param value string to convert\n * @return HSL color string\n */\n// @bad TODO: convert stringHashToHsl to stringHashToRgb\nexport function tuiStringHashToHsl(value: string): string {\n if (value === '') {\n return '';\n }\n\n let hash = 0;\n\n for (let i = 0; i < value.length; i++) {\n hash = value.charCodeAt(i) + ((hash << 5) - hash);\n hash &= hash;\n }\n\n const hue = hash % 360;\n const saturation = 60 + (hash % 5);\n const lightness = 80 + (hash % 5);\n\n return `hsl(${hue},${saturation}%,${lightness}%)`;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AACG,SAAU,2BAA2B,CAAC,KAAa,EAAA;AACrD,IAAA,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC;A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BAAgB,GAAG,kBAAkB,GAAG,MAAM;AACvF;;AC/DA;;;;AAIG;AACH;AACM,SAAU,kBAAkB,CAAC,KAAa,EAAA;AAC5C,IAAA,IAAI,KAAK,KAAK,EAAE,EAAE;AACd,QAAA,OAAO,EAAE;;IAGb,IAAI,IAAI,GAAG,CAAC;AAEZ,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACnC,QAAA,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC;QACjD,IAAI,IAAI,IAAI;;AAGhB,IAAA,MAAM,GAAG,GAAG,IAAI,GAAG,GAAG;IACtB,MAAM,UAAU,GAAG,EAAE,IAAI,IAAI,GAAG,CAAC,CAAC;IAClC,MAAM,SAAS,GAAG,EAAE,IAAI,IAAI,GAAG,CAAC,CAAC;AAEjC,IAAA,OAAO,OAAO,GAAG,CAAA,CAAA,EAAI,UAAU,CAAK,EAAA,EAAA,SAAS,IAAI;AACrD;;ACvBA;;AAEG;;;;"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { DOCUMENT } from '@angular/common';
|
|
2
|
-
import { inject } from '@angular/core';
|
|
2
|
+
import { inject, InjectionToken, provideAppInitializer, effect } from '@angular/core';
|
|
3
3
|
import { TUI_FONT_SIZE_HANDLER } from '@taiga-ui/cdk/directives/font-size';
|
|
4
4
|
import { tuiClamp } from '@taiga-ui/cdk/utils/math';
|
|
5
5
|
import { tuiGetElementObscures } from '@taiga-ui/cdk/utils/dom';
|
|
6
|
-
import {
|
|
6
|
+
import { REMOVE_STYLES_ON_COMPONENT_DESTROY } from '@angular/platform-browser';
|
|
7
|
+
import { tuiIsPresent } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
8
|
+
import { TUI_DARK_MODE, TUI_ANIMATIONS_SPEED } from '@taiga-ui/core/tokens';
|
|
9
|
+
import { provideEventPlugins } from '@taiga-ui/event-plugins';
|
|
7
10
|
|
|
8
11
|
function tuiEnableFontScaling() {
|
|
9
12
|
return {
|
|
@@ -48,6 +51,50 @@ function tuiOverrideOptions(override, fallback) {
|
|
|
48
51
|
};
|
|
49
52
|
}
|
|
50
53
|
|
|
54
|
+
const DEFAULT = {
|
|
55
|
+
apis: 'stable',
|
|
56
|
+
fontScaling: true,
|
|
57
|
+
scrollbars: 'custom',
|
|
58
|
+
};
|
|
59
|
+
const TUI_OPTIONS = new InjectionToken(ngDevMode ? 'TUI_OPTIONS' : '');
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
61
|
+
function provideTaiga(config = {}) {
|
|
62
|
+
const options = { ...DEFAULT, ...config };
|
|
63
|
+
const providers = [
|
|
64
|
+
{
|
|
65
|
+
provide: REMOVE_STYLES_ON_COMPONENT_DESTROY,
|
|
66
|
+
useValue: false,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
provide: TUI_OPTIONS,
|
|
70
|
+
useValue: options,
|
|
71
|
+
},
|
|
72
|
+
provideEventPlugins(),
|
|
73
|
+
provideAppInitializer(() => {
|
|
74
|
+
const doc = inject(DOCUMENT);
|
|
75
|
+
const mode = inject(TUI_DARK_MODE);
|
|
76
|
+
if (options.scrollbars === 'custom') {
|
|
77
|
+
doc.documentElement.classList.add('tui-zero-scrollbar');
|
|
78
|
+
}
|
|
79
|
+
if (tuiIsPresent(options.mode)) {
|
|
80
|
+
mode.set(options.mode === 'dark');
|
|
81
|
+
}
|
|
82
|
+
effect(() => {
|
|
83
|
+
if (mode()) {
|
|
84
|
+
doc.body.setAttribute('tuiTheme', 'dark');
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
doc.body.removeAttribute('tuiTheme');
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}),
|
|
91
|
+
];
|
|
92
|
+
if (options.fontScaling) {
|
|
93
|
+
providers.push(tuiEnableFontScaling());
|
|
94
|
+
}
|
|
95
|
+
return providers;
|
|
96
|
+
}
|
|
97
|
+
|
|
51
98
|
const SIZES = {
|
|
52
99
|
xxs: 0,
|
|
53
100
|
xs: 1,
|
|
@@ -85,5 +132,5 @@ function tuiGetDuration(speed) {
|
|
|
85
132
|
* Generated bundle index. Do not edit.
|
|
86
133
|
*/
|
|
87
134
|
|
|
88
|
-
export { TUI_ANIMATIONS_DEFAULT_DURATION, tuiEnableFontScaling, tuiGetDuration, tuiIsEditingKey, tuiIsObscured, tuiOverrideOptions, tuiSizeBigger, tuiToAnimationOptions };
|
|
135
|
+
export { TUI_ANIMATIONS_DEFAULT_DURATION, TUI_OPTIONS, provideTaiga, tuiEnableFontScaling, tuiGetDuration, tuiIsEditingKey, tuiIsObscured, tuiOverrideOptions, tuiSizeBigger, tuiToAnimationOptions };
|
|
89
136
|
//# sourceMappingURL=taiga-ui-core-utils-miscellaneous.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-utils-miscellaneous.mjs","sources":["../../../projects/core/utils/miscellaneous/font-scaling.ts","../../../projects/core/utils/miscellaneous/is-editing-key.ts","../../../projects/core/utils/miscellaneous/is-obscured.ts","../../../projects/core/utils/miscellaneous/override-options.ts","../../../projects/core/utils/miscellaneous/size-bigger.ts","../../../projects/core/utils/miscellaneous/to-animation-options.ts","../../../projects/core/utils/miscellaneous/taiga-ui-core-utils-miscellaneous.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {inject, type Provider} from '@angular/core';\nimport {TUI_FONT_SIZE_HANDLER} from '@taiga-ui/cdk/directives/font-size';\nimport {tuiClamp} from '@taiga-ui/cdk/utils/math';\n\nexport function tuiEnableFontScaling(): Provider {\n return {\n provide: TUI_FONT_SIZE_HANDLER,\n useFactory:\n ({documentElement} = inject(DOCUMENT)) =>\n (size: number): void =>\n documentElement.style.setProperty(\n '--tui-font-offset',\n `${tuiClamp(size, 17, 28) - 17}px`,\n ),\n };\n}\n","const KEYS: readonly string[] = [\n 'Spacebar',\n 'Backspace',\n 'Delete',\n 'ArrowLeft',\n 'ArrowRight',\n 'Left',\n 'Right',\n 'End',\n 'Home',\n];\n\n/**\n * Check if pressed key is interactive in terms of input field\n */\nexport function tuiIsEditingKey(key = ''): boolean {\n return key.length === 1 || KEYS.includes(key);\n}\n","import {tuiGetElementObscures} from '@taiga-ui/cdk/utils/dom';\n\n/**\n * @internal\n */\nexport function tuiIsObscured(el: HTMLElement, exceptSelector = 'tui-hints'): boolean {\n return !!tuiGetElementObscures(el)?.some((el) => !el.closest(exceptSelector));\n}\n","export function tuiOverrideOptions<T>(\n override: Partial<T>,\n fallback: T,\n): (directive: T | null, options: T | null) => T {\n return (directive, options) => {\n const result: T = directive || {...(options || fallback)};\n\n Object.keys(override).forEach((key) => {\n // Update directive props with new defaults before inputs are processed\n (result as Record<string, unknown>)[key] = override[key as keyof T];\n });\n\n return result;\n };\n}\n","import {type TuiSizeXXL, type TuiSizeXXS} from '@taiga-ui/core/types';\n\nconst SIZES: Record<TuiSizeXXL | TuiSizeXXS, number> = {\n xxs: 0,\n xs: 1,\n s: 2,\n m: 3,\n l: 4,\n xl: 5,\n xxl: 6,\n};\n\n/**\n * Compares size constants to determine if first size is bigger than the second\n *\n * @param size size that we need to compare\n * @param biggerThanSize size to compare with, 's' by default\n */\nexport function tuiSizeBigger(\n size: TuiSizeXXL | TuiSizeXXS,\n biggerThanSize: TuiSizeXXL | TuiSizeXXS = 's',\n): boolean {\n return SIZES[size] > SIZES[biggerThanSize];\n}\n","import {type AnimationOptions} from '@angular/animations';\nimport {inject} from '@angular/core';\nimport {TUI_ANIMATIONS_SPEED} from '@taiga-ui/core/tokens';\n\nexport const TUI_ANIMATIONS_DEFAULT_DURATION = 300;\n\nexport function tuiToAnimationOptions(\n speed: number = inject(TUI_ANIMATIONS_SPEED),\n easing?: string,\n): AnimationOptions {\n return {\n value: '',\n params: {\n duration: tuiGetDuration(speed),\n easing,\n },\n } as unknown as AnimationOptions;\n}\n\nexport function tuiGetDuration(speed: number): number {\n return speed && TUI_ANIMATIONS_DEFAULT_DURATION / speed;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-utils-miscellaneous.mjs","sources":["../../../projects/core/utils/miscellaneous/font-scaling.ts","../../../projects/core/utils/miscellaneous/is-editing-key.ts","../../../projects/core/utils/miscellaneous/is-obscured.ts","../../../projects/core/utils/miscellaneous/override-options.ts","../../../projects/core/utils/miscellaneous/provide-taiga.ts","../../../projects/core/utils/miscellaneous/size-bigger.ts","../../../projects/core/utils/miscellaneous/to-animation-options.ts","../../../projects/core/utils/miscellaneous/taiga-ui-core-utils-miscellaneous.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {inject, type Provider} from '@angular/core';\nimport {TUI_FONT_SIZE_HANDLER} from '@taiga-ui/cdk/directives/font-size';\nimport {tuiClamp} from '@taiga-ui/cdk/utils/math';\n\nexport function tuiEnableFontScaling(): Provider {\n return {\n provide: TUI_FONT_SIZE_HANDLER,\n useFactory:\n ({documentElement} = inject(DOCUMENT)) =>\n (size: number): void =>\n documentElement.style.setProperty(\n '--tui-font-offset',\n `${tuiClamp(size, 17, 28) - 17}px`,\n ),\n };\n}\n","const KEYS: readonly string[] = [\n 'Spacebar',\n 'Backspace',\n 'Delete',\n 'ArrowLeft',\n 'ArrowRight',\n 'Left',\n 'Right',\n 'End',\n 'Home',\n];\n\n/**\n * Check if pressed key is interactive in terms of input field\n */\nexport function tuiIsEditingKey(key = ''): boolean {\n return key.length === 1 || KEYS.includes(key);\n}\n","import {tuiGetElementObscures} from '@taiga-ui/cdk/utils/dom';\n\n/**\n * @internal\n */\nexport function tuiIsObscured(el: HTMLElement, exceptSelector = 'tui-hints'): boolean {\n return !!tuiGetElementObscures(el)?.some((el) => !el.closest(exceptSelector));\n}\n","export function tuiOverrideOptions<T>(\n override: Partial<T>,\n fallback: T,\n): (directive: T | null, options: T | null) => T {\n return (directive, options) => {\n const result: T = directive || {...(options || fallback)};\n\n Object.keys(override).forEach((key) => {\n // Update directive props with new defaults before inputs are processed\n (result as Record<string, unknown>)[key] = override[key as keyof T];\n });\n\n return result;\n };\n}\n","import {DOCUMENT} from '@angular/common';\nimport {\n effect,\n type EnvironmentProviders,\n inject,\n InjectionToken,\n provideAppInitializer,\n type Provider,\n} from '@angular/core';\nimport {REMOVE_STYLES_ON_COMPONENT_DESTROY} from '@angular/platform-browser';\nimport {tuiIsPresent} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_DARK_MODE} from '@taiga-ui/core/tokens';\nimport {provideEventPlugins} from '@taiga-ui/event-plugins';\n\nimport {tuiEnableFontScaling} from './font-scaling';\n\ninterface ExperimentalAPIs {\n readonly all: boolean;\n}\n\nexport interface TuiOptions {\n readonly mode?: 'dark' | 'light';\n readonly apis: Partial<ExperimentalAPIs> | 'stable';\n readonly fontScaling: boolean;\n readonly scrollbars: 'custom' | 'native';\n}\n\nconst DEFAULT: TuiOptions = {\n apis: 'stable',\n fontScaling: true,\n scrollbars: 'custom',\n};\n\nexport const TUI_OPTIONS = new InjectionToken<TuiOptions>(ngDevMode ? 'TUI_OPTIONS' : '');\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function provideTaiga(\n config: Partial<TuiOptions> = {},\n): Array<EnvironmentProviders | Provider> {\n const options = {...DEFAULT, ...config};\n const providers: Array<EnvironmentProviders | Provider> = [\n {\n provide: REMOVE_STYLES_ON_COMPONENT_DESTROY,\n useValue: false,\n },\n {\n provide: TUI_OPTIONS,\n useValue: options,\n },\n provideEventPlugins(),\n provideAppInitializer(() => {\n const doc = inject(DOCUMENT);\n const mode = inject(TUI_DARK_MODE);\n\n if (options.scrollbars === 'custom') {\n doc.documentElement.classList.add('tui-zero-scrollbar');\n }\n\n if (tuiIsPresent(options.mode)) {\n mode.set(options.mode === 'dark');\n }\n\n effect(() => {\n if (mode()) {\n doc.body.setAttribute('tuiTheme', 'dark');\n } else {\n doc.body.removeAttribute('tuiTheme');\n }\n });\n }),\n ];\n\n if (options.fontScaling) {\n providers.push(tuiEnableFontScaling());\n }\n\n return providers;\n}\n","import {type TuiSizeXXL, type TuiSizeXXS} from '@taiga-ui/core/types';\n\nconst SIZES: Record<TuiSizeXXL | TuiSizeXXS, number> = {\n xxs: 0,\n xs: 1,\n s: 2,\n m: 3,\n l: 4,\n xl: 5,\n xxl: 6,\n};\n\n/**\n * Compares size constants to determine if first size is bigger than the second\n *\n * @param size size that we need to compare\n * @param biggerThanSize size to compare with, 's' by default\n */\nexport function tuiSizeBigger(\n size: TuiSizeXXL | TuiSizeXXS,\n biggerThanSize: TuiSizeXXL | TuiSizeXXS = 's',\n): boolean {\n return SIZES[size] > SIZES[biggerThanSize];\n}\n","import {type AnimationOptions} from '@angular/animations';\nimport {inject} from '@angular/core';\nimport {TUI_ANIMATIONS_SPEED} from '@taiga-ui/core/tokens';\n\nexport const TUI_ANIMATIONS_DEFAULT_DURATION = 300;\n\nexport function tuiToAnimationOptions(\n speed: number = inject(TUI_ANIMATIONS_SPEED),\n easing?: string,\n): AnimationOptions {\n return {\n value: '',\n params: {\n duration: tuiGetDuration(speed),\n easing,\n },\n } as unknown as AnimationOptions;\n}\n\nexport function tuiGetDuration(speed: number): number {\n return speed && TUI_ANIMATIONS_DEFAULT_DURATION / speed;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;SAKgB,oBAAoB,GAAA;IAChC,OAAO;AACH,QAAA,OAAO,EAAE,qBAAqB;AAC9B,QAAA,UAAU,EACN,CAAC,EAAC,eAAe,EAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,KACrC,CAAC,IAAY,KACT,eAAe,CAAC,KAAK,CAAC,WAAW,CAC7B,mBAAmB,EACnB,GAAG,QAAQ,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,IAAI,CAC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SACa,aAAa,CACzB,IAA6B,EAC7B,iBAA0C,GAAG,EAAA;IAE7C,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC;AAC9C;;ACnBO,MAAM,+BAA+B,GAAG;AAEzC,SAAU,qBAAqB,CACjC,KAAA,GAAgB,MAAM,CAAC,oBAAoB,CAAC,EAC5C,MAAe,EAAA;IAEf,OAAO;AACH,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,MAAM,EAAE;AACJ,YAAA,QAAQ,EAAE,cAAc,CAAC,KAAK,CAAC;YAC/B,MAAM;AACT,SAAA;KAC2B;AACpC;AAEM,SAAU,cAAc,CAAC,KAAa,EAAA;AACxC,IAAA,OAAO,KAAK,IAAI,+BAA+B,GAAG,KAAK;AAC3D;;ACrBA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/core",
|
|
3
|
-
"version": "4.52.0-canary.
|
|
3
|
+
"version": "4.52.0-canary.e10b718",
|
|
4
4
|
"description": "Core library for creating Angular components and applications using Taiga UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -179,10 +179,6 @@
|
|
|
179
179
|
"types": "./pipes/calendar-sheet/index.d.ts",
|
|
180
180
|
"default": "./fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs"
|
|
181
181
|
},
|
|
182
|
-
"./pipes/fallback-src": {
|
|
183
|
-
"types": "./pipes/fallback-src/index.d.ts",
|
|
184
|
-
"default": "./fesm2022/taiga-ui-core-pipes-fallback-src.mjs"
|
|
185
|
-
},
|
|
186
182
|
"./pipes/flag": {
|
|
187
183
|
"types": "./pipes/flag/index.d.ts",
|
|
188
184
|
"default": "./fesm2022/taiga-ui-core-pipes-flag.mjs"
|
package/pipes/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export * from '@taiga-ui/core/pipes/auto-color';
|
|
2
2
|
export * from '@taiga-ui/core/pipes/calendar-sheet';
|
|
3
|
-
export * from '@taiga-ui/core/pipes/fallback-src';
|
|
4
3
|
export * from '@taiga-ui/core/pipes/flag';
|
|
5
4
|
export * from '@taiga-ui/core/pipes/format-date';
|
|
6
5
|
export * from '@taiga-ui/core/pipes/format-number';
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
|
|
53
53
|
font: var(--tui-font-text-s);
|
|
54
54
|
|
|
55
|
-
tui-svg,
|
|
56
55
|
tui-icon,
|
|
57
56
|
&::before {
|
|
58
57
|
font-size: 1rem;
|
|
@@ -68,7 +67,6 @@
|
|
|
68
67
|
|
|
69
68
|
font: var(--tui-font-text-s);
|
|
70
69
|
|
|
71
|
-
tui-svg,
|
|
72
70
|
tui-icon,
|
|
73
71
|
&:not([tuiIconButton][data-appearance='icon']):not([tuiIconButton][data-appearance='link'])::before {
|
|
74
72
|
font-size: 1rem;
|
|
@@ -9,18 +9,20 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @vars
|
|
11
11
|
* --t-icon — depending on the data-icon, it can serve as either a mask (`svg`),
|
|
12
|
-
a background (`
|
|
12
|
+
a background (`img`), or content (`font`) for the icon.
|
|
13
13
|
* --t-icon-bg — mask for the background
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
|
-
* <tui-icon
|
|
16
|
+
* <tui-icon tuiIcons style="--t-icon: url('icon.svg')"></tui-icon>
|
|
17
17
|
*
|
|
18
18
|
* @see-also
|
|
19
19
|
* Icons
|
|
20
20
|
*/
|
|
21
21
|
tui-icon {
|
|
22
|
+
--tui-icon-size: 1em;
|
|
23
|
+
|
|
22
24
|
position: relative;
|
|
23
|
-
display: inline-
|
|
25
|
+
display: inline-flex;
|
|
24
26
|
inline-size: 1em;
|
|
25
27
|
block-size: 1em;
|
|
26
28
|
font-size: 1.5rem;
|
|
@@ -28,8 +30,7 @@ tui-icon {
|
|
|
28
30
|
border: 0 solid transparent;
|
|
29
31
|
vertical-align: middle;
|
|
30
32
|
box-sizing: border-box;
|
|
31
|
-
mask: var(--t-icon-bg) no-repeat center / calc(
|
|
32
|
-
~'min(1em, 100%)' padding-box;
|
|
33
|
+
mask: var(--t-icon-bg) no-repeat center / calc(100% + 10 * var(--tui-stroke-width, 0.125rem)) 100%;
|
|
33
34
|
|
|
34
35
|
@media @tui-mouse {
|
|
35
36
|
&[data-appearance='icon']:hover {
|
|
@@ -37,30 +38,35 @@ tui-icon {
|
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
&[data-icon-end] {
|
|
42
|
+
&::before {
|
|
43
|
+
mask-image:
|
|
44
|
+
var(--t-icon-start),
|
|
45
|
+
radial-gradient(circle at bottom 0.1em right 0.1em, transparent calc(0.4em - 0.5px), #000 0.4em);
|
|
46
|
+
mask-composite: intersect;
|
|
47
|
+
}
|
|
43
48
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
background: currentColor;
|
|
51
|
-
}
|
|
49
|
+
&[data-icon-start='img'],
|
|
50
|
+
&[data-icon-start='font'] {
|
|
51
|
+
&::before {
|
|
52
|
+
mask: radial-gradient(circle at bottom 0.1em right 0.1em, transparent calc(0.4em - 0.5px), #000 0.4em);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
52
55
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
&::after {
|
|
57
|
+
.fullsize();
|
|
58
|
+
}
|
|
56
59
|
}
|
|
57
60
|
|
|
58
|
-
&[data-icon
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
&[data-icon-start] {
|
|
62
|
+
&::before {
|
|
63
|
+
.fullsize();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&::after {
|
|
67
|
+
transform: translate(36%, 36%);
|
|
68
|
+
|
|
69
|
+
--tui-icon-size: 0.5715em;
|
|
70
|
+
}
|
|
65
71
|
}
|
|
66
72
|
}
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @vars
|
|
9
9
|
* --t-icon-start — depending on the data-icon-start, it can serve as either a mask (`svg`),
|
|
10
|
-
a background (`
|
|
10
|
+
a background (`img`), or content (`font`) for the ::before element
|
|
11
11
|
* --t-icon-end — depending on the data-icon-end, it can serve as either a mask (`svg`),
|
|
12
|
-
a background (`
|
|
12
|
+
a background (`img`), or content (`font`) for the ::after element
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
|
-
* <button tuiIcons
|
|
15
|
+
* <button tuiIcons style="--t-icon-start: url('icon.svg')"></button>
|
|
16
16
|
*
|
|
17
17
|
* @see-also
|
|
18
18
|
* Button, Icon, Link
|
|
@@ -27,32 +27,34 @@
|
|
|
27
27
|
inline-size: 1em;
|
|
28
28
|
block-size: 1em;
|
|
29
29
|
line-height: 1em;
|
|
30
|
-
font-size: 1.5rem;
|
|
30
|
+
font-size: var(--tui-icon-size, 1.5rem);
|
|
31
31
|
flex-shrink: 0;
|
|
32
32
|
box-sizing: content-box;
|
|
33
33
|
background: currentColor;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
&::before {
|
|
37
|
-
display: var(--t-icon-start
|
|
38
|
-
mask:
|
|
39
|
-
~'min(1em, 100%)'
|
|
37
|
+
display: var(--t-icon-start);
|
|
38
|
+
mask:
|
|
39
|
+
var(--t-icon-start) no-repeat center / calc(~'min(1em, 100%)' + 10 * var(--tui-stroke-width, 0.125rem))
|
|
40
|
+
~'min(1em, 100%)',
|
|
41
|
+
100% padding-box;
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
&::after {
|
|
43
|
-
display: var(--t-icon-end
|
|
45
|
+
display: var(--t-icon-end);
|
|
44
46
|
mask: var(--t-icon-end) no-repeat center / calc(~'min(1em, 100%)' + 10 * var(--tui-stroke-width, 0.125rem))
|
|
45
47
|
~'min(1em, 100%)' padding-box;
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
&[data-icon-start='
|
|
50
|
+
&[data-icon-start='img']::before {
|
|
49
51
|
mask: none;
|
|
50
|
-
background: var(--t-icon-start) no-repeat center/
|
|
52
|
+
background: var(--t-icon-start) no-repeat center / 1em padding-box;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
&[data-icon-end='
|
|
55
|
+
&[data-icon-end='img']::after {
|
|
54
56
|
mask: none;
|
|
55
|
-
background: var(--t-icon-end) no-repeat center/
|
|
57
|
+
background: var(--t-icon-end) no-repeat center / 1em padding-box;
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
&[data-icon-start='font']::before,
|
|
@@ -5,6 +5,6 @@ export declare const TUI_ICON_RESOLVER: InjectionToken<TuiStringHandler<string>>
|
|
|
5
5
|
* @deprecated use {@link TUI_ICON_RESOLVER}
|
|
6
6
|
*/
|
|
7
7
|
export declare const TUI_ICON_START_RESOLVER: InjectionToken<TuiStringHandler<string>>;
|
|
8
|
-
export declare function tuiGetIconMode(icon?: string | null):
|
|
8
|
+
export declare function tuiGetIconMode(icon?: string | null): string | undefined;
|
|
9
9
|
export declare function tuiInjectIconResolver(): TuiStringHandler<string>;
|
|
10
10
|
export declare function tuiIconResolverProvider(useValue: TuiStringHandler<string>): Provider;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type EnvironmentProviders, InjectionToken, type Provider } from '@angular/core';
|
|
2
|
+
interface ExperimentalAPIs {
|
|
3
|
+
readonly all: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface TuiOptions {
|
|
6
|
+
readonly mode?: 'dark' | 'light';
|
|
7
|
+
readonly apis: Partial<ExperimentalAPIs> | 'stable';
|
|
8
|
+
readonly fontScaling: boolean;
|
|
9
|
+
readonly scrollbars: 'custom' | 'native';
|
|
10
|
+
}
|
|
11
|
+
export declare const TUI_OPTIONS: InjectionToken<TuiOptions>;
|
|
12
|
+
export declare function provideTaiga(config?: Partial<TuiOptions>): Array<EnvironmentProviders | Provider>;
|
|
13
|
+
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe } from '@angular/core';
|
|
3
|
-
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
4
|
-
import { fromEvent, map, startWith } from 'rxjs';
|
|
5
|
-
|
|
6
|
-
class TuiFallbackSrcPipe {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.el = tuiInjectElement();
|
|
9
|
-
}
|
|
10
|
-
transform(src, fallback) {
|
|
11
|
-
return fromEvent(this.el, 'error', { capture: true }).pipe(map(() => fallback), startWith(src || fallback));
|
|
12
|
-
}
|
|
13
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiFallbackSrcPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
14
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.9", ngImport: i0, type: TuiFallbackSrcPipe, isStandalone: true, name: "tuiFallbackSrc" }); }
|
|
15
|
-
}
|
|
16
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiFallbackSrcPipe, decorators: [{
|
|
17
|
-
type: Pipe,
|
|
18
|
-
args: [{
|
|
19
|
-
standalone: true,
|
|
20
|
-
name: 'tuiFallbackSrc',
|
|
21
|
-
}]
|
|
22
|
-
}] });
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Generated bundle index. Do not edit.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
export { TuiFallbackSrcPipe };
|
|
29
|
-
//# sourceMappingURL=taiga-ui-core-pipes-fallback-src.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-pipes-fallback-src.mjs","sources":["../../../projects/core/pipes/fallback-src/fallback-src.pipe.ts","../../../projects/core/pipes/fallback-src/taiga-ui-core-pipes-fallback-src.ts"],"sourcesContent":["import {Pipe, type PipeTransform} from '@angular/core';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {fromEvent, map, type Observable, startWith} from 'rxjs';\n\n@Pipe({\n standalone: true,\n name: 'tuiFallbackSrc',\n})\nexport class TuiFallbackSrcPipe implements PipeTransform {\n private readonly el = tuiInjectElement();\n\n public transform(src: string, fallback: string): Observable<string> {\n return fromEvent(this.el, 'error', {capture: true}).pipe(\n map(() => fallback),\n startWith(src || fallback),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAQa,kBAAkB,CAAA;AAJ/B,IAAA,WAAA,GAAA;QAKqB,IAAA,CAAA,EAAE,GAAG,gBAAgB,EAAE;AAQ3C,IAAA;IANU,SAAS,CAAC,GAAW,EAAE,QAAgB,EAAA;AAC1C,QAAA,OAAO,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC,IAAI,CACpD,GAAG,CAAC,MAAM,QAAQ,CAAC,EACnB,SAAS,CAAC,GAAG,IAAI,QAAQ,CAAC,CAC7B;IACL;8GARS,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,gBAAA,EAAA,CAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE,gBAAgB;AACzB,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type PipeTransform } from '@angular/core';
|
|
2
|
-
import { type Observable } from 'rxjs';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class TuiFallbackSrcPipe implements PipeTransform {
|
|
5
|
-
private readonly el;
|
|
6
|
-
transform(src: string, fallback: string): Observable<string>;
|
|
7
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiFallbackSrcPipe, never>;
|
|
8
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<TuiFallbackSrcPipe, "tuiFallbackSrc", true>;
|
|
9
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './fallback-src.pipe';
|