@taiga-ui/cdk 4.52.0-canary.6ee9658 → 4.52.0-canary.763e67d
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/constants/used-icons.d.ts +1 -1
- 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/animated/animated.directive.d.ts +1 -3
- package/directives/animated/index.d.ts +0 -1
- package/directives/index.d.ts +0 -1
- package/fesm2022/taiga-ui-cdk-classes.mjs +4 -4
- package/fesm2022/taiga-ui-cdk-classes.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-constants.mjs +2 -2
- package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-date-time.mjs +22 -23
- package/fesm2022/taiga-ui-cdk-date-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs +9 -5
- 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 +5 -4
- 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 +4 -4
- package/fesm2022/taiga-ui-cdk-directives-copy-processor.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-element.mjs +4 -4
- package/fesm2022/taiga-ui-cdk-directives-element.mjs.map +1 -1
- 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 +7 -7
- package/fesm2022/taiga-ui-cdk-directives-hovered.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-item.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-media.mjs +4 -4
- package/fesm2022/taiga-ui-cdk-directives-media.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-native-validator.mjs +5 -4
- package/fesm2022/taiga-ui-cdk-directives-native-validator.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-obscured.mjs +6 -6
- 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 +4 -4
- package/fesm2022/taiga-ui-cdk-directives-transitioned.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-validator.mjs +4 -4
- package/fesm2022/taiga-ui-cdk-directives-validator.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-value-changes.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-visual-viewport.mjs +5 -4
- package/fesm2022/taiga-ui-cdk-directives-visual-viewport.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-with-styles.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-zoom.mjs +8 -7
- package/fesm2022/taiga-ui-cdk-directives-zoom.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-observables.mjs +1 -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 -2
- 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 -26
- package/fesm2022/taiga-ui-cdk-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-dom.mjs +1 -47
- 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 +33 -26
- 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 +9 -30
- package/pipes/index.d.ts +0 -2
- package/portals/portal.d.ts +0 -1
- package/schematics/index.d.ts +1 -0
- package/schematics/index.js +1 -0
- package/schematics/index.js.map +1 -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/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 +2 -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/index.d.ts +0 -2
- package/tokens/removed-element.d.ts +0 -3
- package/types/index.d.ts +0 -2
- package/utils/dom/index.d.ts +0 -5
- 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 -5
- package/utils/miscellaneous/sanitize-text.d.ts +23 -0
- package/directives/animated/animated-parent.directive.d.ts +0 -10
- 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-repeat-times.mjs +0 -60
- package/fesm2022/taiga-ui-cdk-directives-repeat-times.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-repeat-times.mjs +0 -24
- package/fesm2022/taiga-ui-cdk-pipes-repeat-times.mjs.map +0 -1
- package/fesm2022/taiga-ui-cdk-services.mjs +0 -57
- 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 -7
- package/pipes/is-present/index.d.ts +0 -1
- package/pipes/is-present/is-present.pipe.d.ts +0 -7
- package/pipes/repeat-times/index.d.ts +0 -7
- package/services/id.service.d.ts +0 -8
- package/services/index.d.ts +0 -2
- 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/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/flat-length.d.ts +0 -6
- package/utils/miscellaneous/is-falsy.d.ts +0 -1
- package/utils/miscellaneous/object-shallow-equals.d.ts +0 -1
- package/utils/miscellaneous/uniq-by.d.ts +0 -1
- /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
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.migrateAvatarToDirective = migrateAvatarToDirective;
|
|
4
|
+
const elements_1 = require("../../../../utils/templates/elements");
|
|
5
|
+
const inputs_1 = require("../../../../utils/templates/inputs");
|
|
6
|
+
const template_resource_1 = require("../../../../utils/templates/template-resource");
|
|
7
|
+
const replace_tag_1 = require("../../../utils/templates/replace-tag");
|
|
8
|
+
const remove_attrs_1 = require("../../../v4/steps/utils/remove-attrs");
|
|
9
|
+
function migrateAvatarToDirective({ resource, recorder, fileSystem, }) {
|
|
10
|
+
const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
|
|
11
|
+
const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
|
|
12
|
+
const avatarElements = (0, elements_1.findElementsByTagName)(template, 'tui-avatar');
|
|
13
|
+
const elementsWithAvatarAttribute = (0, elements_1.findElementsWithAttribute)(template, 'tuiAvatar');
|
|
14
|
+
const elementsWithBoundAvatarAttribute = (0, elements_1.findElementsWithAttribute)(template, '[tuiAvatar]');
|
|
15
|
+
elementsWithBoundAvatarAttribute.forEach((element) => {
|
|
16
|
+
const loc = element.sourceCodeLocation;
|
|
17
|
+
if (!(loc === null || loc === void 0 ? void 0 : loc.startTag)) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const tuiAvatarAttr = element.attrs.find((a) => a.name === '[tuiavatar]');
|
|
21
|
+
const fallbackBinding = getFallbackBinding(tuiAvatarAttr === null || tuiAvatarAttr === void 0 ? void 0 : tuiAvatarAttr.value);
|
|
22
|
+
if (!tuiAvatarAttr || !fallbackBinding) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
replaceAttribute(recorder, tuiAvatarAttr.name, `tuiAvatar="${fallbackBinding.fallback}"`, loc, templateOffset);
|
|
26
|
+
recorder.insertRight(templateOffset + loc.startTag.endOffset, `<img [src]="${fallbackBinding.source}" />`);
|
|
27
|
+
});
|
|
28
|
+
elementsWithAvatarAttribute.forEach((element) => {
|
|
29
|
+
var _a;
|
|
30
|
+
const loc = element.sourceCodeLocation;
|
|
31
|
+
if (!(loc === null || loc === void 0 ? void 0 : loc.startTag)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const srcAttr = getSrcAttr(element.attrs);
|
|
35
|
+
const tuiAvatarAttr = (0, inputs_1.findAttr)(element.attrs, 'tuiAvatar');
|
|
36
|
+
if (!srcAttr || (tuiAvatarAttr === null || tuiAvatarAttr === void 0 ? void 0 : tuiAvatarAttr.value)) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
replaceAttribute(recorder, (_a = tuiAvatarAttr === null || tuiAvatarAttr === void 0 ? void 0 : tuiAvatarAttr.name) !== null && _a !== void 0 ? _a : 'tuiAvatar', getAvatarAttr(srcAttr), loc, templateOffset);
|
|
40
|
+
(0, remove_attrs_1.removeAttrs)([srcAttr], loc, recorder, templateOffset);
|
|
41
|
+
});
|
|
42
|
+
avatarElements.forEach((element) => {
|
|
43
|
+
const loc = element.sourceCodeLocation;
|
|
44
|
+
if (!(loc === null || loc === void 0 ? void 0 : loc.startTag)) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const srcAttr = getSrcAttr(element.attrs);
|
|
48
|
+
const hasAvatarAttr = hasTuiAvatarAttr(element.attrs);
|
|
49
|
+
const attrToAdd = hasAvatarAttr ? null : getAvatarAttr(srcAttr);
|
|
50
|
+
const raw = template.slice(loc.startTag.startOffset, loc.startTag.endOffset);
|
|
51
|
+
const isSelfClosing = raw.trimEnd().endsWith('/>');
|
|
52
|
+
if (isSelfClosing) {
|
|
53
|
+
const start = loc.startTag;
|
|
54
|
+
const startTagEnd = templateOffset + start.endOffset;
|
|
55
|
+
recorder.remove(startTagEnd - 2, 2);
|
|
56
|
+
recorder.insertRight(startTagEnd - 2, '>');
|
|
57
|
+
recorder.insertRight(startTagEnd - 1, '</span>');
|
|
58
|
+
}
|
|
59
|
+
(0, replace_tag_1.replaceTag)(recorder, loc, 'tui-avatar', 'span', templateOffset, attrToAdd ? [attrToAdd] : []);
|
|
60
|
+
if (srcAttr) {
|
|
61
|
+
(0, remove_attrs_1.removeAttrs)([srcAttr], loc, recorder, templateOffset);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function replaceAttribute(recorder, attrName, attrToAdd, loc, templateOffset) {
|
|
66
|
+
var _a;
|
|
67
|
+
const attrOffset = (_a = loc.attrs) === null || _a === void 0 ? void 0 : _a[attrName];
|
|
68
|
+
if (!attrOffset) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const { startOffset, endOffset } = attrOffset;
|
|
72
|
+
recorder.remove(templateOffset + startOffset - 1, endOffset - startOffset + 1);
|
|
73
|
+
recorder.insertRight(templateOffset + startOffset - 1, ` ${attrToAdd}`);
|
|
74
|
+
}
|
|
75
|
+
function hasTuiAvatarAttr(attrs) {
|
|
76
|
+
return attrs.some(({ name }) => ['[(tuiavatar)]', '[tuiavatar]', 'tuiavatar'].includes(name));
|
|
77
|
+
}
|
|
78
|
+
function getSrcAttr(attrs) {
|
|
79
|
+
var _a, _b;
|
|
80
|
+
return ((_b = (_a = (0, inputs_1.findAttr)(attrs, 'src')) !== null && _a !== void 0 ? _a : attrs.find((a) => a.name === '[(src)]')) !== null && _b !== void 0 ? _b : attrs.find((a) => a.name === '[src]'));
|
|
81
|
+
}
|
|
82
|
+
function getAvatarAttr(attr) {
|
|
83
|
+
var _a;
|
|
84
|
+
if (!attr) {
|
|
85
|
+
return 'tuiAvatar';
|
|
86
|
+
}
|
|
87
|
+
const map = {
|
|
88
|
+
src: (value) => (value ? `tuiAvatar="${value}"` : 'tuiAvatar'),
|
|
89
|
+
'[src]': (value) => (value ? `[tuiAvatar]="${value}"` : '[tuiAvatar]'),
|
|
90
|
+
'[(src)]': (value) => (value ? `[(tuiAvatar)]="${value}"` : '[(tuiAvatar)]'),
|
|
91
|
+
};
|
|
92
|
+
const mapper = map[attr.name];
|
|
93
|
+
return (_a = mapper === null || mapper === void 0 ? void 0 : mapper(attr.value)) !== null && _a !== void 0 ? _a : 'tuiAvatar';
|
|
94
|
+
}
|
|
95
|
+
function getFallbackBinding(value) {
|
|
96
|
+
var _a;
|
|
97
|
+
if (!value) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
const fallbackRegExp = /^([^|]+?)\s*\|\s*tuiFallbackSrc\s*:\s*(['"])([^'"]+)\2(?:\s*\|\s*async)?\s*$/;
|
|
101
|
+
const match = fallbackRegExp.exec(value);
|
|
102
|
+
if (!match) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
const [, source, , fallback] = match;
|
|
106
|
+
return {
|
|
107
|
+
source: (_a = source === null || source === void 0 ? void 0 : source.trim()) !== null && _a !== void 0 ? _a : '',
|
|
108
|
+
fallback: fallback !== null && fallback !== void 0 ? fallback : '',
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=migrate-avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-avatar.js","sourceRoot":"","sources":["../../../../../../../projects/cdk/schematics/ng-update/v5/steps/templates/migrate-avatar.ts"],"names":[],"mappings":";;AAuBA,4DA0GC;AA7HD,mEAG8C;AAC9C,+DAA4D;AAC5D,qFAGuD;AAEvD,sEAAgE;AAChE,uEAAiE;AAQjE,SAAgB,wBAAwB,CAAC,EACrC,QAAQ,EACR,QAAQ,EACR,UAAU,GAKb;IACG,MAAM,QAAQ,GAAG,IAAA,mDAA+B,EAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACvE,MAAM,cAAc,GAAG,IAAA,qCAAiB,EAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,cAAc,GAAG,IAAA,gCAAqB,EAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IACrE,MAAM,2BAA2B,GAAG,IAAA,oCAAyB,EAAC,QAAQ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AK,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAEzC,IAAI,CAAC,KAAK,EAAE,CAAC;QACT,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,EAAE,MAAM,EAAE,AAAD,EAAG,QAAQ,CAAC,GAAG,KAAK,CAAC;IAErC,OAAO;QACH,MAAM,EAAE,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,EAAE,mCAAI,EAAE;QAC5B,QAAQ,EAAE,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,EAAE;KAC3B,CAAC;AACN,CAAC"}
|
|
@@ -7,6 +7,7 @@ const testing_1 = require("@angular-devkit/schematics/testing");
|
|
|
7
7
|
const ng_morph_1 = require("ng-morph");
|
|
8
8
|
function runMigration(options) {
|
|
9
9
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
10
|
+
var _a, _b, _c;
|
|
10
11
|
const { collection, component = '', template = '', packageJson = '{}', schematicName = 'updateToV5', } = options;
|
|
11
12
|
const host = new testing_1.UnitTestTree(new schematics_1.HostTree());
|
|
12
13
|
const runner = new testing_1.SchematicTestRunner('schematics', collection);
|
|
@@ -17,9 +18,9 @@ function runMigration(options) {
|
|
|
17
18
|
yield runner.runSchematic(schematicName, { 'skip-logs': true }, host);
|
|
18
19
|
(0, ng_morph_1.saveActiveProject)();
|
|
19
20
|
return {
|
|
20
|
-
component: host.readContent('test/app/test.ts'),
|
|
21
|
-
template: host.readContent('test/app/test.html'),
|
|
22
|
-
packageJson: host.readContent('package.json'),
|
|
21
|
+
component: (_a = host.readContent('test/app/test.ts')) !== null && _a !== void 0 ? _a : '',
|
|
22
|
+
template: (_b = host.readContent('test/app/test.html')) !== null && _b !== void 0 ? _b : '',
|
|
23
|
+
packageJson: (_c = host.readContent('package.json')) !== null && _c !== void 0 ? _c : '{}',
|
|
23
24
|
};
|
|
24
25
|
});
|
|
25
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-migration.js","sourceRoot":"","sources":["../../../../projects/cdk/schematics/utils/run-migration.ts"],"names":[],"mappings":";;AAkBA,oCA2BC;;AA7CD,2DAAoD;AACpD,gEAAqF;AACrF,uCAA4E;AAgB5E,SAAsB,YAAY,CAAC,OAAc
|
|
1
|
+
{"version":3,"file":"run-migration.js","sourceRoot":"","sources":["../../../../projects/cdk/schematics/utils/run-migration.ts"],"names":[],"mappings":";;AAkBA,oCA2BC;;AA7CD,2DAAoD;AACpD,gEAAqF;AACrF,uCAA4E;AAgB5E,SAAsB,YAAY,CAAC,OAAc;;;QAC7C,MAAM,EACF,UAAU,EACV,SAAS,GAAG,EAAE,EACd,QAAQ,GAAG,EAAE,EACb,WAAW,GAAG,IAAI,EAClB,aAAa,GAAG,YAAY,GAC/B,GAAG,OAAO,CAAC;QAEZ,MAAM,IAAI,GAAG,IAAI,sBAAY,CAAC,IAAI,qBAAQ,EAAE,CAAC,CAAC;QAC9C,MAAM,MAAM,GAAG,IAAI,6BAAmB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QAEjE,IAAA,2BAAgB,EAAC,IAAA,wBAAa,EAAC,IAAI,CAAC,CAAC,CAAC;QAEtC,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;QAC5C,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;QAEzC,MAAM,MAAM,CAAC,YAAY,CAAC,aAAa,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,EAAE,IAAI,CAAC,CAAC;QAEpE,IAAA,4BAAiB,GAAE,CAAC;QAEpB,OAAO;YACH,SAAS,EAAE,MAAA,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,mCAAI,EAAE;YACrD,QAAQ,EAAE,MAAA,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,mCAAI,EAAE;YACtD,WAAW,EAAE,MAAA,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,mCAAI,IAAI;SACxD,CAAC;IACN,CAAC;CAAA"}
|
package/tokens/index.d.ts
CHANGED
package/types/index.d.ts
CHANGED
package/utils/dom/index.d.ts
CHANGED
|
@@ -6,13 +6,8 @@ export * from './get-clipboard-data-text';
|
|
|
6
6
|
export * from './get-document-or-shadow-root';
|
|
7
7
|
export * from './get-element-obscurers';
|
|
8
8
|
export * from './get-element-offset';
|
|
9
|
-
export * from './get-element-point';
|
|
10
9
|
export * from './get-selected-text';
|
|
11
10
|
export * from './inject-element';
|
|
12
|
-
export * from './is-current-target';
|
|
13
11
|
export * from './is-element-editable';
|
|
14
|
-
export * from './is-inside-iframe';
|
|
15
|
-
export * from './is-node-in';
|
|
16
12
|
export * from './point-to-client-rect';
|
|
17
|
-
export * from './retarget-boundary-crossing';
|
|
18
13
|
export * from './value';
|
|
@@ -4,11 +4,6 @@ export interface TuiGetClosestFocusableOptions {
|
|
|
4
4
|
* current HTML element
|
|
5
5
|
*/
|
|
6
6
|
initial: Element;
|
|
7
|
-
/**
|
|
8
|
-
* @description:
|
|
9
|
-
* determine if only keyboard focus is of interest
|
|
10
|
-
*/
|
|
11
|
-
keyboard?: boolean;
|
|
12
7
|
/**
|
|
13
8
|
* @description:
|
|
14
9
|
* should it look backwards instead (find item that will be focused with Shift + Tab)
|
|
@@ -24,4 +19,4 @@ export interface TuiGetClosestFocusableOptions {
|
|
|
24
19
|
* @description:
|
|
25
20
|
* Finds the closest element that can be focused with a keyboard or mouse in theory
|
|
26
21
|
*/
|
|
27
|
-
export declare function tuiGetClosestFocusable({ initial, root, previous,
|
|
22
|
+
export declare function tuiGetClosestFocusable({ initial, root, previous, }: TuiGetClosestFocusableOptions): HTMLElement | null;
|
package/utils/focus/index.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
export * from './blur-native-focused';
|
|
2
1
|
export * from './focused-in';
|
|
3
2
|
export * from './get-closest-focusable';
|
|
4
|
-
export * from './get-
|
|
5
|
-
export * from './is-
|
|
6
|
-
export * from './is-
|
|
7
|
-
export * from './is-
|
|
8
|
-
export * from './is-native-mouse-focusable';
|
|
3
|
+
export * from './get-focused';
|
|
4
|
+
export * from './is-focusable';
|
|
5
|
+
export * from './is-focused';
|
|
6
|
+
export * from './is-focused-in';
|
|
9
7
|
export * from './move-focus';
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* be focused, for example element can have display: none applied to it or any other
|
|
5
5
|
* circumstances could prevent actual focus.
|
|
6
6
|
*/
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function tuiIsFocusable(element: Element): boolean;
|
package/utils/index.d.ts
CHANGED
package/utils/math/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function tuiGenerateId(): string;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
export * from './array-remove';
|
|
2
2
|
export * from './array-shallow-equals';
|
|
3
3
|
export * from './array-toggle';
|
|
4
|
-
export * from './change-date-separator';
|
|
5
4
|
export * from './count-filled-controls';
|
|
6
5
|
export * from './default-sort';
|
|
7
6
|
export * from './distance-between-touches';
|
|
8
7
|
export * from './ease-in-out-quad';
|
|
9
|
-
export * from './flat-length';
|
|
10
8
|
export * from './font-size-watcher';
|
|
9
|
+
export * from './generate-id';
|
|
11
10
|
export * from './is-control-empty';
|
|
12
|
-
export * from './is-falsy';
|
|
13
11
|
export * from './is-number';
|
|
14
12
|
export * from './is-object';
|
|
15
13
|
export * from './is-present';
|
|
@@ -17,9 +15,8 @@ export * from './is-string';
|
|
|
17
15
|
export * from './mark-control-as-touched-and-validate';
|
|
18
16
|
export * from './nullable-same';
|
|
19
17
|
export * from './obfuscate';
|
|
20
|
-
export * from './object-shallow-equals';
|
|
21
18
|
export * from './pure';
|
|
22
19
|
export * from './px';
|
|
20
|
+
export * from './sanitize-text';
|
|
23
21
|
export * from './set-signal';
|
|
24
|
-
export * from './uniq-by';
|
|
25
22
|
export * from './with-styles';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sanitizes pasted or dropped text by removing invisible and control characters
|
|
3
|
+
* that can appear in clipboard or drag-and-drop data.
|
|
4
|
+
*
|
|
5
|
+
* Removes:
|
|
6
|
+
* 1. ASCII control characters (0x00–0x1F) — non-printable characters like
|
|
7
|
+
* NULL, BEL, BS, CR, LF, TAB, ESC, etc.
|
|
8
|
+
* 2. Extended control characters (0x7F–0x9F) — C1 control codes from ISO-8859-1,
|
|
9
|
+
* often found in legacy or malformed text encodings.
|
|
10
|
+
* 3. Zero-width and special Unicode characters:
|
|
11
|
+
* - U+200B ZERO WIDTH SPACE
|
|
12
|
+
* - U+200C ZERO WIDTH NON-JOINER
|
|
13
|
+
* - U+200D ZERO WIDTH JOINER
|
|
14
|
+
* - U+FEFF BYTE ORDER MARK (BOM)
|
|
15
|
+
*
|
|
16
|
+
* @param {string} value - The input string from clipboard or drag event.
|
|
17
|
+
* @returns {string} - A cleaned string without control or invisible characters.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* tuiSanitizeText('Hello\u0000World\u200B!');
|
|
21
|
+
* // → "HelloWorld!"
|
|
22
|
+
*/
|
|
23
|
+
export declare function tuiSanitizeText(value: string): string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./animated.directive";
|
|
3
|
-
import * as i2 from "@ng-web-apis/mutation-observer";
|
|
4
|
-
export declare class TuiAnimatedParent {
|
|
5
|
-
private readonly el;
|
|
6
|
-
private readonly renderer;
|
|
7
|
-
protected handle(): void;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiAnimatedParent, never>;
|
|
9
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiAnimatedParent, "[tuiAnimatedParent]", never, {}, {}, never, never, true, [{ directive: typeof i1.TuiAnimated; inputs: {}; outputs: {}; }, { directive: typeof i2.WaMutationObserver; inputs: {}; outputs: { "waMutationObserver": "waMutationObserver"; }; }]>;
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './repeat-times.directive';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type TuiContext } from '@taiga-ui/cdk/types';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class TuiRepeatTimesContext implements TuiContext<number> {
|
|
4
|
-
readonly $implicit: number;
|
|
5
|
-
constructor($implicit: number);
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Directive similar to ngFor but using a number of repetitions rather than an array
|
|
9
|
-
*
|
|
10
|
-
* {@link TuiRepeatTimes.tuiRepeatTimesOf requested number of times}.
|
|
11
|
-
* {@link TuiRepeatTimesContext context} for every instance of the template inherits outer context and stores
|
|
12
|
-
* {@link TuiRepeatTimesContext.$implicit index} of a template instance.
|
|
13
|
-
*/
|
|
14
|
-
export declare class TuiRepeatTimes {
|
|
15
|
-
private readonly vcr;
|
|
16
|
-
private readonly template;
|
|
17
|
-
readonly tuiRepeatTimesOf: import("@angular/core").InputSignal<number>;
|
|
18
|
-
protected readonly setCount: import("@angular/core").EffectRef;
|
|
19
|
-
private addContainers;
|
|
20
|
-
private removeContainers;
|
|
21
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiRepeatTimes, never>;
|
|
22
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiRepeatTimes, "[tuiRepeatTimes][tuiRepeatTimesOf]", never, { "tuiRepeatTimesOf": { "alias": "tuiRepeatTimesOf"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
23
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ViewContainerRef, TemplateRef, input, effect, Directive } from '@angular/core';
|
|
3
|
-
import { tuiClamp } from '@taiga-ui/cdk/utils/math';
|
|
4
|
-
|
|
5
|
-
const MAX_VALUE = 0x10000;
|
|
6
|
-
class TuiRepeatTimesContext {
|
|
7
|
-
constructor($implicit) {
|
|
8
|
-
this.$implicit = $implicit;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Directive similar to ngFor but using a number of repetitions rather than an array
|
|
13
|
-
*
|
|
14
|
-
* {@link TuiRepeatTimes.tuiRepeatTimesOf requested number of times}.
|
|
15
|
-
* {@link TuiRepeatTimesContext context} for every instance of the template inherits outer context and stores
|
|
16
|
-
* {@link TuiRepeatTimesContext.$implicit index} of a template instance.
|
|
17
|
-
*/
|
|
18
|
-
class TuiRepeatTimes {
|
|
19
|
-
constructor() {
|
|
20
|
-
this.vcr = inject(ViewContainerRef);
|
|
21
|
-
this.template = inject((TemplateRef));
|
|
22
|
-
this.tuiRepeatTimesOf = input.required();
|
|
23
|
-
this.setCount = effect(() => {
|
|
24
|
-
const count = this.tuiRepeatTimesOf();
|
|
25
|
-
const safeCount = Math.floor(tuiClamp(count, 0, MAX_VALUE));
|
|
26
|
-
const { length } = this.vcr;
|
|
27
|
-
if (count < length) {
|
|
28
|
-
this.removeContainers(length - count);
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
this.addContainers(safeCount);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
addContainers(count) {
|
|
36
|
-
for (let index = this.vcr.length; index < count; index++) {
|
|
37
|
-
this.vcr.createEmbeddedView(this.template, new TuiRepeatTimesContext(index));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
removeContainers(amount) {
|
|
41
|
-
for (let index = 0; index < amount; index++) {
|
|
42
|
-
this.vcr.remove();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiRepeatTimes, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
46
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.15", type: TuiRepeatTimes, isStandalone: true, selector: "[tuiRepeatTimes][tuiRepeatTimesOf]", inputs: { tuiRepeatTimesOf: { classPropertyName: "tuiRepeatTimesOf", publicName: "tuiRepeatTimesOf", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
|
|
47
|
-
}
|
|
48
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiRepeatTimes, decorators: [{
|
|
49
|
-
type: Directive,
|
|
50
|
-
args: [{
|
|
51
|
-
selector: '[tuiRepeatTimes][tuiRepeatTimesOf]',
|
|
52
|
-
}]
|
|
53
|
-
}] });
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Generated bundle index. Do not edit.
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
|
-
export { TuiRepeatTimes, TuiRepeatTimesContext };
|
|
60
|
-
//# sourceMappingURL=taiga-ui-cdk-directives-repeat-times.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-directives-repeat-times.mjs","sources":["../../../projects/cdk/directives/repeat-times/repeat-times.directive.ts","../../../projects/cdk/directives/repeat-times/taiga-ui-cdk-directives-repeat-times.ts"],"sourcesContent":["import {\n Directive,\n effect,\n inject,\n input,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport {type TuiContext} from '@taiga-ui/cdk/types';\nimport {tuiClamp} from '@taiga-ui/cdk/utils/math';\n\nconst MAX_VALUE = 0x10000;\n\nexport class TuiRepeatTimesContext implements TuiContext<number> {\n constructor(public readonly $implicit: number) {}\n}\n\n/**\n * Directive similar to ngFor but using a number of repetitions rather than an array\n *\n * {@link TuiRepeatTimes.tuiRepeatTimesOf requested number of times}.\n * {@link TuiRepeatTimesContext context} for every instance of the template inherits outer context and stores\n * {@link TuiRepeatTimesContext.$implicit index} of a template instance.\n */\n@Directive({\n selector: '[tuiRepeatTimes][tuiRepeatTimesOf]',\n})\nexport class TuiRepeatTimes {\n private readonly vcr = inject(ViewContainerRef);\n private readonly template = inject(TemplateRef<TuiRepeatTimesContext>);\n\n public readonly tuiRepeatTimesOf = input.required<number>();\n\n protected readonly setCount = effect(() => {\n const count = this.tuiRepeatTimesOf();\n\n const safeCount = Math.floor(tuiClamp(count, 0, MAX_VALUE));\n\n const {length} = this.vcr;\n\n if (count < length) {\n this.removeContainers(length - count);\n } else {\n this.addContainers(safeCount);\n }\n });\n\n private addContainers(count: number): void {\n for (let index = this.vcr.length; index < count; index++) {\n this.vcr.createEmbeddedView<TuiRepeatTimesContext>(\n this.template,\n new TuiRepeatTimesContext(index),\n );\n }\n }\n\n private removeContainers(amount: number): void {\n for (let index = 0; index < amount; index++) {\n this.vcr.remove();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAWA,MAAM,SAAS,GAAG,OAAO;MAEZ,qBAAqB,CAAA;AAC9B,IAAA,WAAA,CAA4B,SAAiB,EAAA;QAAjB,IAAS,CAAA,SAAA,GAAT,SAAS;;AACxC;AAED;;;;;;AAMG;MAIU,cAAc,CAAA;AAH3B,IAAA,WAAA,GAAA;AAIqB,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC9B,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,EAAC,WAAkC,EAAC;AAEtD,QAAA,IAAA,CAAA,gBAAgB,GAAG,KAAK,CAAC,QAAQ,EAAU;AAExC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,MAAK;AACtC,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,EAAE;AAErC,YAAA,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;AAE3D,YAAA,MAAM,EAAC,MAAM,EAAC,GAAG,IAAI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 from '@angular/core';
|
|
2
|
-
import { Pipe } from '@angular/core';
|
|
3
|
-
import { tuiIsPresent } from '@taiga-ui/cdk/utils';
|
|
4
|
-
|
|
5
|
-
class TuiIsPresentPipe {
|
|
6
|
-
transform(value) {
|
|
7
|
-
return tuiIsPresent(value);
|
|
8
|
-
}
|
|
9
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiIsPresentPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
10
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: TuiIsPresentPipe, isStandalone: true, name: "tuiIsPresent" }); }
|
|
11
|
-
}
|
|
12
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiIsPresentPipe, decorators: [{
|
|
13
|
-
type: Pipe,
|
|
14
|
-
args: [{
|
|
15
|
-
name: 'tuiIsPresent',
|
|
16
|
-
}]
|
|
17
|
-
}] });
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Generated bundle index. Do not edit.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
export { TuiIsPresentPipe };
|
|
24
|
-
//# sourceMappingURL=taiga-ui-cdk-pipes-is-present.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-pipes-is-present.mjs","sources":["../../../projects/cdk/pipes/is-present/is-present.pipe.ts","../../../projects/cdk/pipes/is-present/taiga-ui-cdk-pipes-is-present.ts"],"sourcesContent":["import {Pipe, type PipeTransform} from '@angular/core';\nimport {tuiIsPresent} from '@taiga-ui/cdk/utils';\n\n@Pipe({\n name: 'tuiIsPresent',\n})\nexport class TuiIsPresentPipe implements PipeTransform {\n public transform<T>(value?: T | null): value is T {\n return tuiIsPresent(value);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAMa,gBAAgB,CAAA;AAClB,IAAA,SAAS,CAAI,KAAgB,EAAA;AAChC,QAAA,OAAO,YAAY,CAAC,KAAK,CAAC;;+GAFrB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;6GAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,cAAA,EAAA,CAAA,CAAA;;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,IAAI,EAAE,cAAc;AACvB,iBAAA;;;ACLD;;AAEG;;;;"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe } from '@angular/core';
|
|
3
|
-
import { tuiClamp } from '@taiga-ui/cdk/utils';
|
|
4
|
-
|
|
5
|
-
class TuiRepeatTimesPipe {
|
|
6
|
-
transform(n) {
|
|
7
|
-
return Array.from({ length: tuiClamp(n, 0, n) }, (_, i) => i);
|
|
8
|
-
}
|
|
9
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiRepeatTimesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
10
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: TuiRepeatTimesPipe, isStandalone: true, name: "tuiRepeatTimes" }); }
|
|
11
|
-
}
|
|
12
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiRepeatTimesPipe, decorators: [{
|
|
13
|
-
type: Pipe,
|
|
14
|
-
args: [{
|
|
15
|
-
name: 'tuiRepeatTimes',
|
|
16
|
-
}]
|
|
17
|
-
}] });
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Generated bundle index. Do not edit.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
export { TuiRepeatTimesPipe };
|
|
24
|
-
//# sourceMappingURL=taiga-ui-cdk-pipes-repeat-times.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-pipes-repeat-times.mjs","sources":["../../../projects/cdk/pipes/repeat-times/index.ts","../../../projects/cdk/pipes/repeat-times/taiga-ui-cdk-pipes-repeat-times.ts"],"sourcesContent":["import {Pipe, type PipeTransform} from '@angular/core';\nimport {tuiClamp} from '@taiga-ui/cdk/utils';\n\n@Pipe({\n name: 'tuiRepeatTimes',\n})\nexport class TuiRepeatTimesPipe implements PipeTransform {\n public transform(n: number): number[] {\n return Array.from({length: tuiClamp(n, 0, n)}, (_, i) => i);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAMa,kBAAkB,CAAA;AACpB,IAAA,SAAS,CAAC,CAAS,EAAA;QACtB,OAAO,KAAK,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;;+GAFtD,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;6GAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,gBAAA,EAAA,CAAA,CAAA;;4FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,IAAI,EAAE,gBAAgB;AACzB,iBAAA;;;ACLD;;AAEG;;;;"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, inject, InjectionToken } from '@angular/core';
|
|
3
|
-
import { DOCUMENT } from '@angular/common';
|
|
4
|
-
import { Meta } from '@angular/platform-browser';
|
|
5
|
-
|
|
6
|
-
class TuiIdService {
|
|
7
|
-
static { this.autoId = 0; }
|
|
8
|
-
generate() {
|
|
9
|
-
return `tui_${TuiIdService.autoId++}${Date.now()}`;
|
|
10
|
-
}
|
|
11
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiIdService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
12
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiIdService, providedIn: 'root' }); }
|
|
13
|
-
}
|
|
14
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiIdService, decorators: [{
|
|
15
|
-
type: Injectable,
|
|
16
|
-
args: [{
|
|
17
|
-
providedIn: 'root',
|
|
18
|
-
}]
|
|
19
|
-
}] });
|
|
20
|
-
function tuiInjectId() {
|
|
21
|
-
return inject(TuiIdService).generate();
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const TUI_THEME_COLOR = new InjectionToken(ngDevMode ? 'TUI_THEME_COLOR' : '', {
|
|
25
|
-
factory: () => inject(Meta).getTag('name="theme-color"')?.content ?? '',
|
|
26
|
-
});
|
|
27
|
-
class TuiThemeColorService {
|
|
28
|
-
constructor() {
|
|
29
|
-
this.current = inject(TUI_THEME_COLOR);
|
|
30
|
-
this.doc = inject(DOCUMENT);
|
|
31
|
-
this.meta = inject(Meta);
|
|
32
|
-
this.color = this.current;
|
|
33
|
-
}
|
|
34
|
-
get color() {
|
|
35
|
-
return this.current;
|
|
36
|
-
}
|
|
37
|
-
set color(content) {
|
|
38
|
-
this.current = content;
|
|
39
|
-
this.meta.updateTag({ name: 'theme-color', content });
|
|
40
|
-
this.doc.documentElement.style.setProperty('--tui-theme-color', content);
|
|
41
|
-
}
|
|
42
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiThemeColorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
43
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiThemeColorService, providedIn: 'root' }); }
|
|
44
|
-
}
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiThemeColorService, decorators: [{
|
|
46
|
-
type: Injectable,
|
|
47
|
-
args: [{
|
|
48
|
-
providedIn: 'root',
|
|
49
|
-
}]
|
|
50
|
-
}], ctorParameters: () => [] });
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Generated bundle index. Do not edit.
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
export { TUI_THEME_COLOR, TuiIdService, TuiThemeColorService, tuiInjectId };
|
|
57
|
-
//# sourceMappingURL=taiga-ui-cdk-services.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-services.mjs","sources":["../../../projects/cdk/services/id.service.ts","../../../projects/cdk/services/theme-color.service.ts","../../../projects/cdk/services/taiga-ui-cdk-services.ts"],"sourcesContent":["import {inject, Injectable} from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TuiIdService {\n private static autoId = 0;\n\n public generate(): string {\n return `tui_${TuiIdService.autoId++}${Date.now()}`;\n }\n}\n\nexport function tuiInjectId(): string {\n return inject(TuiIdService).generate();\n}\n","import {DOCUMENT} from '@angular/common';\nimport {inject, Injectable, InjectionToken} from '@angular/core';\nimport {Meta} from '@angular/platform-browser';\n\nexport const TUI_THEME_COLOR = new InjectionToken<string>(\n ngDevMode ? 'TUI_THEME_COLOR' : '',\n {\n factory: () => inject(Meta).getTag('name=\"theme-color\"')?.content ?? '',\n },\n);\n\ninterface TuiThemeColor {\n get color(): string;\n set color(value: string);\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TuiThemeColorService implements TuiThemeColor {\n private current = inject(TUI_THEME_COLOR);\n private readonly doc = inject(DOCUMENT);\n private readonly meta = inject(Meta);\n\n constructor() {\n this.color = this.current;\n }\n\n public get color(): string {\n return this.current;\n }\n\n public set color(content: string) {\n this.current = content;\n this.meta.updateTag({name: 'theme-color', content});\n this.doc.documentElement.style.setProperty('--tui-theme-color', content);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAKa,YAAY,CAAA;aACN,IAAM,CAAA,MAAA,GAAG,CAAH,CAAK;IAEnB,QAAQ,GAAA;QACX,OAAO,CAAA,IAAA,EAAO,YAAY,CAAC,MAAM,EAAE,CAAG,EAAA,IAAI,CAAC,GAAG,EAAE,CAAA,CAAE;;+GAJ7C,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAZ,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,cAFT,MAAM,EAAA,CAAA,CAAA;;4FAET,YAAY,EAAA,UAAA,EAAA,CAAA;kBAHxB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE,MAAM;AACrB,iBAAA;;SASe,WAAW,GAAA;AACvB,IAAA,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;AAC1C;;ACXa,MAAA,eAAe,GAAG,IAAI,cAAc,CAC7C,SAAS,GAAG,iBAAiB,GAAG,EAAE,EAClC;AACI,IAAA,OAAO,EAAE,MAAM,MAAM,CAA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