@taiga-ui/cdk 4.52.0-canary.2c75afa → 4.52.0-canary.2d877cf
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/README.md +1 -1
- package/constants/used-icons.d.ts +2 -2
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/date-time/date-fillers.d.ts +5 -5
- package/date-time/day-range.d.ts +1 -1
- package/date-time/day.d.ts +3 -3
- package/date-time/types.d.ts +1 -7
- package/directives/active-zone/active-zone.directive.d.ts +0 -2
- package/directives/animated/animated.directive.d.ts +1 -3
- package/directives/animated/index.d.ts +0 -1
- package/directives/index.d.ts +0 -4
- package/directives/transitioned/transitioned.directive.d.ts +1 -0
- package/fesm2022/taiga-ui-cdk-classes.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-constants.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-date-time.mjs +22 -22
- package/fesm2022/taiga-ui-cdk-date-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs +11 -15
- package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-animated.mjs +23 -70
- package/fesm2022/taiga-ui-cdk-directives-animated.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-control.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-copy-processor.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-element.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-focus-trap.mjs +5 -7
- package/fesm2022/taiga-ui-cdk-directives-focus-trap.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-font-size.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-high-dpi.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-hovered.mjs +6 -6
- package/fesm2022/taiga-ui-cdk-directives-item.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-media.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-native-validator.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-obscured.mjs +7 -13
- package/fesm2022/taiga-ui-cdk-directives-obscured.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-pan.mjs +6 -6
- package/fesm2022/taiga-ui-cdk-directives-platform.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-resizer.mjs +6 -6
- package/fesm2022/taiga-ui-cdk-directives-swipe.mjs +6 -6
- package/fesm2022/taiga-ui-cdk-directives-transitioned.mjs +7 -13
- package/fesm2022/taiga-ui-cdk-directives-transitioned.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-validator.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-value-changes.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-visual-viewport.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-with-styles.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-zoom.mjs +6 -6
- package/fesm2022/taiga-ui-cdk-directives.mjs +0 -4
- package/fesm2022/taiga-ui-cdk-directives.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-observables.mjs +2 -24
- package/fesm2022/taiga-ui-cdk-observables.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-filter.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-pipes-mapper.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-pipes-obfuscate.mjs +5 -4
- package/fesm2022/taiga-ui-cdk-pipes-obfuscate.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes.mjs +0 -6
- package/fesm2022/taiga-ui-cdk-pipes.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-portals.mjs +15 -16
- package/fesm2022/taiga-ui-cdk-portals.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-tokens.mjs +13 -47
- package/fesm2022/taiga-ui-cdk-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-browser.mjs +2 -3
- package/fesm2022/taiga-ui-cdk-utils-browser.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-di.mjs +45 -4
- package/fesm2022/taiga-ui-cdk-utils-di.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-dom.mjs +1 -74
- package/fesm2022/taiga-ui-cdk-utils-dom.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-focus.mjs +22 -38
- package/fesm2022/taiga-ui-cdk-utils-focus.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-math.mjs +1 -12
- package/fesm2022/taiga-ui-cdk-utils-math.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs +45 -123
- package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-utils.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk.mjs +0 -1
- package/fesm2022/taiga-ui-cdk.mjs.map +1 -1
- package/index.d.ts +0 -1
- package/observables/index.d.ts +0 -2
- package/package.json +5 -54
- package/pipes/index.d.ts +0 -6
- package/portals/portal.d.ts +0 -1
- package/schematics/ng-add/constants/versions.d.ts +1 -1
- package/schematics/ng-add/steps/add-taiga-modules.js +0 -15
- package/schematics/ng-add/steps/add-taiga-modules.js.map +1 -1
- package/schematics/ng-update/v5/steps/constants/attrs-to-replace.d.ts +2 -0
- package/schematics/ng-update/v5/steps/constants/attrs-to-replace.js +22 -0
- package/schematics/ng-update/v5/steps/constants/attrs-to-replace.js.map +1 -0
- package/schematics/ng-update/v5/steps/constants/functions.js +1 -6
- package/schematics/ng-update/v5/steps/constants/functions.js.map +1 -1
- package/schematics/ng-update/v5/steps/migrate-templates.js +4 -0
- package/schematics/ng-update/v5/steps/migrate-templates.js.map +1 -1
- package/schematics/ng-update/v5/steps/templates/migrate-avatar.d.ts +8 -0
- package/schematics/ng-update/v5/steps/templates/migrate-avatar.js +111 -0
- package/schematics/ng-update/v5/steps/templates/migrate-avatar.js.map +1 -0
- package/schematics/utils/run-migration.d.ts +2 -2
- package/schematics/utils/run-migration.js +4 -3
- package/schematics/utils/run-migration.js.map +1 -1
- package/tokens/environment.d.ts +0 -13
- package/tokens/index.d.ts +0 -2
- package/tokens/removed-element.d.ts +0 -3
- package/types/index.d.ts +0 -2
- package/utils/di/index.d.ts +3 -0
- package/utils/dom/index.d.ts +0 -6
- package/utils/focus/get-closest-focusable.d.ts +1 -6
- package/utils/focus/index.d.ts +4 -6
- package/utils/focus/{is-native-keyboard-focusable.d.ts → is-focusable.d.ts} +1 -1
- package/utils/index.d.ts +0 -1
- package/utils/math/index.d.ts +0 -2
- package/utils/miscellaneous/generate-id.d.ts +1 -0
- package/utils/miscellaneous/index.d.ts +2 -11
- package/utils/miscellaneous/sanitize-text.d.ts +23 -0
- package/directives/animated/animated-parent.directive.d.ts +0 -10
- package/directives/click-outside/click-outside.directive.d.ts +0 -14
- package/directives/click-outside/index.d.ts +0 -1
- package/directives/droppable/droppable.directive.d.ts +0 -10
- package/directives/droppable/index.d.ts +0 -1
- package/directives/let/index.d.ts +0 -2
- package/directives/let/let-context.d.ts +0 -11
- package/directives/let/let.directive.d.ts +0 -18
- package/directives/repeat-times/index.d.ts +0 -1
- package/directives/repeat-times/repeat-times.directive.d.ts +0 -23
- package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs +0 -38
- package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs.map +0 -1
- package/fesm2022/taiga-ui-cdk-directives-droppable.mjs +0 -35
- package/fesm2022/taiga-ui-cdk-directives-droppable.mjs.map +0 -1
- package/fesm2022/taiga-ui-cdk-directives-let.mjs +0 -52
- package/fesm2022/taiga-ui-cdk-directives-let.mjs.map +0 -1
- package/fesm2022/taiga-ui-cdk-directives-repeat-times.mjs +0 -60
- package/fesm2022/taiga-ui-cdk-directives-repeat-times.mjs.map +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-animation.mjs +0 -32
- package/fesm2022/taiga-ui-cdk-pipes-animation.mjs.map +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-is-present.mjs +0 -24
- package/fesm2022/taiga-ui-cdk-pipes-is-present.mjs.map +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-keys.mjs +0 -23
- package/fesm2022/taiga-ui-cdk-pipes-keys.mjs.map +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-repeat-times.mjs +0 -24
- package/fesm2022/taiga-ui-cdk-pipes-repeat-times.mjs.map +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-replace.mjs +0 -25
- package/fesm2022/taiga-ui-cdk-pipes-replace.mjs.map +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-to-array.mjs +0 -23
- package/fesm2022/taiga-ui-cdk-pipes-to-array.mjs.map +0 -1
- package/fesm2022/taiga-ui-cdk-services.mjs +0 -111
- package/fesm2022/taiga-ui-cdk-services.mjs.map +0 -1
- package/fesm2022/taiga-ui-cdk-utils-color.mjs +0 -196
- package/fesm2022/taiga-ui-cdk-utils-color.mjs.map +0 -1
- package/observables/must-be-present.d.ts +0 -5
- package/observables/query-list-observable.d.ts +0 -6
- package/pipes/animation/animation.pipe.d.ts +0 -13
- package/pipes/animation/index.d.ts +0 -1
- package/pipes/is-present/index.d.ts +0 -1
- package/pipes/is-present/is-present.pipe.d.ts +0 -7
- package/pipes/keys/index.d.ts +0 -1
- package/pipes/keys/keys.pipe.d.ts +0 -7
- package/pipes/repeat-times/index.d.ts +0 -7
- package/pipes/replace/index.d.ts +0 -1
- package/pipes/replace/replace.pipe.d.ts +0 -7
- package/pipes/to-array/index.d.ts +0 -1
- package/pipes/to-array/to-array.pipe.d.ts +0 -7
- package/services/id.service.d.ts +0 -8
- package/services/index.d.ts +0 -3
- package/services/scroll.service.d.ts +0 -13
- package/services/theme-color.service.d.ts +0 -18
- package/tokens/base-href.d.ts +0 -2
- package/tokens/range.d.ts +0 -5
- package/types/safe-html.d.ts +0 -2
- package/types/values-of.d.ts +0 -1
- package/utils/color/get-gradient-data.d.ts +0 -1
- package/utils/color/hex-to-rgb.d.ts +0 -1
- package/utils/color/hex-to-rgba.d.ts +0 -3
- package/utils/color/hsv-to-rgb.d.ts +0 -4
- package/utils/color/index.d.ts +0 -9
- package/utils/color/parse-color.d.ts +0 -1
- package/utils/color/parse-gradient.d.ts +0 -10
- package/utils/color/rgb-to-hex.d.ts +0 -1
- package/utils/color/rgb-to-hsv.d.ts +0 -1
- package/utils/color/rgba-to-hex.d.ts +0 -2
- package/utils/dom/get-element-point.d.ts +0 -2
- package/utils/dom/is-current-target.d.ts +0 -1
- package/utils/dom/is-inside-iframe.d.ts +0 -4
- package/utils/dom/is-node-in.d.ts +0 -8
- package/utils/dom/retarget-boundary-crossing.d.ts +0 -1
- package/utils/dom/value-binding.d.ts +0 -3
- package/utils/focus/blur-native-focused.d.ts +0 -4
- package/utils/focus/is-native-mouse-focusable.d.ts +0 -1
- package/utils/math/to-integer.d.ts +0 -1
- package/utils/math/to-radians.d.ts +0 -4
- package/utils/miscellaneous/change-date-separator.d.ts +0 -1
- package/utils/miscellaneous/create-token.d.ts +0 -9
- package/utils/miscellaneous/flat-length.d.ts +0 -6
- package/utils/miscellaneous/get-original-array-from-query-list.d.ts +0 -8
- package/utils/miscellaneous/is-falsy.d.ts +0 -1
- package/utils/miscellaneous/is-valid-url.d.ts +0 -4
- package/utils/miscellaneous/object-shallow-equals.d.ts +0 -1
- package/utils/miscellaneous/uniq-by.d.ts +0 -1
- /package/utils/{miscellaneous → di}/directive-binding.d.ts +0 -0
- /package/utils/{miscellaneous → di}/provide-options.d.ts +0 -0
- /package/utils/{miscellaneous → di}/provide.d.ts +0 -0
- /package/utils/focus/{get-native-focused.d.ts → get-focused.d.ts} +0 -0
- /package/utils/focus/{is-native-focused-in.d.ts → is-focused-in.d.ts} +0 -0
- /package/utils/focus/{is-native-focused.d.ts → is-focused.d.ts} +0 -0
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
function tuiGetGradientData(gradient) {
|
|
2
|
-
return gradient
|
|
3
|
-
.slice(0, Math.max(0, gradient.length - 1))
|
|
4
|
-
.replace('linear-gradient(', '');
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
function tuiHexToRgb(hex) {
|
|
8
|
-
const matches = hex
|
|
9
|
-
.replace('#', '')
|
|
10
|
-
.split('')
|
|
11
|
-
.map((char, _, array) => (array.length === 3 ? char + char : char))
|
|
12
|
-
.join('')
|
|
13
|
-
.match(/.{2}/g);
|
|
14
|
-
return matches
|
|
15
|
-
? matches.map((x) => Number.parseInt(x, 16))
|
|
16
|
-
: [0, 0, 0];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const getChunksFromString = (hex, chunkSize) => hex.match(new RegExp(`.{${chunkSize}}`, 'g'));
|
|
20
|
-
const convertHexUnitTo256 = (hexStr) => parseInt(hexStr.repeat(2 / hexStr.length), 16);
|
|
21
|
-
const getAlphaFloat = (a, alpha) => {
|
|
22
|
-
if (a !== undefined) {
|
|
23
|
-
return Number((a / 255).toFixed(2));
|
|
24
|
-
}
|
|
25
|
-
if (typeof alpha !== 'number' || alpha < 0 || alpha > 1) {
|
|
26
|
-
return 1;
|
|
27
|
-
}
|
|
28
|
-
return alpha;
|
|
29
|
-
};
|
|
30
|
-
function tuiHexToRGBA(hex, alpha) {
|
|
31
|
-
const [r, g, b, a] = tuiParseHex(hex, alpha);
|
|
32
|
-
return a < 1 ? `rgba(${r}, ${g}, ${b}, ${a})` : `rgb(${r}, ${g}, ${b})`;
|
|
33
|
-
}
|
|
34
|
-
function tuiIsValidHex(hex) {
|
|
35
|
-
return /^#([A-Fa-f0-9]{3,4}){1,2}$/.test(hex);
|
|
36
|
-
}
|
|
37
|
-
function tuiParseHex(hex, alpha) {
|
|
38
|
-
if (!tuiIsValidHex(hex)) {
|
|
39
|
-
throw new Error('Invalid HEX');
|
|
40
|
-
}
|
|
41
|
-
const chunkSize = Math.floor((hex.length - 1) / 3);
|
|
42
|
-
const hexArr = getChunksFromString(hex.slice(1), chunkSize);
|
|
43
|
-
const [r = NaN, g = NaN, b = NaN, a] = hexArr?.map(convertHexUnitTo256) ?? [];
|
|
44
|
-
const floatAlpha = getAlphaFloat(a, alpha);
|
|
45
|
-
return [r, g, b, floatAlpha];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function hsvToColor(h, s, v, n) {
|
|
49
|
-
const k = (n + h / 60) % 6;
|
|
50
|
-
return Math.round(v - v * s * Math.max(Math.min(k, 4 - k, 1), 0));
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* https://stackoverflow.com/a/54024653/2706426
|
|
54
|
-
*/
|
|
55
|
-
function tuiHsvToRgb(h, s, v) {
|
|
56
|
-
return [hsvToColor(h, s, v, 5), hsvToColor(h, s, v, 3), hsvToColor(h, s, v, 1)];
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const DEFAULT = [0, 0, 0, 1];
|
|
60
|
-
function tuiParseColor(color) {
|
|
61
|
-
const stripped = color
|
|
62
|
-
.replace('#', '')
|
|
63
|
-
.replace('rgba(', '')
|
|
64
|
-
.replace('rgb(', '')
|
|
65
|
-
.replace(')', '');
|
|
66
|
-
const array = stripped.split(',').map((item) => parseFloat(item));
|
|
67
|
-
if (array.length === 4) {
|
|
68
|
-
return array;
|
|
69
|
-
}
|
|
70
|
-
if (array.length === 3) {
|
|
71
|
-
return array.concat(1);
|
|
72
|
-
}
|
|
73
|
-
const matches = stripped.match(new RegExp(`(.{${stripped.length / 3}})`, 'g'));
|
|
74
|
-
if (!matches) {
|
|
75
|
-
return DEFAULT;
|
|
76
|
-
}
|
|
77
|
-
const parsed = matches.map((char) => parseInt(stripped.length % 2 ? char + char : char, 16));
|
|
78
|
-
return [
|
|
79
|
-
parsed[0] ?? DEFAULT[0],
|
|
80
|
-
parsed[1] ?? DEFAULT[1],
|
|
81
|
-
parsed[2] ?? DEFAULT[2],
|
|
82
|
-
parsed[3] ?? DEFAULT[3],
|
|
83
|
-
];
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
//
|
|
87
|
-
// TypeScript parser based on Dean Taylor's answer:
|
|
88
|
-
// https://stackoverflow.com/a/20238168/2706426
|
|
89
|
-
//
|
|
90
|
-
// SETUP CODE
|
|
91
|
-
const COMMA = String.raw `\s*,\s*`; // Allow space around comma.
|
|
92
|
-
const HEX = '#(?:[a-f0-9]{6}|[a-f0-9]{3})'; // 3 or 6 character form
|
|
93
|
-
const RGB = String.raw `\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*\)`; // "(1, 2, 3)"
|
|
94
|
-
const RGBA = String.raw `\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*,\s*\d*\.?\d+\)`; // "(1, 2, 3, 4)"
|
|
95
|
-
const VALUE = String.raw `(?:[+-]?\d*\.?\d+)(?:%|[a-z]+)?`; // ".9", "-5px", "100%".
|
|
96
|
-
const KEYWORD = '[_a-z-][_a-z0-9-]*'; // "red", "transparent", "border-collapse".
|
|
97
|
-
const COLOR = [
|
|
98
|
-
'(?:',
|
|
99
|
-
HEX,
|
|
100
|
-
'|',
|
|
101
|
-
'(?:rgb|hsl)',
|
|
102
|
-
RGB,
|
|
103
|
-
'|',
|
|
104
|
-
'(?:rgba|hsla)',
|
|
105
|
-
RGBA,
|
|
106
|
-
'|',
|
|
107
|
-
KEYWORD,
|
|
108
|
-
')',
|
|
109
|
-
];
|
|
110
|
-
const REGEXP_ARRAY = [
|
|
111
|
-
String.raw `\s*(`,
|
|
112
|
-
...COLOR,
|
|
113
|
-
')',
|
|
114
|
-
String.raw `(?:\s+`,
|
|
115
|
-
'(',
|
|
116
|
-
VALUE,
|
|
117
|
-
'))?',
|
|
118
|
-
'(?:',
|
|
119
|
-
COMMA,
|
|
120
|
-
String.raw `\s*)?`,
|
|
121
|
-
];
|
|
122
|
-
function getPosition(match, stops) {
|
|
123
|
-
const fallback = stops === 1 ? '100%' : `${stops}%`;
|
|
124
|
-
return match?.includes('%') ? match : fallback;
|
|
125
|
-
}
|
|
126
|
-
function tuiParseGradient(input) {
|
|
127
|
-
const stopsRegexp = new RegExp(REGEXP_ARRAY.join(''), 'gi');
|
|
128
|
-
const stopsString = input.startsWith('to') || /^\d/.exec(input)
|
|
129
|
-
? input.slice(Math.max(0, input.indexOf(',') + 1)).trim()
|
|
130
|
-
: input;
|
|
131
|
-
const side = input.startsWith('to')
|
|
132
|
-
? input.split(',')[0]
|
|
133
|
-
: 'to bottom';
|
|
134
|
-
let stops = [];
|
|
135
|
-
let matchColorStop = stopsRegexp.exec(stopsString);
|
|
136
|
-
while (matchColorStop !== null) {
|
|
137
|
-
stops = stops.concat({
|
|
138
|
-
color: matchColorStop[1] || '',
|
|
139
|
-
position: getPosition(matchColorStop[2] || '', stops.length),
|
|
140
|
-
});
|
|
141
|
-
matchColorStop = stopsRegexp.exec(stopsString);
|
|
142
|
-
}
|
|
143
|
-
stops = stops.filter(({ color }) => color.startsWith('#') || color.startsWith('rgb'));
|
|
144
|
-
return {
|
|
145
|
-
stops,
|
|
146
|
-
side,
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
function tuiToGradient({ stops, side }) {
|
|
150
|
-
return `linear-gradient(${side}, ${stops
|
|
151
|
-
.map(({ color, position }) => `rgba(${tuiParseColor(color).join(', ')}) ${position}`)
|
|
152
|
-
.join(', ')})`;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
function tuiRgbToHex(r, g, b) {
|
|
156
|
-
return `#${[r, g, b].map((x) => x.toString(16).padStart(2, '0')).join('')}`;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
function tuiRgbToHsv(r, g, b) {
|
|
160
|
-
const v = Math.max(r, g, b);
|
|
161
|
-
const n = v - Math.min(r, g, b);
|
|
162
|
-
// eslint-disable-next-line no-nested-ternary
|
|
163
|
-
const h = n && (v === r ? (g - b) / n : v === g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
164
|
-
return [60 * (h < 0 ? h + 6 : h), v && n / v, v];
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/* eslint-disable no-bitwise */
|
|
168
|
-
function tuiRgbaToHex(color) {
|
|
169
|
-
if (!tuiIsValidRgba(color)) {
|
|
170
|
-
throw new Error('Invalid RGBa');
|
|
171
|
-
}
|
|
172
|
-
const rgb = /^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i.exec(color.replaceAll(/\s/g, '')) ??
|
|
173
|
-
null;
|
|
174
|
-
let alpha = (rgb?.[4] ?? '').trim();
|
|
175
|
-
let hex = rgb
|
|
176
|
-
? ((parseInt(rgb?.[1] ?? '', 10) || 0) | (1 << 8)).toString(16).slice(1) +
|
|
177
|
-
((parseInt(rgb?.[2] ?? '', 10) || 0) | (1 << 8)).toString(16).slice(1) +
|
|
178
|
-
((parseInt(rgb?.[3] ?? '', 10) || 0) | (1 << 8)).toString(16).slice(1)
|
|
179
|
-
: color;
|
|
180
|
-
alpha = alpha !== '' ? alpha : 0o1;
|
|
181
|
-
alpha = ((Number(alpha) * 255) | (1 << 8)).toString(16).slice(1);
|
|
182
|
-
hex += alpha;
|
|
183
|
-
return `#${hex.toUpperCase()}`;
|
|
184
|
-
}
|
|
185
|
-
function tuiIsValidRgba(rgba) {
|
|
186
|
-
const range = String.raw `(\d|[1-9]\d|1\d{2}|2[0-4]\d|2[0-5]{2})`;
|
|
187
|
-
const alpha = String.raw `([01]|0?\.\d+)`;
|
|
188
|
-
return new RegExp(String.raw `^(?:rgb\(\s*${range}\s*,\s*${range}\s*,\s*${range}\s*\)|rgba\(\s*${range}\s*,\s*${range}\s*,\s*${range}\s*,\s*${alpha}\s*\))$`).test(rgba);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Generated bundle index. Do not edit.
|
|
193
|
-
*/
|
|
194
|
-
|
|
195
|
-
export { tuiGetGradientData, tuiHexToRGBA, tuiHexToRgb, tuiHsvToRgb, tuiIsValidHex, tuiIsValidRgba, tuiParseColor, tuiParseGradient, tuiParseHex, tuiRgbToHex, tuiRgbToHsv, tuiRgbaToHex, tuiToGradient };
|
|
196
|
-
//# sourceMappingURL=taiga-ui-cdk-utils-color.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-utils-color.mjs","sources":["../../../projects/cdk/utils/color/get-gradient-data.ts","../../../projects/cdk/utils/color/hex-to-rgb.ts","../../../projects/cdk/utils/color/hex-to-rgba.ts","../../../projects/cdk/utils/color/hsv-to-rgb.ts","../../../projects/cdk/utils/color/parse-color.ts","../../../projects/cdk/utils/color/parse-gradient.ts","../../../projects/cdk/utils/color/rgb-to-hex.ts","../../../projects/cdk/utils/color/rgb-to-hsv.ts","../../../projects/cdk/utils/color/rgba-to-hex.ts","../../../projects/cdk/utils/color/taiga-ui-cdk-utils-color.ts"],"sourcesContent":["export function tuiGetGradientData(gradient: string): string {\n return gradient\n .slice(0, Math.max(0, gradient.length - 1))\n .replace('linear-gradient(', '');\n}\n","export function tuiHexToRgb(hex: string): [number, number, number] {\n const matches = hex\n .replace('#', '')\n .split('')\n .map((char, _, array) => (array.length === 3 ? char + char : char))\n .join('')\n .match(/.{2}/g);\n\n return matches\n ? (matches.map((x) => Number.parseInt(x, 16)) as [number, number, number])\n : [0, 0, 0];\n}\n","const getChunksFromString = (hex: string, chunkSize: number): RegExpMatchArray | null =>\n hex.match(new RegExp(`.{${chunkSize}}`, 'g'));\n\nconst convertHexUnitTo256 = (hexStr: string): number =>\n parseInt(hexStr.repeat(2 / hexStr.length), 16);\n\nconst getAlphaFloat = (a?: number, alpha?: number): number => {\n if (a !== undefined) {\n return Number((a / 255).toFixed(2));\n }\n\n if (typeof alpha !== 'number' || alpha < 0 || alpha > 1) {\n return 1;\n }\n\n return alpha;\n};\n\nexport function tuiHexToRGBA(hex: string, alpha?: number): string {\n const [r, g, b, a] = tuiParseHex(hex, alpha);\n\n return a < 1 ? `rgba(${r}, ${g}, ${b}, ${a})` : `rgb(${r}, ${g}, ${b})`;\n}\n\nexport function tuiIsValidHex(hex: string): boolean {\n return /^#([A-Fa-f0-9]{3,4}){1,2}$/.test(hex);\n}\n\nexport function tuiParseHex(\n hex: string,\n alpha?: number,\n): [number, number, number, number] {\n if (!tuiIsValidHex(hex)) {\n throw new Error('Invalid HEX');\n }\n\n const chunkSize = Math.floor((hex.length - 1) / 3);\n const hexArr = getChunksFromString(hex.slice(1), chunkSize);\n const [r = NaN, g = NaN, b = NaN, a] = hexArr?.map(convertHexUnitTo256) ?? [];\n const floatAlpha = getAlphaFloat(a, alpha);\n\n return [r, g, b, floatAlpha];\n}\n","function hsvToColor(h: number, s: number, v: number, n: number): number {\n const k = (n + h / 60) % 6;\n\n return Math.round(v - v * s * Math.max(Math.min(k, 4 - k, 1), 0));\n}\n\n/**\n * https://stackoverflow.com/a/54024653/2706426\n */\nexport function tuiHsvToRgb(h: number, s: number, v: number): [number, number, number] {\n return [hsvToColor(h, s, v, 5), hsvToColor(h, s, v, 3), hsvToColor(h, s, v, 1)];\n}\n","const DEFAULT: [number, number, number, number] = [0, 0, 0, 1];\n\nexport function tuiParseColor(color: string): [number, number, number, number] {\n const stripped = color\n .replace('#', '')\n .replace('rgba(', '')\n .replace('rgb(', '')\n .replace(')', '');\n const array = stripped.split(',').map((item) => parseFloat(item));\n\n if (array.length === 4) {\n return array as [number, number, number, number];\n }\n\n if (array.length === 3) {\n return array.concat(1) as [number, number, number, number];\n }\n\n const matches = stripped.match(new RegExp(`(.{${stripped.length / 3}})`, 'g'));\n\n if (!matches) {\n return DEFAULT;\n }\n\n const parsed = matches.map((char) =>\n parseInt(stripped.length % 2 ? char + char : char, 16),\n );\n\n return [\n parsed[0] ?? DEFAULT[0],\n parsed[1] ?? DEFAULT[1],\n parsed[2] ?? DEFAULT[2],\n parsed[3] ?? DEFAULT[3],\n ];\n}\n","import {tuiParseColor} from './parse-color';\n\nexport interface TuiParsedGradient {\n readonly side: TuiGradientDirection;\n readonly stops: ReadonlyArray<{\n readonly color: string;\n readonly position: string;\n }>;\n}\n\nexport type TuiGradientDirection =\n | 'to bottom left'\n | 'to bottom right'\n | 'to bottom'\n | 'to left'\n | 'to right'\n | 'to top left'\n | 'to top right'\n | 'to top';\n\n//\n// TypeScript parser based on Dean Taylor's answer:\n// https://stackoverflow.com/a/20238168/2706426\n//\n// SETUP CODE\nconst COMMA = String.raw`\\s*,\\s*`; // Allow space around comma.\nconst HEX = '#(?:[a-f0-9]{6}|[a-f0-9]{3})'; // 3 or 6 character form\nconst RGB = String.raw`\\(\\s*(?:\\d{1,3}\\s*,\\s*){2}\\d{1,3}\\s*\\)`; // \"(1, 2, 3)\"\nconst RGBA = String.raw`\\(\\s*(?:\\d{1,3}\\s*,\\s*){2}\\d{1,3}\\s*,\\s*\\d*\\.?\\d+\\)`; // \"(1, 2, 3, 4)\"\nconst VALUE = String.raw`(?:[+-]?\\d*\\.?\\d+)(?:%|[a-z]+)?`; // \".9\", \"-5px\", \"100%\".\nconst KEYWORD = '[_a-z-][_a-z0-9-]*'; // \"red\", \"transparent\", \"border-collapse\".\nconst COLOR = [\n '(?:',\n HEX,\n '|',\n '(?:rgb|hsl)',\n RGB,\n '|',\n '(?:rgba|hsla)',\n RGBA,\n '|',\n KEYWORD,\n ')',\n];\nconst REGEXP_ARRAY = [\n String.raw`\\s*(`,\n ...COLOR,\n ')',\n String.raw`(?:\\s+`,\n '(',\n VALUE,\n '))?',\n '(?:',\n COMMA,\n String.raw`\\s*)?`,\n];\n\nfunction getPosition(match: string, stops: number): string {\n const fallback = stops === 1 ? '100%' : `${stops}%`;\n\n return match?.includes('%') ? match : fallback;\n}\n\nexport function tuiParseGradient(input: string): TuiParsedGradient {\n const stopsRegexp = new RegExp(REGEXP_ARRAY.join(''), 'gi');\n const stopsString =\n input.startsWith('to') || /^\\d/.exec(input)\n ? input.slice(Math.max(0, input.indexOf(',') + 1)).trim()\n : input;\n\n const side = input.startsWith('to')\n ? (input.split(',')[0] as TuiGradientDirection)\n : 'to bottom';\n let stops: TuiParsedGradient['stops'] = [];\n\n let matchColorStop = stopsRegexp.exec(stopsString);\n\n while (matchColorStop !== null) {\n stops = stops.concat({\n color: matchColorStop[1] || '',\n position: getPosition(matchColorStop[2] || '', stops.length),\n });\n\n matchColorStop = stopsRegexp.exec(stopsString);\n }\n\n stops = stops.filter(({color}) => color.startsWith('#') || color.startsWith('rgb'));\n\n return {\n stops,\n side,\n };\n}\n\nexport function tuiToGradient({stops, side}: TuiParsedGradient): string {\n return `linear-gradient(${side}, ${stops\n .map(\n ({color, position}) => `rgba(${tuiParseColor(color).join(', ')}) ${position}`,\n )\n .join(', ')})`;\n}\n","export function tuiRgbToHex(r: number, g: number, b: number): string {\n return `#${[r, g, b].map((x) => x.toString(16).padStart(2, '0')).join('')}`;\n}\n","export function tuiRgbToHsv(r: number, g: number, b: number): [number, number, number] {\n const v = Math.max(r, g, b);\n const n = v - Math.min(r, g, b);\n\n // eslint-disable-next-line no-nested-ternary\n const h = n && (v === r ? (g - b) / n : v === g ? 2 + (b - r) / n : 4 + (r - g) / n);\n\n return [60 * (h < 0 ? h + 6 : h), v && n / v, v];\n}\n","/* eslint-disable no-bitwise */\nexport function tuiRgbaToHex(color: string): string {\n if (!tuiIsValidRgba(color)) {\n throw new Error('Invalid RGBa');\n }\n\n const rgb =\n /^rgba?\\((\\d+),(\\d+),(\\d+),?([^,\\s)]+)?/i.exec(color.replaceAll(/\\s/g, '')) ??\n null;\n\n let alpha: number | string = ((rgb?.[4] ?? '') satisfies string).trim();\n\n let hex = rgb\n ? ((parseInt(rgb?.[1] ?? '', 10) || 0) | (1 << 8)).toString(16).slice(1) +\n ((parseInt(rgb?.[2] ?? '', 10) || 0) | (1 << 8)).toString(16).slice(1) +\n ((parseInt(rgb?.[3] ?? '', 10) || 0) | (1 << 8)).toString(16).slice(1)\n : color;\n\n alpha = alpha !== '' ? alpha : 0o1;\n alpha = ((Number(alpha) * 255) | (1 << 8)).toString(16).slice(1);\n hex += alpha;\n\n return `#${hex.toUpperCase()}`;\n}\n\nexport function tuiIsValidRgba(rgba: string): boolean {\n const range = String.raw`(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|2[0-5]{2})`;\n const alpha = String.raw`([01]|0?\\.\\d+)`;\n\n return new RegExp(\n String.raw`^(?:rgb\\(\\s*${range}\\s*,\\s*${range}\\s*,\\s*${range}\\s*\\)|rgba\\(\\s*${range}\\s*,\\s*${range}\\s*,\\s*${range}\\s*,\\s*${alpha}\\s*\\))$`,\n ).test(rgba);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAM,SAAU,kBAAkB,CAAC,QAAgB,EAAA;AAC/C,IAAA,OAAO;AACF,SAAA,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;AACzC,SAAA,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;AACxC;;ACJM,SAAU,WAAW,CAAC,GAAW,EAAA;IACnC,MAAM,OAAO,GAAG;AACX,SAAA,OAAO,CAAC,GAAG,EAAE,EAAE;SACf,KAAK,CAAC,EAAE;SACR,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,MAAM,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;SACjE,IAAI,CAAC,EAAE;SACP,KAAK,CAAC,OAAO,CAAC;AAEnB,IAAA,OAAO;AACH,UAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;UAC1C,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACnB;;ACXA,M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E,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAA,gBAAgB;AAExC,IAAA,OAAO,IAAI,MAAM,CACb,MAAM,CAAC,GAAG,CAAA,CAAA,YAAA,EAAe,KAAK,CAAA,OAAA,EAAU,KAAK,CAAA,OAAA,EAAU,KAAK,CAAA,eAAA,EAAkB,KAAK,CAAA,OAAA,EAAU,KAAK,CAAA,OAAA,EAAU,KAAK,CAAA,OAAA,EAAU,KAAK,CAAA,OAAA,CAAS,CAC5I,CAAC,IAAI,CAAC,IAAI,CAAC;AAChB;;AChCA;;AAEG;;;;"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type QueryList } from '@angular/core';
|
|
2
|
-
import { type Observable } from 'rxjs';
|
|
3
|
-
/**
|
|
4
|
-
* Converts changes observable of a QueryList to an Observable of arrays
|
|
5
|
-
*/
|
|
6
|
-
export declare function tuiQueryListChanges<T>(queryList: QueryList<T>): Observable<readonly T[]>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type PipeTransform } from '@angular/core';
|
|
2
|
-
import { type TuiDurationOptions } from '@taiga-ui/core/animations';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class TuiAnimationPipe implements PipeTransform {
|
|
5
|
-
private readonly speed;
|
|
6
|
-
readonly transform: ({ duration, speed, value, ...params }?: Partial<{
|
|
7
|
-
duration: number;
|
|
8
|
-
speed: number;
|
|
9
|
-
value: string;
|
|
10
|
-
}> & Record<string, any>) => TuiDurationOptions;
|
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiAnimationPipe, never>;
|
|
12
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<TuiAnimationPipe, "tuiAnimation", true>;
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './animation.pipe';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './is-present.pipe';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type PipeTransform } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class TuiIsPresentPipe implements PipeTransform {
|
|
4
|
-
transform<T>(value?: T | null): value is T;
|
|
5
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiIsPresentPipe, never>;
|
|
6
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<TuiIsPresentPipe, "tuiIsPresent", true>;
|
|
7
|
-
}
|
package/pipes/keys/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './keys.pipe';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type PipeTransform } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class TuiKeysPipe implements PipeTransform {
|
|
4
|
-
transform(object: Record<any, any>): string[];
|
|
5
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiKeysPipe, never>;
|
|
6
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<TuiKeysPipe, "tuiKeys", true>;
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type PipeTransform } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class TuiRepeatTimesPipe implements PipeTransform {
|
|
4
|
-
transform(n: number): number[];
|
|
5
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiRepeatTimesPipe, never>;
|
|
6
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<TuiRepeatTimesPipe, "tuiRepeatTimes", true>;
|
|
7
|
-
}
|
package/pipes/replace/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './replace.pipe';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type PipeTransform } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class TuiReplacePipe implements PipeTransform {
|
|
4
|
-
transform(value: string | null | undefined, search: RegExp | string, replaceValue: string | ((substring: string, ...args: unknown[]) => string)): string;
|
|
5
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiReplacePipe, never>;
|
|
6
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<TuiReplacePipe, "tuiReplace", true>;
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './to-array.pipe';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type PipeTransform, type QueryList } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class TuiToArrayPipe implements PipeTransform {
|
|
4
|
-
transform<T>(items: Map<any, any> | QueryList<T> | Set<any>): readonly T[];
|
|
5
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiToArrayPipe, never>;
|
|
6
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<TuiToArrayPipe, "tuiToArray", true>;
|
|
7
|
-
}
|
package/services/id.service.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class TuiIdService {
|
|
3
|
-
private static autoId;
|
|
4
|
-
generate(): string;
|
|
5
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiIdService, never>;
|
|
6
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<TuiIdService>;
|
|
7
|
-
}
|
|
8
|
-
export declare function tuiInjectId(): string;
|
package/services/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type Observable } from 'rxjs';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated: use native scroll
|
|
5
|
-
*/
|
|
6
|
-
export declare class TuiScrollService {
|
|
7
|
-
private readonly performanceRef;
|
|
8
|
-
private readonly animationFrame$;
|
|
9
|
-
private readonly zone;
|
|
10
|
-
scroll$(elementOrWindow: Element | Window, scrollTop: number, scrollLeft?: number, duration?: number): Observable<[number, number]>;
|
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiScrollService, never>;
|
|
12
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<TuiScrollService>;
|
|
13
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare const TUI_THEME_COLOR: InjectionToken<string>;
|
|
4
|
-
interface TuiThemeColor {
|
|
5
|
-
get color(): string;
|
|
6
|
-
set color(value: string);
|
|
7
|
-
}
|
|
8
|
-
export declare class TuiThemeColorService implements TuiThemeColor {
|
|
9
|
-
private current;
|
|
10
|
-
private readonly doc;
|
|
11
|
-
private readonly meta;
|
|
12
|
-
constructor();
|
|
13
|
-
get color(): string;
|
|
14
|
-
set color(content: string);
|
|
15
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiThemeColorService, never>;
|
|
16
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<TuiThemeColorService>;
|
|
17
|
-
}
|
|
18
|
-
export {};
|
package/tokens/base-href.d.ts
DELETED
package/tokens/range.d.ts
DELETED
package/types/safe-html.d.ts
DELETED
package/types/values-of.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type TuiValuesOf<T> = T[keyof T];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tuiGetGradientData(gradient: string): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tuiHexToRgb(hex: string): [number, number, number];
|
package/utils/color/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './get-gradient-data';
|
|
2
|
-
export * from './hex-to-rgb';
|
|
3
|
-
export * from './hex-to-rgba';
|
|
4
|
-
export * from './hsv-to-rgb';
|
|
5
|
-
export * from './parse-color';
|
|
6
|
-
export * from './parse-gradient';
|
|
7
|
-
export * from './rgb-to-hex';
|
|
8
|
-
export * from './rgb-to-hsv';
|
|
9
|
-
export * from './rgba-to-hex';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tuiParseColor(color: string): [number, number, number, number];
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface TuiParsedGradient {
|
|
2
|
-
readonly side: TuiGradientDirection;
|
|
3
|
-
readonly stops: ReadonlyArray<{
|
|
4
|
-
readonly color: string;
|
|
5
|
-
readonly position: string;
|
|
6
|
-
}>;
|
|
7
|
-
}
|
|
8
|
-
export type TuiGradientDirection = 'to bottom left' | 'to bottom right' | 'to bottom' | 'to left' | 'to right' | 'to top left' | 'to top right' | 'to top';
|
|
9
|
-
export declare function tuiParseGradient(input: string): TuiParsedGradient;
|
|
10
|
-
export declare function tuiToGradient({ stops, side }: TuiParsedGradient): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tuiRgbToHex(r: number, g: number, b: number): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tuiRgbToHsv(r: number, g: number, b: number): [number, number, number];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tuiIsCurrentTarget({ target, currentTarget }: Event): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tuiRetargetedBoundaryCrossing(event: Event): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tuiIsMouseFocusable(element: Element): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tuiToInteger(value: number | string): number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const changeDateSeparator: (dateString: string, newDateSeparator: string) => string;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated: drop in v5.0
|
|
4
|
-
*/
|
|
5
|
-
export declare function tuiCreateToken<T>(defaults?: T): InjectionToken<T>;
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated: drop in v5.0
|
|
8
|
-
*/
|
|
9
|
-
export declare function tuiCreateTokenFromFactory<T>(factory?: () => T): InjectionToken<T>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type QueryList } from '@angular/core';
|
|
2
|
-
/**
|
|
3
|
-
* Extracts original array from {@link QueryList} rather than
|
|
4
|
-
* creating a copy like {@link QueryList.toArray} does.
|
|
5
|
-
* @param queryList
|
|
6
|
-
* @returns original array from {@link QueryList}.
|
|
7
|
-
*/
|
|
8
|
-
export declare function tuiGetOriginalArrayFromQueryList<T>(queryList: QueryList<T>): readonly T[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tuiIsFalsy(value: unknown): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const tuiObjectShallowEquals: <T extends object>(a: T, b: T) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tuiUniqBy<T extends Record<string, any>>(array: readonly T[], key: keyof T): readonly T[];
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|