@taiga-ui/kit 2.31.0 → 2.32.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/bundles/taiga-ui-kit-components-arrow.umd.js +31 -8
- package/bundles/taiga-ui-kit-components-arrow.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-arrow.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-arrow.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-carousel.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-carousel.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-carousel.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-combo-box.umd.js +11 -10
- package/bundles/taiga-ui-kit-components-combo-box.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-combo-box.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-combo-box.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-inline.umd.js +2 -15
- package/bundles/taiga-ui-kit-components-input-inline.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-inline.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-inline.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-range.umd.js +7 -4
- package/bundles/taiga-ui-kit-components-input-range.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-range.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-input-range.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-slider.umd.js +7 -4
- package/bundles/taiga-ui-kit-components-input-slider.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-slider.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-slider.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-tag.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-tag.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-tag.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-time.umd.js +14 -7
- package/bundles/taiga-ui-kit-components-input-time.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-time.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-input-time.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-multi-select.umd.js +23 -11
- package/bundles/taiga-ui-kit-components-multi-select.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-multi-select.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-multi-select.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-select.umd.js +9 -7
- package/bundles/taiga-ui-kit-components-select.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-select.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-select.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-constants.umd.js +8 -0
- package/bundles/taiga-ui-kit-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-constants.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-constants.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-mask.umd.js +21 -9
- package/bundles/taiga-ui-kit-utils-mask.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-mask.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-utils-mask.umd.min.js.map +1 -1
- package/components/arrow/arrow-options.d.ts +16 -0
- package/components/arrow/arrow.component.d.ts +5 -3
- package/components/arrow/index.d.ts +1 -0
- package/components/arrow/taiga-ui-kit-components-arrow.metadata.json +1 -1
- package/components/carousel/taiga-ui-kit-components-carousel.metadata.json +1 -1
- package/components/combo-box/combo-box.component.d.ts +3 -1
- package/components/combo-box/taiga-ui-kit-components-combo-box.metadata.json +1 -1
- package/components/input-inline/input-inline.component.d.ts +0 -1
- package/components/input-inline/taiga-ui-kit-components-input-inline.metadata.json +1 -1
- package/components/input-range/input-range.component.d.ts +2 -1
- package/components/input-range/taiga-ui-kit-components-input-range.metadata.json +1 -1
- package/components/input-slider/input-slider.component.d.ts +2 -1
- package/components/input-slider/taiga-ui-kit-components-input-slider.metadata.json +1 -1
- package/components/input-tag/taiga-ui-kit-components-input-tag.metadata.json +1 -1
- package/components/input-time/input-time-options.d.ts +3 -0
- package/components/input-time/input-time.component.d.ts +7 -7
- package/components/input-time/taiga-ui-kit-components-input-time.metadata.json +1 -1
- package/components/multi-select/multi-select.component.d.ts +4 -1
- package/components/multi-select/taiga-ui-kit-components-multi-select.metadata.json +1 -1
- package/components/select/select.component.d.ts +3 -1
- package/components/select/taiga-ui-kit-components-select.metadata.json +1 -1
- package/constants/index.d.ts +1 -0
- package/constants/max-time-values.d.ts +2 -0
- package/constants/taiga-ui-kit-constants.metadata.json +1 -1
- package/esm2015/components/arrow/arrow-options.js +17 -0
- package/esm2015/components/arrow/arrow.component.js +12 -8
- package/esm2015/components/arrow/arrow.module.js +3 -2
- package/esm2015/components/arrow/index.js +2 -1
- package/esm2015/components/carousel/carousel.component.js +1 -1
- package/esm2015/components/combo-box/combo-box.component.js +13 -12
- package/esm2015/components/input-inline/input-inline.component.js +4 -13
- package/esm2015/components/input-range/input-range.component.js +9 -6
- package/esm2015/components/input-slider/input-slider.component.js +9 -6
- package/esm2015/components/input-tag/input-tag.component.js +1 -1
- package/esm2015/components/input-time/input-time-options.js +4 -1
- package/esm2015/components/input-time/input-time.component.js +10 -5
- package/esm2015/components/multi-select/multi-select.component.js +17 -8
- package/esm2015/components/select/select.component.js +11 -9
- package/esm2015/constants/index.js +2 -1
- package/esm2015/constants/max-time-values.js +7 -0
- package/esm2015/types/index.js +1 -1
- package/esm2015/types/time-format-parts.js +1 -0
- package/esm2015/utils/mask/create-auto-corrected-time-pipe.js +9 -6
- package/esm2015/utils/mask/create-time-mask.js +19 -8
- package/esm5/components/arrow/arrow-options.js +17 -0
- package/esm5/components/arrow/arrow.component.js +12 -8
- package/esm5/components/arrow/arrow.module.js +3 -2
- package/esm5/components/arrow/index.js +2 -1
- package/esm5/components/carousel/carousel.component.js +1 -1
- package/esm5/components/combo-box/combo-box.component.js +13 -12
- package/esm5/components/input-inline/input-inline.component.js +4 -17
- package/esm5/components/input-range/input-range.component.js +9 -6
- package/esm5/components/input-slider/input-slider.component.js +9 -6
- package/esm5/components/input-tag/input-tag.component.js +1 -1
- package/esm5/components/input-time/input-time-options.js +4 -1
- package/esm5/components/input-time/input-time.component.js +10 -5
- package/esm5/components/multi-select/multi-select.component.js +21 -8
- package/esm5/components/select/select.component.js +11 -9
- package/esm5/constants/index.js +2 -1
- package/esm5/constants/max-time-values.js +7 -0
- package/esm5/types/index.js +1 -1
- package/esm5/types/time-format-parts.js +1 -0
- package/esm5/utils/mask/create-auto-corrected-time-pipe.js +9 -6
- package/esm5/utils/mask/create-time-mask.js +18 -7
- package/fesm2015/taiga-ui-kit-components-arrow.js +29 -11
- package/fesm2015/taiga-ui-kit-components-arrow.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-carousel.js +1 -1
- package/fesm2015/taiga-ui-kit-components-combo-box.js +12 -11
- package/fesm2015/taiga-ui-kit-components-combo-box.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-inline.js +3 -12
- package/fesm2015/taiga-ui-kit-components-input-inline.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-range.js +8 -5
- package/fesm2015/taiga-ui-kit-components-input-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-slider.js +8 -5
- package/fesm2015/taiga-ui-kit-components-input-slider.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-tag.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-time.js +11 -3
- package/fesm2015/taiga-ui-kit-components-input-time.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-multi-select.js +16 -7
- package/fesm2015/taiga-ui-kit-components-multi-select.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-select.js +10 -8
- package/fesm2015/taiga-ui-kit-components-select.js.map +1 -1
- package/fesm2015/taiga-ui-kit-constants.js +8 -1
- package/fesm2015/taiga-ui-kit-constants.js.map +1 -1
- package/fesm2015/taiga-ui-kit-utils-mask.js +25 -12
- package/fesm2015/taiga-ui-kit-utils-mask.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-arrow.js +29 -11
- package/fesm5/taiga-ui-kit-components-arrow.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-carousel.js +1 -1
- package/fesm5/taiga-ui-kit-components-combo-box.js +12 -11
- package/fesm5/taiga-ui-kit-components-combo-box.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-inline.js +3 -16
- package/fesm5/taiga-ui-kit-components-input-inline.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-range.js +8 -5
- package/fesm5/taiga-ui-kit-components-input-range.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-slider.js +8 -5
- package/fesm5/taiga-ui-kit-components-input-slider.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-tag.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-time.js +11 -3
- package/fesm5/taiga-ui-kit-components-input-time.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-multi-select.js +20 -7
- package/fesm5/taiga-ui-kit-components-multi-select.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-select.js +10 -8
- package/fesm5/taiga-ui-kit-components-select.js.map +1 -1
- package/fesm5/taiga-ui-kit-constants.js +8 -1
- package/fesm5/taiga-ui-kit-constants.js.map +1 -1
- package/fesm5/taiga-ui-kit-utils-mask.js +23 -11
- package/fesm5/taiga-ui-kit-utils-mask.js.map +1 -1
- package/package.json +12 -12
- package/types/index.d.ts +1 -0
- package/types/taiga-ui-kit-types.metadata.json +1 -1
- package/types/time-format-parts.d.ts +1 -0
- package/utils/mask/create-auto-corrected-time-pipe.d.ts +2 -1
- package/utils/mask/create-time-mask.d.ts +2 -1
- package/utils/mask/taiga-ui-kit-utils-mask.metadata.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TuiDay, DATE_FILLER_LENGTH, DATE_RANGE_FILLER_LENGTH, TuiDayRange, RANGE_SEPARATOR_CHAR, tuiAssert, CHAR_NO_BREAK_SPACE, CHAR_EN_DASH } from '@taiga-ui/cdk';
|
|
2
|
-
import { __read, __spread } from 'tslib';
|
|
3
|
-
import {
|
|
2
|
+
import { __assign, __read, __spread } from 'tslib';
|
|
3
|
+
import { MAX_TIME_VALUES, DATE_TIME_SEPARATOR } from '@taiga-ui/kit/constants';
|
|
4
4
|
import { TUI_DIGIT_REGEXP } from '@taiga-ui/core';
|
|
5
5
|
|
|
6
6
|
function normalizeDateValue(dateValue, _a) {
|
|
@@ -64,16 +64,17 @@ function tuiCreateAutoCorrectedDateRangePipe(config) {
|
|
|
64
64
|
* Adjusts the entered time by omitting only suitable values for hours and minutes
|
|
65
65
|
* @returns time as a string
|
|
66
66
|
*/
|
|
67
|
-
function tuiCreateAutoCorrectedTimePipe(timeMode) {
|
|
67
|
+
function tuiCreateAutoCorrectedTimePipe(timeMode, maxValues) {
|
|
68
68
|
if (timeMode === void 0) { timeMode = 'HH:MM'; }
|
|
69
|
+
if (maxValues === void 0) { maxValues = {}; }
|
|
69
70
|
var timeFormatArray = ['HH', 'MM', 'SS', 'MS'];
|
|
70
|
-
var
|
|
71
|
+
var _maxValues = __assign(__assign({}, MAX_TIME_VALUES), maxValues);
|
|
71
72
|
return function (conformedValue) {
|
|
72
73
|
var indexesOfPipedChars = [];
|
|
73
74
|
var conformedValueArr = conformedValue.split('');
|
|
74
75
|
timeFormatArray.forEach(function (format) {
|
|
75
76
|
var position = timeMode.indexOf(format);
|
|
76
|
-
var maxFirstDigit = parseInt(
|
|
77
|
+
var maxFirstDigit = parseInt(_maxValues[format].toString().substr(0, 1), 10);
|
|
77
78
|
if (parseInt(conformedValueArr[position], 10) > maxFirstDigit) {
|
|
78
79
|
conformedValueArr[position + 1] = conformedValueArr[position];
|
|
79
80
|
conformedValueArr[position] = '0';
|
|
@@ -81,8 +82,8 @@ function tuiCreateAutoCorrectedTimePipe(timeMode) {
|
|
|
81
82
|
}
|
|
82
83
|
});
|
|
83
84
|
var isInvalid = timeFormatArray.some(function (format) {
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
var part = parseInt(conformedValue.substr(timeMode.indexOf(format), 2), 10);
|
|
86
|
+
return part > _maxValues[format];
|
|
86
87
|
});
|
|
87
88
|
return isInvalid
|
|
88
89
|
? false
|
|
@@ -141,10 +142,21 @@ function tuiCreateDateRangeMask(dateMode, dateSeparator) {
|
|
|
141
142
|
], dateMask);
|
|
142
143
|
}
|
|
143
144
|
|
|
144
|
-
function
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
function tuiCreateTimePartMask(maxPartValue, prefix) {
|
|
146
|
+
var partLength = typeof maxPartValue === 'number' ? maxPartValue.toString().length : 0;
|
|
147
|
+
if (!partLength) {
|
|
148
|
+
return [];
|
|
149
|
+
}
|
|
150
|
+
var regExp = Array.from({ length: partLength }, function () { return TUI_DIGIT_REGEXP; });
|
|
151
|
+
if (prefix) {
|
|
152
|
+
regExp.unshift(prefix);
|
|
153
|
+
}
|
|
154
|
+
return regExp;
|
|
155
|
+
}
|
|
156
|
+
function tuiCreateTimeMask(mode, maxValues) {
|
|
157
|
+
if (maxValues === void 0) { maxValues = {}; }
|
|
158
|
+
var _maxValues = __assign(__assign({}, MAX_TIME_VALUES), maxValues);
|
|
159
|
+
return __spread(tuiCreateTimePartMask(_maxValues.HH), tuiCreateTimePartMask(_maxValues.MM, ':'), (mode.includes('HH:MM:SS') ? tuiCreateTimePartMask(_maxValues.SS, ':') : []), (mode === 'HH:MM:SS.MSS' ? tuiCreateTimePartMask(_maxValues.MS, '.') : []));
|
|
148
160
|
}
|
|
149
161
|
|
|
150
162
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-utils-mask.js","sources":["ng://@taiga-ui/kit/utils/mask/create-auto-corrected-date-pipe.ts","ng://@taiga-ui/kit/utils/mask/create-auto-corrected-date-range-pipe.ts","ng://@taiga-ui/kit/utils/mask/create-auto-corrected-time-pipe.ts","ng://@taiga-ui/kit/utils/mask/create-auto-corrected-date-time-pipe.ts","ng://@taiga-ui/kit/utils/mask/create-date-mask.ts","ng://@taiga-ui/kit/utils/mask/create-date-range-mask.ts","ng://@taiga-ui/kit/utils/mask/create-time-mask.ts","ng://@taiga-ui/kit/utils/mask/taiga-ui-kit-utils-mask.ts"],"sourcesContent":["import {DATE_FILLER_LENGTH, TuiDateMode, TuiDay} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler, TuiWithOptionalMinMaxWithValue} from '@taiga-ui/core';\n\nexport interface TuiAutoCorrectedDatePipeConfigs\n extends TuiWithOptionalMinMaxWithValue<TuiDay | null, TuiDay> {\n dateFormat: TuiDateMode;\n dateSeparator: string;\n}\n\nexport function normalizeDateValue(\n dateValue: string,\n {value, min, max, dateFormat, dateSeparator}: TuiAutoCorrectedDatePipeConfigs,\n): string {\n return value && value.toString(dateFormat, dateSeparator) === dateValue\n ? dateValue\n : TuiDay.normalizeParse(dateValue, dateFormat)\n .dayLimit(min, max)\n .toString(dateFormat, dateSeparator);\n}\n\nexport function tuiCreateAutoCorrectedDatePipe(\n config: TuiAutoCorrectedDatePipeConfigs,\n): TuiTextMaskPipeHandler {\n return value => {\n if (value.length !== DATE_FILLER_LENGTH) {\n return {value};\n }\n\n return {\n value: normalizeDateValue(value, config),\n };\n };\n}\n","import {\n DATE_FILLER_LENGTH,\n DATE_RANGE_FILLER_LENGTH,\n RANGE_SEPARATOR_CHAR,\n TuiDateMode,\n TuiDay,\n TuiDayRange,\n} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler, TuiWithOptionalMinMaxWithValue} from '@taiga-ui/core';\n\ninterface TuiAutoCorrectedDatePipeConfigs\n extends TuiWithOptionalMinMaxWithValue<TuiDayRange | null, TuiDay> {\n dateFormat: TuiDateMode;\n dateSeparator: string;\n}\n\nfunction parseWithLimit(value: string, config: TuiAutoCorrectedDatePipeConfigs): TuiDay {\n return TuiDay.normalizeParse(\n value.slice(0, DATE_FILLER_LENGTH),\n config.dateFormat,\n ).dayLimit(config.min, config.max);\n}\n\nfunction processRawValue(value: string, config: TuiAutoCorrectedDatePipeConfigs): string {\n const {dateFormat, dateSeparator} = config;\n\n switch (value.length) {\n case DATE_FILLER_LENGTH:\n return parseWithLimit(value, config).toString(dateFormat, dateSeparator);\n case DATE_FILLER_LENGTH + RANGE_SEPARATOR_CHAR.length:\n return (\n parseWithLimit(value, config).toString(dateFormat, dateSeparator) +\n RANGE_SEPARATOR_CHAR\n );\n case DATE_RANGE_FILLER_LENGTH:\n return config.value &&\n config.value.toString(dateFormat, dateSeparator) === value\n ? value\n : TuiDayRange.sort(\n parseWithLimit(value.slice(0, DATE_FILLER_LENGTH), config),\n parseWithLimit(\n value.slice(DATE_FILLER_LENGTH + RANGE_SEPARATOR_CHAR.length),\n config,\n ),\n ).toString(dateFormat, dateSeparator);\n default:\n return value;\n }\n}\n\n/**\n * Normalizes date in formatted string\n *\n * Normalizes when:\n *\n * 1. It is a single date\n * 2. It is a single date and a separator\n * 3. It is two dates and a separator between them\n *\n * In **other** cases, the value does not change.\n *\n * @param config with min and max date\n * @return mask pipe handler that handles `min` and `max`\n */\nexport function tuiCreateAutoCorrectedDateRangePipe(\n config: TuiAutoCorrectedDatePipeConfigs,\n): TuiTextMaskPipeHandler {\n return value => ({value: processRawValue(value, config)});\n}\n","import {TuiTimeMode} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler} from '@taiga-ui/core';\n\n/**\n * Adjusts the entered time by omitting only suitable values for hours and minutes\n * @returns time as a string\n */\nexport function tuiCreateAutoCorrectedTimePipe(\n timeMode: TuiTimeMode = 'HH:MM',\n): TuiTextMaskPipeHandler {\n const timeFormatArray: ['HH', 'MM', 'SS', 'MS'] = ['HH', 'MM', 'SS', 'MS'];\n const maxValue = {HH: 23, MM: 59, SS: 59, MS: 999};\n\n return (conformedValue: string) => {\n const indexesOfPipedChars: number[] = [];\n const conformedValueArr = conformedValue.split('');\n\n timeFormatArray.forEach(format => {\n const position = timeMode.indexOf(format);\n const maxFirstDigit = parseInt(maxValue[format].toString().substr(0, 1), 10);\n\n if (parseInt(conformedValueArr[position], 10) > maxFirstDigit) {\n conformedValueArr[position + 1] = conformedValueArr[position];\n conformedValueArr[position] = '0';\n indexesOfPipedChars.push(position);\n }\n });\n\n const isInvalid = timeFormatArray.some(\n format =>\n parseInt(conformedValue.substr(timeMode.indexOf(format), 2), 10) >\n maxValue[format],\n );\n\n return isInvalid\n ? false\n : {\n value: conformedValueArr.join(''),\n indexesOfPipedChars,\n };\n };\n}\n","import {DATE_FILLER_LENGTH, TuiTimeMode} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler} from '@taiga-ui/core';\nimport {DATE_TIME_SEPARATOR} from '@taiga-ui/kit/constants';\n\nimport {\n normalizeDateValue,\n TuiAutoCorrectedDatePipeConfigs,\n} from './create-auto-corrected-date-pipe';\nimport {tuiCreateAutoCorrectedTimePipe} from './create-auto-corrected-time-pipe';\n\ninterface TuiAutoCorrectedDateTimePipeConfigs extends TuiAutoCorrectedDatePipeConfigs {\n timeMode: TuiTimeMode;\n}\n\nexport function tuiCreateAutoCorrectedDateTimePipe(\n configs: TuiAutoCorrectedDateTimePipeConfigs,\n): TuiTextMaskPipeHandler {\n const timePipe = tuiCreateAutoCorrectedTimePipe(configs.timeMode);\n\n return value => {\n if (value.length < DATE_FILLER_LENGTH) {\n return {value};\n }\n\n const [date, time] = value.split(DATE_TIME_SEPARATOR);\n\n const formattedDate = normalizeDateValue(date, configs);\n\n if (!time) {\n return {value: formattedDate};\n }\n\n const pipedTime = timePipe(time, {} as any);\n\n if (!pipedTime || typeof pipedTime === 'string') {\n return false;\n }\n\n return {\n value: `${formattedDate}${DATE_TIME_SEPARATOR}${pipedTime.value}`,\n indexesOfPipedChars: pipedTime.indexesOfPipedChars\n ? pipedTime.indexesOfPipedChars.map(i => i + date.length + 2)\n : undefined,\n };\n };\n}\n","import {tuiAssert, TuiDateMode} from '@taiga-ui/cdk';\nimport {TUI_DIGIT_REGEXP, TuiTextMaskList} from '@taiga-ui/core';\n\nconst TWO_DIGITS = Array(2).fill(TUI_DIGIT_REGEXP);\nconst FOUR_DIGITS = Array(4).fill(TUI_DIGIT_REGEXP);\n\nexport function tuiCreateDateMask(mode: TuiDateMode, separator: string): TuiTextMaskList {\n tuiAssert.assert(separator.length === 1, 'Separator should consist of only 1 symbol');\n\n switch (mode) {\n case 'YMD':\n return [...FOUR_DIGITS, separator, ...TWO_DIGITS, separator, ...TWO_DIGITS];\n case 'MDY':\n case 'DMY':\n default:\n return [...TWO_DIGITS, separator, ...TWO_DIGITS, separator, ...FOUR_DIGITS];\n }\n}\n","import {CHAR_EN_DASH, CHAR_NO_BREAK_SPACE, tuiAssert, TuiDateMode} from '@taiga-ui/cdk';\nimport {TuiTextMaskList} from '@taiga-ui/core';\n\nimport {tuiCreateDateMask} from './create-date-mask';\n\nexport function tuiCreateDateRangeMask(\n dateMode: TuiDateMode,\n dateSeparator: string,\n): TuiTextMaskList {\n tuiAssert.assert(\n dateSeparator.length === 1,\n 'Separator should consist of only 1 symbol',\n );\n\n const dateMask = tuiCreateDateMask(dateMode, dateSeparator);\n\n return [\n ...dateMask,\n CHAR_NO_BREAK_SPACE,\n CHAR_EN_DASH,\n CHAR_NO_BREAK_SPACE,\n ...dateMask,\n ];\n}\n","import {TuiTimeMode} from '@taiga-ui/cdk';\nimport {TUI_DIGIT_REGEXP, TuiTextMaskList} from '@taiga-ui/core';\nimport {TUI_TIME_MASK} from '@taiga-ui/kit/constants';\n\nexport function tuiCreateTimeMask(mode: TuiTimeMode): TuiTextMaskList {\n return [\n ...TUI_TIME_MASK,\n ...(mode.includes('HH:MM:SS') ? [':', TUI_DIGIT_REGEXP, TUI_DIGIT_REGEXP] : []),\n ...(mode === 'HH:MM:SS.MSS'\n ? ['.', TUI_DIGIT_REGEXP, TUI_DIGIT_REGEXP, TUI_DIGIT_REGEXP]\n :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AE,aAAa,CAAC,CAAC;IAE5D,gBACO,QAAQ;QACX,mBAAmB;QACnB,YAAY;QACZ,mBAAmB;OAChB,QAAQ,EACb;AACN;;SCnBgB,iBAAiB,CAAC,IAAiB;IAC/C,gBACO,aAAa,GACZ,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,GAAG,EAAE,IAC1E,IAAI,KAAK,cAAc;UACrB,CAAC,GAAG,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC;UAC3D,EAAE,GACV;AACN;;ACZA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-utils-mask.js","sources":["ng://@taiga-ui/kit/utils/mask/create-auto-corrected-date-pipe.ts","ng://@taiga-ui/kit/utils/mask/create-auto-corrected-date-range-pipe.ts","ng://@taiga-ui/kit/utils/mask/create-auto-corrected-time-pipe.ts","ng://@taiga-ui/kit/utils/mask/create-auto-corrected-date-time-pipe.ts","ng://@taiga-ui/kit/utils/mask/create-date-mask.ts","ng://@taiga-ui/kit/utils/mask/create-date-range-mask.ts","ng://@taiga-ui/kit/utils/mask/create-time-mask.ts","ng://@taiga-ui/kit/utils/mask/taiga-ui-kit-utils-mask.ts"],"sourcesContent":["import {DATE_FILLER_LENGTH, TuiDateMode, TuiDay} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler, TuiWithOptionalMinMaxWithValue} from '@taiga-ui/core';\n\nexport interface TuiAutoCorrectedDatePipeConfigs\n extends TuiWithOptionalMinMaxWithValue<TuiDay | null, TuiDay> {\n dateFormat: TuiDateMode;\n dateSeparator: string;\n}\n\nexport function normalizeDateValue(\n dateValue: string,\n {value, min, max, dateFormat, dateSeparator}: TuiAutoCorrectedDatePipeConfigs,\n): string {\n return value && value.toString(dateFormat, dateSeparator) === dateValue\n ? dateValue\n : TuiDay.normalizeParse(dateValue, dateFormat)\n .dayLimit(min, max)\n .toString(dateFormat, dateSeparator);\n}\n\nexport function tuiCreateAutoCorrectedDatePipe(\n config: TuiAutoCorrectedDatePipeConfigs,\n): TuiTextMaskPipeHandler {\n return value => {\n if (value.length !== DATE_FILLER_LENGTH) {\n return {value};\n }\n\n return {\n value: normalizeDateValue(value, config),\n };\n };\n}\n","import {\n DATE_FILLER_LENGTH,\n DATE_RANGE_FILLER_LENGTH,\n RANGE_SEPARATOR_CHAR,\n TuiDateMode,\n TuiDay,\n TuiDayRange,\n} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler, TuiWithOptionalMinMaxWithValue} from '@taiga-ui/core';\n\ninterface TuiAutoCorrectedDatePipeConfigs\n extends TuiWithOptionalMinMaxWithValue<TuiDayRange | null, TuiDay> {\n dateFormat: TuiDateMode;\n dateSeparator: string;\n}\n\nfunction parseWithLimit(value: string, config: TuiAutoCorrectedDatePipeConfigs): TuiDay {\n return TuiDay.normalizeParse(\n value.slice(0, DATE_FILLER_LENGTH),\n config.dateFormat,\n ).dayLimit(config.min, config.max);\n}\n\nfunction processRawValue(value: string, config: TuiAutoCorrectedDatePipeConfigs): string {\n const {dateFormat, dateSeparator} = config;\n\n switch (value.length) {\n case DATE_FILLER_LENGTH:\n return parseWithLimit(value, config).toString(dateFormat, dateSeparator);\n case DATE_FILLER_LENGTH + RANGE_SEPARATOR_CHAR.length:\n return (\n parseWithLimit(value, config).toString(dateFormat, dateSeparator) +\n RANGE_SEPARATOR_CHAR\n );\n case DATE_RANGE_FILLER_LENGTH:\n return config.value &&\n config.value.toString(dateFormat, dateSeparator) === value\n ? value\n : TuiDayRange.sort(\n parseWithLimit(value.slice(0, DATE_FILLER_LENGTH), config),\n parseWithLimit(\n value.slice(DATE_FILLER_LENGTH + RANGE_SEPARATOR_CHAR.length),\n config,\n ),\n ).toString(dateFormat, dateSeparator);\n default:\n return value;\n }\n}\n\n/**\n * Normalizes date in formatted string\n *\n * Normalizes when:\n *\n * 1. It is a single date\n * 2. It is a single date and a separator\n * 3. It is two dates and a separator between them\n *\n * In **other** cases, the value does not change.\n *\n * @param config with min and max date\n * @return mask pipe handler that handles `min` and `max`\n */\nexport function tuiCreateAutoCorrectedDateRangePipe(\n config: TuiAutoCorrectedDatePipeConfigs,\n): TuiTextMaskPipeHandler {\n return value => ({value: processRawValue(value, config)});\n}\n","import {TuiTimeMode} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler} from '@taiga-ui/core';\nimport {MAX_TIME_VALUES} from '@taiga-ui/kit/constants';\nimport {TuiTimeFormatParts} from '@taiga-ui/kit/types';\n\n/**\n * Adjusts the entered time by omitting only suitable values for hours and minutes\n * @returns time as a string\n */\nexport function tuiCreateAutoCorrectedTimePipe(\n timeMode: TuiTimeMode = 'HH:MM',\n maxValues: Partial<Record<TuiTimeFormatParts, number>> = {},\n): TuiTextMaskPipeHandler {\n const timeFormatArray: TuiTimeFormatParts[] = ['HH', 'MM', 'SS', 'MS'];\n const _maxValues: Record<TuiTimeFormatParts, number> = {\n ...MAX_TIME_VALUES,\n ...maxValues,\n };\n\n return (conformedValue: string) => {\n const indexesOfPipedChars: number[] = [];\n const conformedValueArr = conformedValue.split('');\n\n timeFormatArray.forEach(format => {\n const position = timeMode.indexOf(format);\n const maxFirstDigit = parseInt(\n _maxValues[format].toString().substr(0, 1),\n 10,\n );\n\n if (parseInt(conformedValueArr[position], 10) > maxFirstDigit) {\n conformedValueArr[position + 1] = conformedValueArr[position];\n conformedValueArr[position] = '0';\n indexesOfPipedChars.push(position);\n }\n });\n\n const isInvalid = timeFormatArray.some(format => {\n const part: number = parseInt(\n conformedValue.substr(timeMode.indexOf(format), 2),\n 10,\n );\n\n return part > _maxValues[format];\n });\n\n return isInvalid\n ? false\n : {\n value: conformedValueArr.join(''),\n indexesOfPipedChars,\n };\n };\n}\n","import {DATE_FILLER_LENGTH, TuiTimeMode} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler} from '@taiga-ui/core';\nimport {DATE_TIME_SEPARATOR} from '@taiga-ui/kit/constants';\n\nimport {\n normalizeDateValue,\n TuiAutoCorrectedDatePipeConfigs,\n} from './create-auto-corrected-date-pipe';\nimport {tuiCreateAutoCorrectedTimePipe} from './create-auto-corrected-time-pipe';\n\ninterface TuiAutoCorrectedDateTimePipeConfigs extends TuiAutoCorrectedDatePipeConfigs {\n timeMode: TuiTimeMode;\n}\n\nexport function tuiCreateAutoCorrectedDateTimePipe(\n configs: TuiAutoCorrectedDateTimePipeConfigs,\n): TuiTextMaskPipeHandler {\n const timePipe = tuiCreateAutoCorrectedTimePipe(configs.timeMode);\n\n return value => {\n if (value.length < DATE_FILLER_LENGTH) {\n return {value};\n }\n\n const [date, time] = value.split(DATE_TIME_SEPARATOR);\n\n const formattedDate = normalizeDateValue(date, configs);\n\n if (!time) {\n return {value: formattedDate};\n }\n\n const pipedTime = timePipe(time, {} as any);\n\n if (!pipedTime || typeof pipedTime === 'string') {\n return false;\n }\n\n return {\n value: `${formattedDate}${DATE_TIME_SEPARATOR}${pipedTime.value}`,\n indexesOfPipedChars: pipedTime.indexesOfPipedChars\n ? pipedTime.indexesOfPipedChars.map(i => i + date.length + 2)\n : undefined,\n };\n };\n}\n","import {tuiAssert, TuiDateMode} from '@taiga-ui/cdk';\nimport {TUI_DIGIT_REGEXP, TuiTextMaskList} from '@taiga-ui/core';\n\nconst TWO_DIGITS = Array(2).fill(TUI_DIGIT_REGEXP);\nconst FOUR_DIGITS = Array(4).fill(TUI_DIGIT_REGEXP);\n\nexport function tuiCreateDateMask(mode: TuiDateMode, separator: string): TuiTextMaskList {\n tuiAssert.assert(separator.length === 1, 'Separator should consist of only 1 symbol');\n\n switch (mode) {\n case 'YMD':\n return [...FOUR_DIGITS, separator, ...TWO_DIGITS, separator, ...TWO_DIGITS];\n case 'MDY':\n case 'DMY':\n default:\n return [...TWO_DIGITS, separator, ...TWO_DIGITS, separator, ...FOUR_DIGITS];\n }\n}\n","import {CHAR_EN_DASH, CHAR_NO_BREAK_SPACE, tuiAssert, TuiDateMode} from '@taiga-ui/cdk';\nimport {TuiTextMaskList} from '@taiga-ui/core';\n\nimport {tuiCreateDateMask} from './create-date-mask';\n\nexport function tuiCreateDateRangeMask(\n dateMode: TuiDateMode,\n dateSeparator: string,\n): TuiTextMaskList {\n tuiAssert.assert(\n dateSeparator.length === 1,\n 'Separator should consist of only 1 symbol',\n );\n\n const dateMask = tuiCreateDateMask(dateMode, dateSeparator);\n\n return [\n ...dateMask,\n CHAR_NO_BREAK_SPACE,\n CHAR_EN_DASH,\n CHAR_NO_BREAK_SPACE,\n ...dateMask,\n ];\n}\n","import {TuiTimeMode} from '@taiga-ui/cdk';\nimport {TUI_DIGIT_REGEXP, TuiTextMaskList} from '@taiga-ui/core';\nimport {MAX_TIME_VALUES} from '@taiga-ui/kit/constants';\nimport {TuiTimeFormatParts} from '@taiga-ui/kit/types';\n\nfunction tuiCreateTimePartMask(\n maxPartValue: number | undefined,\n prefix?: string,\n): Array<string | RegExp> {\n const partLength =\n typeof maxPartValue === 'number' ? maxPartValue.toString().length : 0;\n\n if (!partLength) {\n return [];\n }\n\n const regExp = Array.from<undefined, RegExp | string>(\n {length: partLength},\n () => TUI_DIGIT_REGEXP,\n );\n\n if (prefix) {\n regExp.unshift(prefix);\n }\n\n return regExp;\n}\n\nexport function tuiCreateTimeMask(\n mode: TuiTimeMode,\n maxValues: Partial<Record<TuiTimeFormatParts, number>> = {},\n): TuiTextMaskList {\n const _maxValues: Record<TuiTimeFormatParts, number> = {\n ...MAX_TIME_VALUES,\n ...maxValues,\n };\n\n return [\n ...tuiCreateTimePartMask(_maxValues.HH),\n ...tuiCreateTimePartMask(_maxValues.MM, ':'),\n ...(mode.includes('HH:MM:SS') ? tuiCreateTimePartMask(_maxValues.SS, ':') : []),\n ...(mode === 'HH:MM:SS.MSS' ? tuiCreateTimePartMask(_maxValues.MS, '.') : []),\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;SASgB,kBAAkB,CAC9B,SAAiB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BA,SAAS,qBAAqB,CAC1B,YAAgC,EAChC,MAAe;IAEf,IAAM,UAAU,GACZ,OAAO,YAAY,KAAK,QAAQ,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;IAE1E,IAAI,CAAC,UAAU,EAAE;QACb,OAAO,EAAE,CAAC;KACb;IAED,IAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CACrB,EAAC,MAAM,EAAE,UAAU,EAAC,EACpB,cAAM,OAAA,gBAAgB,GAAA,CACzB,CAAC;IAEF,IAAI,MAAM,EAAE;QACR,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;KAC1B;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;SAEe,iBAAiB,CAC7B,IAAiB,EACjB,SAA2D;IAA3D,0BAAA,EAAA,cAA2D;IAE3D,IAAM,UAAU,yBACT,eAAe,GACf,SAAS,CACf,CAAC;IAEF,gBACO,qBAAqB,CAAC,UAAU,CAAC,EAAE,CAAC,EACpC,qBAAqB,CAAC,UAAU,CAAC,EAAE,EAAE,GAAG,CAAC,GACxC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,qBAAqB,CAAC,UAAU,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,IAC1E,IAAI,KAAK,cAAc,GAAG,qBAAqB,CAAC,UAAU,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,GAC9E;AACN;;AC3CA;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/kit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.32.0",
|
|
4
4
|
"description": "Taiga UI Angular main components kit",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -12,24 +12,24 @@
|
|
|
12
12
|
"license": "Apache-2.0",
|
|
13
13
|
"repository": "https://github.com/tinkoff/taiga-ui",
|
|
14
14
|
"homepage": "https://github.com/tinkoff/taiga-ui",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"angular2-text-mask": "^9.0.0",
|
|
17
|
+
"@ng-web-apis/intersection-observer": "^2.1.0",
|
|
18
|
+
"tslib": "^1.10.0"
|
|
19
|
+
},
|
|
15
20
|
"peerDependencies": {
|
|
16
21
|
"@angular/common": ">=9.0.0",
|
|
17
22
|
"@angular/core": ">=9.0.0",
|
|
18
23
|
"@angular/forms": ">=9.0.0",
|
|
19
24
|
"@angular/router": ">=9.0.0",
|
|
20
|
-
"@ng-web-apis/common": "1.12.1",
|
|
21
|
-
"@ng-web-apis/mutation-observer": "1.1.0",
|
|
22
|
-
"@tinkoff/ng-polymorpheus": "3.1.12",
|
|
23
|
-
"@taiga-ui/cdk": "2.
|
|
24
|
-
"@taiga-ui/core": "2.
|
|
25
|
-
"@taiga-ui/i18n": "2.
|
|
25
|
+
"@ng-web-apis/common": ">=1.12.1",
|
|
26
|
+
"@ng-web-apis/mutation-observer": ">=1.1.0",
|
|
27
|
+
"@tinkoff/ng-polymorpheus": ">=3.1.12",
|
|
28
|
+
"@taiga-ui/cdk": "2.32.0",
|
|
29
|
+
"@taiga-ui/core": "2.32.0",
|
|
30
|
+
"@taiga-ui/i18n": "2.32.0",
|
|
26
31
|
"rxjs": ">=6.0.0"
|
|
27
32
|
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"angular2-text-mask": "9.0.0",
|
|
30
|
-
"@ng-web-apis/intersection-observer": "2.0.1",
|
|
31
|
-
"tslib": "^1.10.0"
|
|
32
|
-
},
|
|
33
33
|
"main": "bundles/taiga-ui-kit.umd.js",
|
|
34
34
|
"module": "fesm5/taiga-ui-kit.js",
|
|
35
35
|
"es2015": "fesm2015/taiga-ui-kit.js",
|
package/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"TuiHandlerWithContext":{"__symbolic":"interface"},"TuiBooleanHandlerWithContext":{"__symbolic":"interface"},"TuiKeySteps":{"__symbolic":"interface"},"TuiMarkerIconModeT":{"__symbolic":"interface"},"TuiStatusT":{"__symbolic":"interface"}},"origins":{"TuiHandlerWithContext":"./handler-with-context","TuiBooleanHandlerWithContext":"./handler-with-context","TuiKeySteps":"./key-steps","TuiMarkerIconModeT":"./marker-icon-mode","TuiStatusT":"./status"},"importAs":"@taiga-ui/kit/types"}
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"TuiHandlerWithContext":{"__symbolic":"interface"},"TuiBooleanHandlerWithContext":{"__symbolic":"interface"},"TuiKeySteps":{"__symbolic":"interface"},"TuiMarkerIconModeT":{"__symbolic":"interface"},"TuiStatusT":{"__symbolic":"interface"},"TuiTimeFormatParts":{"__symbolic":"interface"}},"origins":{"TuiHandlerWithContext":"./handler-with-context","TuiBooleanHandlerWithContext":"./handler-with-context","TuiKeySteps":"./key-steps","TuiMarkerIconModeT":"./marker-icon-mode","TuiStatusT":"./status","TuiTimeFormatParts":"./time-format-parts"},"importAs":"@taiga-ui/kit/types"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type TuiTimeFormatParts = 'HH' | 'MM' | 'SS' | 'MS';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { TuiTimeMode } from '@taiga-ui/cdk';
|
|
2
2
|
import { TuiTextMaskPipeHandler } from '@taiga-ui/core';
|
|
3
|
+
import { TuiTimeFormatParts } from '@taiga-ui/kit/types';
|
|
3
4
|
/**
|
|
4
5
|
* Adjusts the entered time by omitting only suitable values for hours and minutes
|
|
5
6
|
* @returns time as a string
|
|
6
7
|
*/
|
|
7
|
-
export declare function tuiCreateAutoCorrectedTimePipe(timeMode?: TuiTimeMode): TuiTextMaskPipeHandler;
|
|
8
|
+
export declare function tuiCreateAutoCorrectedTimePipe(timeMode?: TuiTimeMode, maxValues?: Partial<Record<TuiTimeFormatParts, number>>): TuiTextMaskPipeHandler;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { TuiTimeMode } from '@taiga-ui/cdk';
|
|
2
2
|
import { TuiTextMaskList } from '@taiga-ui/core';
|
|
3
|
-
|
|
3
|
+
import { TuiTimeFormatParts } from '@taiga-ui/kit/types';
|
|
4
|
+
export declare function tuiCreateTimeMask(mode: TuiTimeMode, maxValues?: Partial<Record<TuiTimeFormatParts, number>>): TuiTextMaskList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"TuiAutoCorrectedDatePipeConfigs":{"__symbolic":"interface"},"normalizeDateValue":{"__symbolic":"function","parameters":["dateValue","value","min","max","dateFormat","dateSeparator"],"value":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"reference","name":"value"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"value"},"member":"toString"},"arguments":[{"__symbolic":"reference","name":"dateFormat"},{"__symbolic":"reference","name":"dateSeparator"}]},"right":{"__symbolic":"reference","name":"dateValue"}}},"thenExpression":{"__symbolic":"reference","name":"dateValue"},"elseExpression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"TuiDay","line":15,"character":10},"member":"normalizeParse"},"arguments":[{"__symbolic":"reference","name":"dateValue"},{"__symbolic":"reference","name":"dateFormat"}]},"member":"dayLimit"},"arguments":[{"__symbolic":"reference","name":"min"},{"__symbolic":"reference","name":"max"}]},"member":"toString"},"arguments":[{"__symbolic":"reference","name":"dateFormat"},{"__symbolic":"reference","name":"dateSeparator"}]}}},"tuiCreateAutoCorrectedDatePipe":{"__symbolic":"function","parameters":["config"],"value":{"__symbolic":"error","message":"Lambda not supported","line":23,"character":11,"module":"./create-auto-corrected-date-pipe"}},"tuiCreateAutoCorrectedDateRangePipe":{"__symbolic":"function","parameters":["config"],"value":{"__symbolic":"error","message":"Lambda not supported","line":67,"character":11,"module":"./create-auto-corrected-date-range-pipe"}},"tuiCreateAutoCorrectedDateTimePipe":{"__symbolic":"function"},"tuiCreateAutoCorrectedTimePipe":{"__symbolic":"function"},"tuiCreateDateMask":{"__symbolic":"function"},"tuiCreateDateRangeMask":{"__symbolic":"function"},"tuiCreateTimeMask":{"__symbolic":"function"
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"TuiAutoCorrectedDatePipeConfigs":{"__symbolic":"interface"},"normalizeDateValue":{"__symbolic":"function","parameters":["dateValue","value","min","max","dateFormat","dateSeparator"],"value":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"reference","name":"value"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"value"},"member":"toString"},"arguments":[{"__symbolic":"reference","name":"dateFormat"},{"__symbolic":"reference","name":"dateSeparator"}]},"right":{"__symbolic":"reference","name":"dateValue"}}},"thenExpression":{"__symbolic":"reference","name":"dateValue"},"elseExpression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"TuiDay","line":15,"character":10},"member":"normalizeParse"},"arguments":[{"__symbolic":"reference","name":"dateValue"},{"__symbolic":"reference","name":"dateFormat"}]},"member":"dayLimit"},"arguments":[{"__symbolic":"reference","name":"min"},{"__symbolic":"reference","name":"max"}]},"member":"toString"},"arguments":[{"__symbolic":"reference","name":"dateFormat"},{"__symbolic":"reference","name":"dateSeparator"}]}}},"tuiCreateAutoCorrectedDatePipe":{"__symbolic":"function","parameters":["config"],"value":{"__symbolic":"error","message":"Lambda not supported","line":23,"character":11,"module":"./create-auto-corrected-date-pipe"}},"tuiCreateAutoCorrectedDateRangePipe":{"__symbolic":"function","parameters":["config"],"value":{"__symbolic":"error","message":"Lambda not supported","line":67,"character":11,"module":"./create-auto-corrected-date-range-pipe"}},"tuiCreateAutoCorrectedDateTimePipe":{"__symbolic":"function"},"tuiCreateAutoCorrectedTimePipe":{"__symbolic":"function"},"tuiCreateDateMask":{"__symbolic":"function"},"tuiCreateDateRangeMask":{"__symbolic":"function"},"tuiCreateTimeMask":{"__symbolic":"function"}},"origins":{"TuiAutoCorrectedDatePipeConfigs":"./create-auto-corrected-date-pipe","normalizeDateValue":"./create-auto-corrected-date-pipe","tuiCreateAutoCorrectedDatePipe":"./create-auto-corrected-date-pipe","tuiCreateAutoCorrectedDateRangePipe":"./create-auto-corrected-date-range-pipe","tuiCreateAutoCorrectedDateTimePipe":"./create-auto-corrected-date-time-pipe","tuiCreateAutoCorrectedTimePipe":"./create-auto-corrected-time-pipe","tuiCreateDateMask":"./create-date-mask","tuiCreateDateRangeMask":"./create-date-range-mask","tuiCreateTimeMask":"./create-time-mask"},"importAs":"@taiga-ui/kit/utils/mask"}
|