@taiga-ui/cdk 4.11.0 → 4.13.0
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/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/date-time/date-time.d.ts +1 -0
- package/date-time/days.const.d.ts +1 -0
- package/date-time/time.d.ts +3 -0
- package/date-time/types.d.ts +1 -1
- package/directives/click-outside/click-outside.directive.d.ts +3 -0
- package/directives/index.d.ts +1 -0
- package/directives/visual-viewport/index.d.ts +1 -0
- package/directives/visual-viewport/visual-viewport.directive.d.ts +8 -0
- package/esm2022/classes/control.mjs +2 -2
- package/esm2022/constants/version.mjs +2 -2
- package/esm2022/date-time/date-time.mjs +2 -1
- package/esm2022/date-time/days.const.mjs +3 -2
- package/esm2022/date-time/time.mjs +32 -6
- package/esm2022/date-time/types.mjs +1 -1
- package/esm2022/directives/click-outside/click-outside.directive.mjs +4 -1
- package/esm2022/directives/hovered/hovered.service.mjs +3 -5
- package/esm2022/directives/index.mjs +2 -1
- package/esm2022/directives/visual-viewport/index.mjs +2 -0
- package/esm2022/directives/visual-viewport/taiga-ui-cdk-directives-visual-viewport.mjs +5 -0
- package/esm2022/directives/visual-viewport/visual-viewport.directive.mjs +34 -0
- package/esm2022/observables/watch.mjs +3 -2
- package/esm2022/services/popover.service.mjs +1 -1
- package/esm2022/utils/focus/is-native-keyboard-focusable.mjs +7 -7
- package/esm2022/utils/miscellaneous/is-valid-url.mjs +2 -2
- package/esm2022/utils/miscellaneous/provide-options.mjs +4 -5
- package/fesm2022/taiga-ui-cdk-classes.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-classes.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-constants.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-date-time.mjs +33 -6
- package/fesm2022/taiga-ui-cdk-date-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs +3 -0
- package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-hovered.mjs +2 -4
- package/fesm2022/taiga-ui-cdk-directives-hovered.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-visual-viewport.mjs +40 -0
- package/fesm2022/taiga-ui-cdk-directives-visual-viewport.mjs.map +1 -0
- package/fesm2022/taiga-ui-cdk-directives.mjs +1 -0
- package/fesm2022/taiga-ui-cdk-directives.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-observables.mjs +2 -2
- package/fesm2022/taiga-ui-cdk-observables.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-services.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-focus.mjs +6 -6
- package/fesm2022/taiga-ui-cdk-utils-focus.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs +4 -5
- package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs.map +1 -1
- package/observables/watch.d.ts +2 -2
- package/package.json +13 -6
- package/schematics/ng-update/v4/migrate-css-vars/palette.d.ts +1 -1
- package/schematics/ng-update/v4/migrate-css-vars/palette.js +2 -2
- package/schematics/ng-update/v4/migrate-css-vars/rename-css-vars.js +1 -1
- package/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.js +0 -5
- package/schematics/ng-update/v4/steps/constants/migration-warnings.js +5 -0
- package/schematics/ng-update/v4/steps/templates/migrate-button-appearance.js +2 -2
- package/schematics/ng-update/v4/steps/templates/migrate-labeled.js +4 -3
- package/schematics/ng-update/v4/steps/templates/migrate-number-precision.js +5 -3
- package/schematics/utils/is-ci.d.ts +3 -0
- package/schematics/utils/is-ci.js +3 -0
- package/schematics/utils/progress.js +1 -2
- package/services/popover.service.d.ts +1 -1
@@ -98,7 +98,7 @@ exports.DEPRECATED_NUMERIC_VARS = {
|
|
98
98
|
'--tui-chart-': '--tui-chart-categorical-0',
|
99
99
|
'--tui-support-': '--tui-chart-categorical-',
|
100
100
|
};
|
101
|
-
exports.NIGHT_VAR_COMMENT = 'TODO:
|
101
|
+
exports.NIGHT_VAR_COMMENT = 'TODO: night variables have been removed. Use tuiTheme="dark" on an element to switch colors to dark theme';
|
102
102
|
exports.DEPRECATE_VARS_WITH_COMMENT = [
|
103
103
|
'--tui-clear-inverse',
|
104
104
|
'--tui-clear-inverse-hover',
|
@@ -113,7 +113,7 @@ exports.DEPRECATE_VARS_WITH_COMMENT = [
|
|
113
113
|
'--tui-warning-bg-night',
|
114
114
|
'--tui-warning-bg-night-hover',
|
115
115
|
'--tui-info-fill-night',
|
116
|
-
'tui-info-bg-night',
|
116
|
+
'--tui-info-bg-night',
|
117
117
|
'--tui-info-bg-night-hover',
|
118
118
|
'--tui-neutral-fill-night',
|
119
119
|
'--tui-neutral-bg-night',
|
@@ -12,7 +12,7 @@ function renameCssVars(pattern = constants_1.ALL_FILES) {
|
|
12
12
|
// leave comments
|
13
13
|
if (!file.getFilePath().endsWith('html')) {
|
14
14
|
palette_1.DEPRECATE_VARS_WITH_COMMENT.forEach((variable) => {
|
15
|
-
const wordRegex = new RegExp(`(^|\\n)(?=[^\\n]
|
15
|
+
const wordRegex = new RegExp(`(^|\\n)(?=[^\\n]*${variable}\\b)`, 'g');
|
16
16
|
text = text.replaceAll(wordRegex, `$1// ${palette_1.NIGHT_VAR_COMMENT}\n`);
|
17
17
|
});
|
18
18
|
}
|
@@ -34,11 +34,6 @@ exports.ATTR_WITH_VALUES_TO_REPLACE = [
|
|
34
34
|
newAttrName: 'tuiHintAppearance',
|
35
35
|
valueReplacer: [{ from: 'onDark', to: 'dark' }],
|
36
36
|
},
|
37
|
-
{
|
38
|
-
attrNames: ['appearance'],
|
39
|
-
newAttrName: 'appearance',
|
40
|
-
valueReplacer: [{ from: 'secondary-destructive', to: 'destructive' }],
|
41
|
-
},
|
42
37
|
{
|
43
38
|
attrNames: ['[pseudoActive]'],
|
44
39
|
newAttrName: '[tuiAppearanceState]',
|
@@ -178,4 +178,9 @@ exports.MIGRATION_WARNINGS = [
|
|
178
178
|
moduleSpecifier: '@taiga-ui/core',
|
179
179
|
message: 'TUI_ANIMATIONS_DURATION is deleted. Use TUI_ANIMATIONS_SPEED instead (300ms divided by your previous value of TUI_ANIMATIONS_DURATION)',
|
180
180
|
},
|
181
|
+
{
|
182
|
+
name: 'TUI_DIALOG_CLOSES_ON_BACK',
|
183
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
184
|
+
message: 'TUI_DIALOG_CLOSES_ON_BACK is deleted, you can create your own approach based on window.history property',
|
185
|
+
},
|
181
186
|
];
|
@@ -26,7 +26,7 @@ function migrateButtonAppearance({ resource, recorder, fileSystem, }) {
|
|
26
26
|
if (whiteBlockActiveAttr) {
|
27
27
|
(0, remove_attrs_1.removeAttrs)([whiteBlockActiveAttr], sourceCodeLocation, recorder, templateOffset);
|
28
28
|
const { startOffset } = ((_a = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[whiteBlockActiveAttr.name]) || { startOffset: 0, endOffset: 0 };
|
29
|
-
recorder.insertLeft(startOffset + templateOffset, ` ${appearanceInputName}="
|
29
|
+
recorder.insertLeft(startOffset + templateOffset, ` ${appearanceInputName}="outline-grayscale"`);
|
30
30
|
recorder.insertLeft(startOffset + templateOffset, ' tuiAppearanceMode="checked"');
|
31
31
|
}
|
32
32
|
});
|
@@ -37,5 +37,5 @@ function migrateButtonAppearance({ resource, recorder, fileSystem, }) {
|
|
37
37
|
}
|
38
38
|
exports.migrateButtonAppearance = migrateButtonAppearance;
|
39
39
|
function addTodo(recorder, templateOffset) {
|
40
|
-
recorder.insertRight(templateOffset, '<!-- Taiga migration TODO: tuiButton "whiteblock-active" appearance is no longer available. Use \'appearance="
|
40
|
+
recorder.insertRight(templateOffset, '<!-- Taiga migration TODO: tuiButton "whiteblock-active" appearance is no longer available. Use \'appearance="outline-grayscale" tuiAppearanceMode="checked"\' -->\n');
|
41
41
|
}
|
@@ -29,7 +29,7 @@ function migrateLabeled({ resource, recorder, fileSystem, }) {
|
|
29
29
|
'tui-radio-labeled',
|
30
30
|
]);
|
31
31
|
elements.forEach(({ sourceCodeLocation, tagName, attrs }) => {
|
32
|
-
var _a, _b, _c, _d;
|
32
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
33
33
|
if (!sourceCodeLocation) {
|
34
34
|
return;
|
35
35
|
}
|
@@ -38,8 +38,9 @@ function migrateLabeled({ resource, recorder, fileSystem, }) {
|
|
38
38
|
const ngForAttr = (0, inputs_1.findAttr)(attrs, '*ngFor');
|
39
39
|
(0, add_import_to_closest_module_1.addImportToClosestModule)(resource.componentPath, tagName === 'tui-checkbox-labeled' ? 'TuiCheckbox' : 'TuiRadio', '@taiga-ui/kit');
|
40
40
|
recorder.insertRight(templateOffset + (((_a = sourceCodeLocation.startTag) === null || _a === void 0 ? void 0 : _a.startOffset) || 1) - 1, `<label${ngForAttr ? ` *ngFor="${ngForAttr.value}"` : ''} tuiLabel>`);
|
41
|
-
recorder.remove(templateOffset + ((_c = (_b = sourceCodeLocation.endTag) === null || _b === void 0 ? void 0 : _b.startOffset) !== null && _c !== void 0 ? _c : 0),
|
42
|
-
|
41
|
+
recorder.remove(templateOffset + ((_c = (_b = sourceCodeLocation.endTag) === null || _b === void 0 ? void 0 : _b.startOffset) !== null && _c !== void 0 ? _c : 0), ((_e = (_d = sourceCodeLocation.endTag) === null || _d === void 0 ? void 0 : _d.endOffset) !== null && _e !== void 0 ? _e : 0) -
|
42
|
+
((_g = (_f = sourceCodeLocation.endTag) === null || _f === void 0 ? void 0 : _f.startOffset) !== null && _g !== void 0 ? _g : 0));
|
43
|
+
recorder.insertRight(templateOffset + (((_h = sourceCodeLocation.endTag) === null || _h === void 0 ? void 0 : _h.startOffset) || 1), '</label>');
|
43
44
|
const attrsToRemove = [ngForAttrLocation, contentAlignAttrLocation].filter((location) => Boolean(location));
|
44
45
|
attrsToRemove.forEach((location) => {
|
45
46
|
recorder.remove(templateOffset + location.startOffset, location.endOffset - location.startOffset);
|
@@ -12,7 +12,7 @@ function migrateNumberPrecision({ resource, recorder, fileSystem, }) {
|
|
12
12
|
const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
|
13
13
|
const elements = (0, elements_1.findElementsByTagName)(template, 'tui-input-number');
|
14
14
|
elements.forEach(({ attrs, sourceCodeLocation }) => {
|
15
|
-
var _a;
|
15
|
+
var _a, _b;
|
16
16
|
if (!sourceCodeLocation) {
|
17
17
|
return;
|
18
18
|
}
|
@@ -20,9 +20,11 @@ function migrateNumberPrecision({ resource, recorder, fileSystem, }) {
|
|
20
20
|
const precisionAttr = (0, inputs_1.findAttr)(attrs, 'precision');
|
21
21
|
if (decimalAttr || precisionAttr) {
|
22
22
|
(0, add_import_to_closest_module_1.addImportToClosestModule)(resource.componentPath, 'TuiNumberFormat', '@taiga-ui/core');
|
23
|
-
const
|
23
|
+
const decimalValue = (decimalAttr === null || decimalAttr === void 0 ? void 0 : decimalAttr.value) === 'never' ? '' : decimalAttr === null || decimalAttr === void 0 ? void 0 : decimalAttr.value;
|
24
|
+
const precisionValue = (decimalAttr === null || decimalAttr === void 0 ? void 0 : decimalAttr.value) === 'never' ? 0 : ((_a = precisionAttr === null || precisionAttr === void 0 ? void 0 : precisionAttr.value) !== null && _a !== void 0 ? _a : '');
|
25
|
+
const format = `{${decimalAttr && decimalValue ? `decimalMode: ${(0, normalize_attr_value_1.normalizeAttrValue)(decimalAttr.name, decimalValue)}` : ''}${decimalValue && precisionValue ? ', ' : ''}${precisionValue || (decimalAttr === null || decimalAttr === void 0 ? void 0 : decimalAttr.value) === 'never' ? `precision: ${precisionValue}` : ''}}`;
|
24
26
|
const formatPart = `[tuiNumberFormat]="${format}"`;
|
25
|
-
const insertTo = (((
|
27
|
+
const insertTo = (((_b = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.startTag) === null || _b === void 0 ? void 0 : _b.startOffset) || 0) +
|
26
28
|
'<tui-input-number '.length;
|
27
29
|
recorder.insertRight(templateOffset + insertTo, formatPart);
|
28
30
|
}
|
@@ -2,6 +2,9 @@
|
|
2
2
|
/// <reference types="node" />
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
4
|
exports.tuiIsCI = void 0;
|
5
|
+
/**
|
6
|
+
* @deprecated: drop in v5.0
|
7
|
+
*/
|
5
8
|
function tuiIsCI() {
|
6
9
|
return (process.env.TUI_CI === 'true' ||
|
7
10
|
!!process.env.CI || // Another CI
|
@@ -4,11 +4,10 @@ exports.setupProgressLogger = void 0;
|
|
4
4
|
/// <reference types="node" />
|
5
5
|
const node_readline_1 = require("node:readline");
|
6
6
|
const ng_morph_1 = require("ng-morph");
|
7
|
-
const is_ci_1 = require("./is-ci");
|
8
7
|
function setupProgressLogger({ total, prefix = '', tabs = 2, }) {
|
9
8
|
let i = 1;
|
10
9
|
return (message, incrementIndex = true) => {
|
11
|
-
if (
|
10
|
+
if (process.env.CI) {
|
12
11
|
return;
|
13
12
|
}
|
14
13
|
const isLast = i === total;
|
@@ -17,8 +17,8 @@ export type TuiPopover<T, O> = T & TuiPopoverContext<O> & {
|
|
17
17
|
export declare abstract class TuiPopoverService<T, K = void> {
|
18
18
|
protected readonly options: T;
|
19
19
|
private readonly component;
|
20
|
-
private readonly items$;
|
21
20
|
private readonly id;
|
21
|
+
protected readonly items$: BehaviorSubject<ReadonlyArray<TuiPopover<T, any>>>;
|
22
22
|
constructor(items: ProviderToken<BehaviorSubject<ReadonlyArray<TuiPopover<T, any>>>>, component: Type<any>, options?: T);
|
23
23
|
open<G = void>(content: PolymorpheusContent<T & TuiPopoverContext<K extends void ? G : K>>, options?: Partial<T>): Observable<K extends void ? G : K>;
|
24
24
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiPopoverService<any, any>, never>;
|