@taiga-ui/core 4.52.0-canary.eb5ffe3 → 4.52.0-canary.ec0802b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/classes/accessors.d.ts +1 -1
- package/components/calendar/calendar-sheet.options.d.ts +1 -3
- package/components/data-list/data-list.component.d.ts +6 -8
- package/components/data-list/opt-group.directive.d.ts +2 -2
- package/components/data-list/option/option.directive.d.ts +5 -6
- package/components/dialog/dialog.component.d.ts +2 -3
- package/components/dialog/dialog.directive.d.ts +4 -3
- package/components/dialog/dialog.options.d.ts +2 -3
- package/components/dialog/dialog.providers.d.ts +1 -2
- package/components/dialog/dialog.service.d.ts +5 -2
- package/components/dialog/index.d.ts +0 -1
- package/components/index.d.ts +1 -2
- package/components/link/link.directive.d.ts +2 -2
- package/components/link/link.options.d.ts +1 -3
- package/components/loader/loader.component.d.ts +7 -7
- package/components/loader/loader.options.d.ts +1 -3
- package/components/modal/index.d.ts +2 -0
- package/components/modal/modal.component.d.ts +17 -0
- package/components/modal/modal.service.d.ts +13 -0
- package/components/notification/index.d.ts +3 -0
- package/components/notification/notification.component.d.ts +14 -0
- package/components/notification/notification.d.ts +3 -0
- package/components/notification/notification.directive.d.ts +7 -12
- package/components/notification/notification.options.d.ts +9 -7
- package/components/notification/notification.service.d.ts +17 -0
- package/components/root/root.component.d.ts +1 -1
- package/components/scrollbar/scroll-into-view.directive.d.ts +3 -2
- package/components/scrollbar/scrollbar.component.d.ts +2 -2
- package/components/scrollbar/scrollbar.directive.d.ts +2 -2
- package/components/spin-button/spin-button.component.d.ts +7 -8
- package/components/textfield/textfield-multi/textfield-multi.component.d.ts +2 -2
- package/components/textfield/textfield.component.d.ts +3 -4
- package/components/textfield/textfield.directive.d.ts +9 -12
- package/directives/{notification/notification.directive.d.ts → alert/alert.directive.d.ts} +3 -3
- package/directives/{notification/notification.service.d.ts → alert/alert.service.d.ts} +3 -3
- package/directives/alert/index.d.ts +2 -0
- package/directives/date-format/date-format.directive.d.ts +3 -7
- package/directives/dropdown/dropdown-hover.options.d.ts +1 -3
- package/directives/dropdown/dropdown-position.directive.d.ts +1 -1
- package/directives/group/group.options.d.ts +1 -3
- package/directives/index.d.ts +1 -1
- package/directives/number-format/number-format.directive.d.ts +3 -7
- package/fesm2022/taiga-ui-core-classes.mjs +1 -1
- package/fesm2022/taiga-ui-core-classes.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-calendar.mjs +9 -15
- package/fesm2022/taiga-ui-core-components-calendar.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-data-list.mjs +36 -70
- package/fesm2022/taiga-ui-core-components-data-list.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-dialog.mjs +33 -90
- package/fesm2022/taiga-ui-core-components-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-icon.mjs +1 -2
- package/fesm2022/taiga-ui-core-components-icon.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-link.mjs +10 -16
- package/fesm2022/taiga-ui-core-components-link.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-loader.mjs +14 -32
- package/fesm2022/taiga-ui-core-components-loader.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-modal.mjs +89 -0
- package/fesm2022/taiga-ui-core-components-modal.mjs.map +1 -0
- package/fesm2022/taiga-ui-core-components-notification.mjs +98 -41
- package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-root.mjs +5 -7
- package/fesm2022/taiga-ui-core-components-root.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-scrollbar.mjs +35 -43
- package/fesm2022/taiga-ui-core-components-scrollbar.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-spin-button.mjs +12 -24
- package/fesm2022/taiga-ui-core-components-spin-button.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-textfield.mjs +38 -75
- package/fesm2022/taiga-ui-core-components-textfield.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components.mjs +1 -2
- package/fesm2022/taiga-ui-core-components.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-alert.mjs +73 -0
- package/fesm2022/taiga-ui-core-directives-alert.mjs.map +1 -0
- package/fesm2022/taiga-ui-core-directives-appearance.mjs +0 -1
- package/fesm2022/taiga-ui-core-directives-appearance.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-date-format.mjs +24 -18
- package/fesm2022/taiga-ui-core-directives-date-format.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-dropdown.mjs +18 -45
- package/fesm2022/taiga-ui-core-directives-dropdown.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-group.mjs +4 -8
- package/fesm2022/taiga-ui-core-directives-group.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-hint.mjs +5 -8
- package/fesm2022/taiga-ui-core-directives-hint.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-icons.mjs +0 -1
- package/fesm2022/taiga-ui-core-directives-icons.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-items-handlers.mjs +0 -3
- package/fesm2022/taiga-ui-core-directives-items-handlers.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-number-format.mjs +30 -18
- package/fesm2022/taiga-ui-core-directives-number-format.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-popup.mjs +2 -2
- package/fesm2022/taiga-ui-core-directives-popup.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives.mjs +1 -1
- package/fesm2022/taiga-ui-core-pipes-auto-color.mjs +0 -1
- package/fesm2022/taiga-ui-core-pipes-auto-color.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs +0 -1
- package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-flag.mjs +0 -1
- package/fesm2022/taiga-ui-core-pipes-flag.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-format-date.mjs +0 -1
- package/fesm2022/taiga-ui-core-pipes-format-date.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-format-number.mjs +21 -12
- package/fesm2022/taiga-ui-core-pipes-format-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-initials.mjs +0 -1
- package/fesm2022/taiga-ui-core-pipes-initials.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-month.mjs +0 -1
- package/fesm2022/taiga-ui-core-pipes-month.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs +0 -1
- package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-tokens.mjs +21 -15
- package/fesm2022/taiga-ui-core-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-utils-format.mjs +1 -0
- package/fesm2022/taiga-ui-core-utils-format.mjs.map +1 -1
- package/package.json +13 -14
- package/pipes/format-number/format-number.pipe.d.ts +5 -3
- package/styles/components/link.less +1 -0
- package/styles/mixins/appearance.less +1 -1
- package/styles/mixins/mixins.less +0 -5
- package/styles/mixins/mixins.scss +0 -5
- package/styles/theme/variables.less +2 -4
- package/tokens/common-icons.d.ts +1 -3
- package/tokens/date-format.d.ts +2 -3
- package/tokens/number-format.d.ts +2 -3
- package/components/alert/alert.component.d.ts +0 -14
- package/components/alert/alert.directive.d.ts +0 -8
- package/components/alert/alert.interfaces.d.ts +0 -13
- package/components/alert/alert.service.d.ts +0 -11
- package/components/alert/alert.tokens.d.ts +0 -6
- package/components/alert/index.d.ts +0 -5
- package/components/dialog/active-zone-adapter.directive.d.ts +0 -11
- package/components/dialog/dialogs.component.d.ts +0 -8
- package/components/header/header.directive.d.ts +0 -17
- package/components/header/index.d.ts +0 -1
- package/directives/notification/index.d.ts +0 -2
- package/fesm2022/taiga-ui-core-components-alert.mjs +0 -110
- package/fesm2022/taiga-ui-core-components-alert.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-components-header.mjs +0 -42
- package/fesm2022/taiga-ui-core-components-header.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-directives-notification.mjs +0 -73
- package/fesm2022/taiga-ui-core-directives-notification.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-pipes-calendar-sheet.mjs","sources":["../../../projects/core/pipes/calendar-sheet/utils.ts","../../../projects/core/pipes/calendar-sheet/calendar-sheet.pipe.ts","../../../projects/core/pipes/calendar-sheet/taiga-ui-core-pipes-calendar-sheet.ts"],"sourcesContent":["/// <reference types=\"@taiga-ui/tsconfig/ng-dev-mode\" />\nimport {DAYS_IN_WEEK, TuiDay, type TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {tuiInRange} from '@taiga-ui/cdk/utils/math';\n\n/**\n * Computes day of week offset of the beginning of the month\n */\nconst getMonthStartDaysOffset = (\n month: TuiMonth,\n firstDayOfWeek: 0 | 1 | 2 | 3 | 4 | 5 | 6,\n): number => {\n const startMonthOffsetFromSunday = new Date(month.year, month.month, 1).getDay();\n\n return startMonthOffsetFromSunday >= firstDayOfWeek\n ? startMonthOffsetFromSunday - firstDayOfWeek\n : DAYS_IN_WEEK - (firstDayOfWeek - startMonthOffsetFromSunday);\n};\n\n/**\n * Calculated day on a calendar grid\n * @return resulting day on these coordinates (could exceed passed month)\n */\nexport const getDayFromMonthRowCol = ({\n month,\n rowIndex,\n colIndex,\n firstDayOfWeek,\n}: {\n /**\n * column in a calendar\n */\n colIndex: number;\n /**\n * first day of the week index (Sunday - 0, Saturday - 6)\n */\n firstDayOfWeek: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n month: TuiMonth;\n /**\n * row in a calendar\n */\n rowIndex: number;\n}): TuiDay => {\n ngDevMode && console.assert(Number.isInteger(rowIndex));\n ngDevMode && console.assert(tuiInRange(rowIndex, 0, 6));\n ngDevMode && console.assert(Number.isInteger(colIndex));\n ngDevMode && console.assert(tuiInRange(colIndex, 0, DAYS_IN_WEEK));\n\n let day =\n rowIndex * DAYS_IN_WEEK +\n colIndex -\n getMonthStartDaysOffset(month, firstDayOfWeek) +\n 1;\n\n if (day > month.daysCount) {\n day -= month.daysCount;\n month = month.append({month: 1});\n }\n\n if (day <= 0) {\n month = month.append({month: -1});\n day = month.daysCount + day;\n }\n\n return new TuiDay(month.year, month.month, day);\n};\n","import {inject, Pipe, type PipeTransform} from '@angular/core';\nimport {DAYS_IN_WEEK, type TuiDay, type TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TUI_FIRST_DAY_OF_WEEK} from '@taiga-ui/core/tokens';\n\nimport {getDayFromMonthRowCol} from './utils';\n\nconst CALENDAR_ROWS_COUNT = 6;\n\n@Pipe({\n
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-pipes-calendar-sheet.mjs","sources":["../../../projects/core/pipes/calendar-sheet/utils.ts","../../../projects/core/pipes/calendar-sheet/calendar-sheet.pipe.ts","../../../projects/core/pipes/calendar-sheet/taiga-ui-core-pipes-calendar-sheet.ts"],"sourcesContent":["/// <reference types=\"@taiga-ui/tsconfig/ng-dev-mode\" />\nimport {DAYS_IN_WEEK, TuiDay, type TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {tuiInRange} from '@taiga-ui/cdk/utils/math';\n\n/**\n * Computes day of week offset of the beginning of the month\n */\nconst getMonthStartDaysOffset = (\n month: TuiMonth,\n firstDayOfWeek: 0 | 1 | 2 | 3 | 4 | 5 | 6,\n): number => {\n const startMonthOffsetFromSunday = new Date(month.year, month.month, 1).getDay();\n\n return startMonthOffsetFromSunday >= firstDayOfWeek\n ? startMonthOffsetFromSunday - firstDayOfWeek\n : DAYS_IN_WEEK - (firstDayOfWeek - startMonthOffsetFromSunday);\n};\n\n/**\n * Calculated day on a calendar grid\n * @return resulting day on these coordinates (could exceed passed month)\n */\nexport const getDayFromMonthRowCol = ({\n month,\n rowIndex,\n colIndex,\n firstDayOfWeek,\n}: {\n /**\n * column in a calendar\n */\n colIndex: number;\n /**\n * first day of the week index (Sunday - 0, Saturday - 6)\n */\n firstDayOfWeek: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n month: TuiMonth;\n /**\n * row in a calendar\n */\n rowIndex: number;\n}): TuiDay => {\n ngDevMode && console.assert(Number.isInteger(rowIndex));\n ngDevMode && console.assert(tuiInRange(rowIndex, 0, 6));\n ngDevMode && console.assert(Number.isInteger(colIndex));\n ngDevMode && console.assert(tuiInRange(colIndex, 0, DAYS_IN_WEEK));\n\n let day =\n rowIndex * DAYS_IN_WEEK +\n colIndex -\n getMonthStartDaysOffset(month, firstDayOfWeek) +\n 1;\n\n if (day > month.daysCount) {\n day -= month.daysCount;\n month = month.append({month: 1});\n }\n\n if (day <= 0) {\n month = month.append({month: -1});\n day = month.daysCount + day;\n }\n\n return new TuiDay(month.year, month.month, day);\n};\n","import {inject, Pipe, type PipeTransform} from '@angular/core';\nimport {DAYS_IN_WEEK, type TuiDay, type TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TUI_FIRST_DAY_OF_WEEK} from '@taiga-ui/core/tokens';\n\nimport {getDayFromMonthRowCol} from './utils';\n\nconst CALENDAR_ROWS_COUNT = 6;\n\n@Pipe({\n name: 'tuiCalendarSheet',\n})\nexport class TuiCalendarSheetPipe implements PipeTransform {\n private readonly firstDayOfWeek = inject(TUI_FIRST_DAY_OF_WEEK);\n private currentMonth: TuiMonth | null = null;\n private currentSheet: ReadonlyArray<readonly TuiDay[]> = [];\n\n public transform(\n month: TuiMonth,\n showAdjacentDays = false,\n ): ReadonlyArray<readonly TuiDay[]> {\n if (this.currentMonth?.monthSame(month)) {\n return this.currentSheet;\n }\n\n const sheet: Array<readonly TuiDay[]> = [];\n\n for (let rowIndex = 0; rowIndex < CALENDAR_ROWS_COUNT; rowIndex++) {\n const row: TuiDay[] = [];\n\n for (let colIndex = 0; colIndex < DAYS_IN_WEEK; colIndex++) {\n const day = getDayFromMonthRowCol({\n month,\n rowIndex,\n colIndex,\n firstDayOfWeek: this.firstDayOfWeek,\n });\n\n const isPrevMonthDay = (day: TuiDay, relativeToMonth = month): boolean =>\n day.year < relativeToMonth.year || day.month < relativeToMonth.month;\n\n const isNextMonthDay = (day: TuiDay, relativeToMonth = month): boolean =>\n day.year > relativeToMonth.year || day.month > relativeToMonth.month;\n\n if (isPrevMonthDay(day) && !showAdjacentDays) {\n continue;\n }\n\n if (isNextMonthDay(day) && !showAdjacentDays) {\n break;\n }\n\n row.push(day);\n }\n\n sheet.push(row);\n }\n\n this.currentSheet = sheet.filter((row) => row.length);\n this.currentMonth = month;\n\n return this.currentSheet;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AAIA;;AAEG;AACH,MAAM,uBAAuB,GAAG,CAC5B,KAAe,EACf,cAAyC,KACjC;AACR,IAAA,MAAM,0BAA0B,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE;IAEhF,OAAO,0BAA0B,IAAI;UAC/B,0BAA0B,GAAG;UAC7B,YAAY,IAAI,cAAc,GAAG,0BAA0B,CAAC;AACtE,CAAC;AAED;;;AAGG;AACI,MAAM,qBAAqB,GAAG,CAAC,EAClC,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,cAAc,GAejB,KAAY;AACT,IAAA,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AACvD,IAAA,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvD,IAAA,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AACvD,IAAA,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC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G;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-pipes-flag.mjs","sources":["../../../projects/core/pipes/flag/flag.pipe.ts","../../../projects/core/pipes/flag/taiga-ui-core-pipes-flag.ts"],"sourcesContent":["import {inject, Pipe, type PipeTransform} from '@angular/core';\nimport {type TuiLooseUnion} from '@taiga-ui/cdk/types';\nimport {TUI_ASSETS_PATH} from '@taiga-ui/core/tokens';\nimport {type TuiCountryIsoCode} from '@taiga-ui/i18n/types';\n\ntype IsoCode = TuiLooseUnion<TuiCountryIsoCode>;\n\n// TODO: Move to kit in v5\n@Pipe({\n
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-pipes-flag.mjs","sources":["../../../projects/core/pipes/flag/flag.pipe.ts","../../../projects/core/pipes/flag/taiga-ui-core-pipes-flag.ts"],"sourcesContent":["import {inject, Pipe, type PipeTransform} from '@angular/core';\nimport {type TuiLooseUnion} from '@taiga-ui/cdk/types';\nimport {TUI_ASSETS_PATH} from '@taiga-ui/core/tokens';\nimport {type TuiCountryIsoCode} from '@taiga-ui/i18n/types';\n\ntype IsoCode = TuiLooseUnion<TuiCountryIsoCode>;\n\n// TODO: Move to kit in v5\n@Pipe({\n name: 'tuiFlag',\n})\nexport class TuiFlagPipe implements PipeTransform {\n private readonly staticPath = inject(TUI_ASSETS_PATH);\n\n public transform(countryIsoCode: IsoCode): string;\n public transform(countryIsoCode: IsoCode | undefined): string | null;\n public transform(countryIsoCode?: IsoCode | null): string | null;\n public transform(countryIsoCode?: IsoCode | null): string | null {\n if (!countryIsoCode) {\n return null;\n }\n\n return `${this.staticPath}/flags/${countryIsoCode.toLowerCase()}.svg`;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAOA;MAIa,WAAW,CAAA;AAHxB,IAAA,WAAA,GAAA;AAIqB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,eAAe,CAAC;AAYxD;AAPU,IAAA,SAAS,CAAC,cAA+B,EAAA;QAC5C,IAAI,CAAC,cAAc,EAAE;AACjB,YAAA,OAAO,IAAI;;QAGf,OAAO,CAAA,EAAG,IAAI,CAAC,UAAU,CAAA,OAAA,EAAU,cAAc,CAAC,WAAW,EAAE,CAAA,IAAA,CAAM;;+GAXhE,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;6GAAX,WAAW,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,CAAA;;4FAAX,WAAW,EAAA,UAAA,EAAA,CAAA;kBAHvB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,IAAI,EAAE,SAAS;AAClB,iBAAA;;;ACVD;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-pipes-format-date.mjs","sources":["../../../projects/core/pipes/format-date/format-date.pipe.ts","../../../projects/core/pipes/format-date/taiga-ui-core-pipes-format-date.ts"],"sourcesContent":["import {inject, Pipe, type PipeTransform} from '@angular/core';\nimport {TuiFormatDateService} from '@taiga-ui/core/services';\nimport {type Observable} from 'rxjs';\n\n@Pipe({\n
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-pipes-format-date.mjs","sources":["../../../projects/core/pipes/format-date/format-date.pipe.ts","../../../projects/core/pipes/format-date/taiga-ui-core-pipes-format-date.ts"],"sourcesContent":["import {inject, Pipe, type PipeTransform} from '@angular/core';\nimport {TuiFormatDateService} from '@taiga-ui/core/services';\nimport {type Observable} from 'rxjs';\n\n@Pipe({\n name: 'tuiFormatDate',\n})\nexport class TuiFormatDatePipe implements PipeTransform {\n private readonly service = inject(TuiFormatDateService);\n\n public transform(timestampOrDate: Date | number): Observable<string> {\n return this.service.format(timestampOrDate.valueOf());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAOa,iBAAiB,CAAA;AAH9B,IAAA,WAAA,GAAA;AAIqB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAK1D;AAHU,IAAA,SAAS,CAAC,eAA8B,EAAA;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;;+GAJhD,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;6GAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,eAAA,EAAA,CAAA,CAAA;;4FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAH7B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,IAAI,EAAE,eAAe;AACxB,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Pipe } from '@angular/core';
|
|
2
|
+
import { inject, signal, computed, untracked, Pipe } from '@angular/core';
|
|
3
|
+
import { tuiObjectShallowEquals } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
3
4
|
import { TUI_NUMBER_FORMAT } from '@taiga-ui/core/tokens';
|
|
4
5
|
import { tuiFormatNumber } from '@taiga-ui/core/utils/format';
|
|
5
|
-
import { map } from 'rxjs';
|
|
6
6
|
|
|
7
7
|
class TuiFormatNumberPipe {
|
|
8
8
|
constructor() {
|
|
9
|
-
this.
|
|
9
|
+
this.format = inject(TUI_NUMBER_FORMAT);
|
|
10
|
+
this.value = signal(NaN);
|
|
11
|
+
this.settings = signal({}, {
|
|
12
|
+
equal: tuiObjectShallowEquals,
|
|
13
|
+
});
|
|
14
|
+
this.formatted = computed(() => tuiFormatNumber(this.value(), {
|
|
15
|
+
...this.format(),
|
|
16
|
+
precision: Number.isNaN(this.format().precision)
|
|
17
|
+
? Infinity
|
|
18
|
+
: this.format().precision,
|
|
19
|
+
...this.settings(),
|
|
20
|
+
}));
|
|
10
21
|
}
|
|
11
22
|
/**
|
|
12
23
|
* Formats number adding thousand separators and correct decimal separator
|
|
@@ -15,22 +26,20 @@ class TuiFormatNumberPipe {
|
|
|
15
26
|
* @param settings See {@link TuiNumberFormatSettings}
|
|
16
27
|
*/
|
|
17
28
|
transform(value, settings = {}) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
...settings,
|
|
24
|
-
})));
|
|
29
|
+
untracked(() => {
|
|
30
|
+
this.value.set(value);
|
|
31
|
+
this.settings.set(settings);
|
|
32
|
+
});
|
|
33
|
+
return this.formatted();
|
|
25
34
|
}
|
|
26
35
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiFormatNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
27
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: TuiFormatNumberPipe, isStandalone: true, name: "tuiFormatNumber" }); }
|
|
36
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: TuiFormatNumberPipe, isStandalone: true, name: "tuiFormatNumber", pure: false }); }
|
|
28
37
|
}
|
|
29
38
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiFormatNumberPipe, decorators: [{
|
|
30
39
|
type: Pipe,
|
|
31
40
|
args: [{
|
|
32
|
-
standalone: true,
|
|
33
41
|
name: 'tuiFormatNumber',
|
|
42
|
+
pure: false,
|
|
34
43
|
}]
|
|
35
44
|
}] });
|
|
36
45
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-pipes-format-number.mjs","sources":["../../../projects/core/pipes/format-number/format-number.pipe.ts","../../../projects/core/pipes/format-number/taiga-ui-core-pipes-format-number.ts"],"sourcesContent":["import {inject
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-pipes-format-number.mjs","sources":["../../../projects/core/pipes/format-number/format-number.pipe.ts","../../../projects/core/pipes/format-number/taiga-ui-core-pipes-format-number.ts"],"sourcesContent":["import {\n computed,\n inject,\n Pipe,\n type PipeTransform,\n signal,\n untracked,\n} from '@angular/core';\nimport {tuiObjectShallowEquals} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_NUMBER_FORMAT, type TuiNumberFormatSettings} from '@taiga-ui/core/tokens';\nimport {tuiFormatNumber} from '@taiga-ui/core/utils/format';\n\n@Pipe({\n name: 'tuiFormatNumber',\n pure: false,\n})\nexport class TuiFormatNumberPipe implements PipeTransform {\n private readonly format = inject(TUI_NUMBER_FORMAT);\n private readonly value = signal(NaN);\n private readonly settings = signal<Partial<TuiNumberFormatSettings>>(\n {},\n {\n equal: tuiObjectShallowEquals,\n },\n );\n\n private readonly formatted = computed(() =>\n tuiFormatNumber(this.value(), {\n ...this.format(),\n precision: Number.isNaN(this.format().precision)\n ? Infinity\n : this.format().precision,\n ...this.settings(),\n }),\n );\n\n /**\n * Formats number adding thousand separators and correct decimal separator\n * padding decimal part with zeroes to given length\n * @param value number\n * @param settings See {@link TuiNumberFormatSettings}\n */\n public transform(\n value: number,\n settings: Partial<TuiNumberFormatSettings> = {},\n ): string {\n untracked(() => {\n this.value.set(value);\n this.settings.set(settings);\n });\n\n return this.formatted();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAgBa,mBAAmB,CAAA;AAJhC,IAAA,WAAA,GAAA;AAKqB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAClC,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC;AACnB,QAAA,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e.ts","../../../projects/core/pipes/initials/taiga-ui-core-pipes-initials.ts"],"sourcesContent":["import {Pipe, type PipeTransform} from '@angular/core';\n\n@Pipe({\n
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-pipes-initials.mjs","sources":["../../../projects/core/pipes/initials/initials.pipe.ts","../../../projects/core/pipes/initials/taiga-ui-core-pipes-initials.ts"],"sourcesContent":["import {Pipe, type PipeTransform} from '@angular/core';\n\n@Pipe({\n name: 'tuiInitials',\n})\nexport class TuiInitialsPipe implements PipeTransform {\n public transform(text: string): string {\n return text\n .toUpperCase()\n .split(' ')\n .map(([char]) => char)\n .join('')\n .slice(0, 2);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAKa,eAAe,CAAA;AACjB,IAAA,SAAS,CAAC,IAAY,EAAA;AACzB,QAAA,OAAO;AACF,aAAA,WAAW;aACX,KAAK,CAAC,GAAG;aACT,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI;aACpB,IAAI,CAAC,EAAE;AACP,aAAA,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;+GAPX,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;6GAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,aAAA,EAAA,CAAA,CAAA;;4FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,IAAI,EAAE,aAAa;AACtB,iBAAA;;;ACJD;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-pipes-month.mjs","sources":["../../../projects/core/pipes/month/month.pipe.ts","../../../projects/core/pipes/month/taiga-ui-core-pipes-month.ts"],"sourcesContent":["import {inject, Pipe, type PipeTransform} from '@angular/core';\nimport {toObservable} from '@angular/core/rxjs-interop';\nimport {type TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TUI_MONTHS} from '@taiga-ui/core/tokens';\nimport {map, type Observable} from 'rxjs';\n\n@Pipe({\n
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-pipes-month.mjs","sources":["../../../projects/core/pipes/month/month.pipe.ts","../../../projects/core/pipes/month/taiga-ui-core-pipes-month.ts"],"sourcesContent":["import {inject, Pipe, type PipeTransform} from '@angular/core';\nimport {toObservable} from '@angular/core/rxjs-interop';\nimport {type TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TUI_MONTHS} from '@taiga-ui/core/tokens';\nimport {map, type Observable} from 'rxjs';\n\n@Pipe({\n name: 'tuiMonth',\n})\nexport class TuiMonthPipe implements PipeTransform {\n private readonly months$ = toObservable(inject(TUI_MONTHS));\n\n public transform({month}: TuiMonth): Observable<string> {\n return this.months$.pipe(map((months) => months[month] || months[0]));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MASa,YAAY,CAAA;AAHzB,IAAA,WAAA,GAAA;QAIqB,IAAO,CAAA,OAAA,GAAG,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AAK9D;IAHU,SAAS,CAAC,EAAC,KAAK,EAAW,EAAA;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;;+GAJhE,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;6GAAZ,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,CAAA;;4FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAHxB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,IAAI,EAAE,UAAU;AACnB,iBAAA;;;ACRD;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-pipes-order-week-days.mjs","sources":["../../../projects/core/pipes/order-week-days/order-week-days.pipe.ts","../../../projects/core/pipes/order-week-days/taiga-ui-core-pipes-order-week-days.ts"],"sourcesContent":["import {inject, Pipe, type PipeTransform} from '@angular/core';\nimport {TUI_FIRST_DAY_OF_WEEK} from '@taiga-ui/core/tokens';\nimport {map, type Observable} from 'rxjs';\n\nfunction convertToSundayFirstWeekFormat(\n weekDaysNames: readonly string[],\n): readonly string[] {\n const sundayIndex = weekDaysNames.length - 1;\n\n return [weekDaysNames[sundayIndex] || '', ...weekDaysNames.slice(0, sundayIndex)];\n}\n\n@Pipe({\n
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-pipes-order-week-days.mjs","sources":["../../../projects/core/pipes/order-week-days/order-week-days.pipe.ts","../../../projects/core/pipes/order-week-days/taiga-ui-core-pipes-order-week-days.ts"],"sourcesContent":["import {inject, Pipe, type PipeTransform} from '@angular/core';\nimport {TUI_FIRST_DAY_OF_WEEK} from '@taiga-ui/core/tokens';\nimport {map, type Observable} from 'rxjs';\n\nfunction convertToSundayFirstWeekFormat(\n weekDaysNames: readonly string[],\n): readonly string[] {\n const sundayIndex = weekDaysNames.length - 1;\n\n return [weekDaysNames[sundayIndex] || '', ...weekDaysNames.slice(0, sundayIndex)];\n}\n\n@Pipe({\n name: 'tuiOrderWeekDays',\n})\nexport class TuiOrderWeekDaysPipe implements PipeTransform {\n private readonly firstDayOfWeekIndex = inject(TUI_FIRST_DAY_OF_WEEK);\n\n public transform(\n mondayFirstWeekDays$: Observable<readonly string[]>,\n ): Observable<readonly string[]> {\n return mondayFirstWeekDays$.pipe(\n map(convertToSundayFirstWeekFormat),\n map((weekDays) => [\n ...weekDays.slice(this.firstDayOfWeekIndex),\n ...weekDays.slice(0, this.firstDayOfWeekIndex),\n ]),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAIA,SAAS,8BAA8B,CACnC,aAAgC,EAAA;AAEhC,IAAA,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,GAAG,CAAC;AAE5C,IAAA,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;AACrF;MAKa,oBAAoB,CAAA;AAHjC,IAAA,WAAA,GAAA;AAIqB,QAAA,IAAA,CAAA,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AAavE;AAXU,IAAA,SAAS,CACZ,oBAAmD,EAAA;AAEnD,QAAA,OAAO,oBAAoB,CAAC,IAAI,CAC5B,GAAG,CAAC,8BAA8B,CAAC,EACnC,GAAG,CAAC,CAAC,QAAQ,KAAK;AACd,YAAA,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC;YAC3C,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC;AACjD,SAAA,CAAC,CACL;;+GAZI,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;6GAApB,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,kBAAA,EAAA,CAAA,CAAA;;4FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAHhC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,IAAI,EAAE,kBAAkB;AAC3B,iBAAA;;;ACdD;;AAEG;;;;"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { InjectionToken, inject, signal, untracked, effect,
|
|
1
|
+
import { InjectionToken, inject, signal, untracked, effect, computed, ElementRef } from '@angular/core';
|
|
2
2
|
import { DOCUMENT } from '@angular/common';
|
|
3
|
-
import { tuiProvide
|
|
3
|
+
import { tuiProvide } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
4
|
+
import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
|
|
4
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
6
|
import { WA_LOCAL_STORAGE, WA_WINDOW } from '@ng-web-apis/common';
|
|
6
|
-
import { fromEvent, filter,
|
|
7
|
+
import { fromEvent, filter, merge, switchMap, takeUntil, share } from 'rxjs';
|
|
7
8
|
import { TuiDayOfWeek } from '@taiga-ui/cdk/date-time';
|
|
8
9
|
import { tuiExtractI18n } from '@taiga-ui/i18n/utils';
|
|
9
10
|
import { CHAR_NO_BREAK_SPACE } from '@taiga-ui/cdk/constants';
|
|
@@ -47,12 +48,7 @@ const COMMON_ICONS = {
|
|
|
47
48
|
search: '@tui.search',
|
|
48
49
|
ellipsis: '@tui.ellipsis',
|
|
49
50
|
};
|
|
50
|
-
const TUI_COMMON_ICONS =
|
|
51
|
-
factory: () => COMMON_ICONS,
|
|
52
|
-
});
|
|
53
|
-
function tuiCommonIconsProvider(icons) {
|
|
54
|
-
return tuiProvideOptions(TUI_COMMON_ICONS, icons, COMMON_ICONS);
|
|
55
|
-
}
|
|
51
|
+
const [TUI_COMMON_ICONS, tuiCommonIconsProvider] = tuiCreateOptions(COMMON_ICONS);
|
|
56
52
|
|
|
57
53
|
const TUI_DARK_MODE_DEFAULT_KEY = 'tuiDark';
|
|
58
54
|
const TUI_DARK_MODE_KEY = new InjectionToken(ngDevMode ? 'TUI_DARK_MODE_KEY' : '', {
|
|
@@ -101,13 +97,18 @@ const TUI_DEFAULT_DATE_FORMAT = {
|
|
|
101
97
|
* Formatting configuration for displayed dates
|
|
102
98
|
*/
|
|
103
99
|
const TUI_DATE_FORMAT = new InjectionToken(ngDevMode ? 'TUI_DATE_FORMAT' : '', {
|
|
104
|
-
factory: () =>
|
|
100
|
+
factory: () => signal(TUI_DEFAULT_DATE_FORMAT),
|
|
105
101
|
});
|
|
106
102
|
function tuiDateFormatProvider(options) {
|
|
107
103
|
return {
|
|
108
104
|
provide: TUI_DATE_FORMAT,
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
useFactory: () => {
|
|
106
|
+
const parent = inject(TUI_DATE_FORMAT, { optional: true, skipSelf: true });
|
|
107
|
+
return computed(() => ({
|
|
108
|
+
...(parent?.() || TUI_DEFAULT_DATE_FORMAT),
|
|
109
|
+
...options,
|
|
110
|
+
}));
|
|
111
|
+
},
|
|
111
112
|
};
|
|
112
113
|
}
|
|
113
114
|
|
|
@@ -243,13 +244,18 @@ const TUI_DEFAULT_NUMBER_FORMAT = {
|
|
|
243
244
|
* Formatting configuration for displayed numbers
|
|
244
245
|
*/
|
|
245
246
|
const TUI_NUMBER_FORMAT = new InjectionToken(ngDevMode ? 'TUI_NUMBER_FORMAT' : '', {
|
|
246
|
-
factory: () =>
|
|
247
|
+
factory: () => signal(TUI_DEFAULT_NUMBER_FORMAT),
|
|
247
248
|
});
|
|
248
249
|
function tuiNumberFormatProvider(options) {
|
|
249
250
|
return {
|
|
250
251
|
provide: TUI_NUMBER_FORMAT,
|
|
251
|
-
|
|
252
|
-
|
|
252
|
+
useFactory: () => {
|
|
253
|
+
const parent = inject(TUI_NUMBER_FORMAT, { optional: true, skipSelf: true });
|
|
254
|
+
return computed(() => ({
|
|
255
|
+
...(parent?.() || TUI_DEFAULT_NUMBER_FORMAT),
|
|
256
|
+
...options,
|
|
257
|
+
}));
|
|
258
|
+
},
|
|
253
259
|
};
|
|
254
260
|
}
|
|
255
261
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-tokens.mjs","sources":["../../../projects/core/tokens/reduced-motion.ts","../../../projects/core/tokens/animations-speed.ts","../../../projects/core/tokens/assets-path.ts","../../../projects/core/tokens/auxiliary.ts","../../../projects/core/tokens/common-icons.ts","../../../projects/core/tokens/dark-mode.ts","../../../projects/core/tokens/date-format.ts","../../../projects/core/tokens/day-type-handler.ts","../../../projects/core/tokens/first-day-of-week.ts","../../../projects/core/tokens/i18n.ts","../../../projects/core/tokens/icon.ts","../../../projects/core/tokens/icons.ts","../../../projects/core/tokens/icon-resolver.ts","../../../projects/core/tokens/media.ts","../../../projects/core/tokens/number-format.ts","../../../projects/core/tokens/scroll-ref.ts","../../../projects/core/tokens/selection-stream.ts","../../../projects/core/tokens/spin-icons.ts","../../../projects/core/tokens/theme.ts","../../../projects/core/tokens/validation-errors.ts","../../../projects/core/tokens/viewport.ts","../../../projects/core/tokens/taiga-ui-core-tokens.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {inject, InjectionToken} from '@angular/core';\n\nexport const TUI_REDUCED_MOTION = new InjectionToken(\n ngDevMode ? 'TUI_REDUCED_MOTION' : '',\n {\n factory: () =>\n inject(DOCUMENT).defaultView?.matchMedia?.('(prefers-reduced-motion: reduce)')\n .matches ?? false,\n },\n);\n","import {inject, InjectionToken} from '@angular/core';\n\nimport {TUI_REDUCED_MOTION} from './reduced-motion';\n\n/**\n * Speed of all Taiga UI animations. 1 equals 300ms.\n */\nexport const TUI_ANIMATIONS_SPEED = new InjectionToken<number>(\n ngDevMode ? 'TUI_ANIMATIONS_SPEED' : '',\n {\n factory: () => (inject(TUI_REDUCED_MOTION) ? 0 : 1),\n },\n);\n","import {InjectionToken, type ValueProvider} from '@angular/core';\n\nexport const TUI_ASSETS_PATH = new InjectionToken(ngDevMode ? 'TUI_ASSETS_PATH' : '', {\n factory: () => 'assets/taiga-ui/icons',\n});\n\nexport function tuiAssetsPathProvider(useValue: string): ValueProvider {\n return {\n provide: TUI_ASSETS_PATH,\n useValue,\n };\n}\n","import {InjectionToken, type Provider, type Type} from '@angular/core';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous';\n\nexport const TUI_AUXILIARY = new InjectionToken(ngDevMode ? 'TUI_AUXILIARY' : '', {\n factory: () => null,\n});\n\nexport function tuiAsAuxiliary(x: Type<unknown>): Provider {\n return tuiProvide(TUI_AUXILIARY, x);\n}\n","import {InjectionToken, type Provider} from '@angular/core';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\n\n// TODO: Rename `ellipsis` to `more` in the next major version\nconst COMMON_ICONS: TuiCommonIcons = {\n check: '@tui.check',\n close: '@tui.x',\n error: '@tui.circle-alert',\n more: '@tui.chevron-right',\n search: '@tui.search',\n ellipsis: '@tui.ellipsis',\n};\n\nexport interface TuiCommonIcons {\n readonly check: string;\n readonly close: string;\n readonly error: string;\n readonly more: string;\n readonly search: string;\n readonly ellipsis: string;\n}\n\nexport const TUI_COMMON_ICONS = new InjectionToken(ngDevMode ? 'TUI_COMMON_ICONS' : '', {\n factory: () => COMMON_ICONS,\n});\n\nexport function tuiCommonIconsProvider(icons: Partial<TuiCommonIcons>): Provider {\n return tuiProvideOptions(TUI_COMMON_ICONS, icons, COMMON_ICONS);\n}\n","import {\n effect,\n inject,\n InjectionToken,\n signal,\n untracked,\n type WritableSignal,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {WA_LOCAL_STORAGE, WA_WINDOW} from '@ng-web-apis/common';\nimport {filter, fromEvent} from 'rxjs';\n\nexport const TUI_DARK_MODE_DEFAULT_KEY = 'tuiDark';\nexport const TUI_DARK_MODE_KEY = new InjectionToken(\n ngDevMode ? 'TUI_DARK_MODE_KEY' : '',\n {\n factory: () => TUI_DARK_MODE_DEFAULT_KEY,\n },\n);\nexport const TUI_DARK_MODE = new InjectionToken<\n WritableSignal<boolean> & {reset(): void}\n>(ngDevMode ? 'TUI_DARK_MODE' : '', {\n factory: () => {\n let automatic = true;\n\n const storage = inject(WA_LOCAL_STORAGE);\n const key = inject(TUI_DARK_MODE_KEY);\n const saved = storage?.getItem(key);\n const media = inject(WA_WINDOW).matchMedia('(prefers-color-scheme: dark)');\n const result = signal(Boolean((saved && JSON.parse(saved)) ?? media.matches));\n\n fromEvent(media, 'change')\n .pipe(\n filter(() => !storage?.getItem(key)),\n takeUntilDestroyed(),\n )\n .subscribe(() => {\n automatic = true;\n result.set(media.matches);\n });\n\n untracked(() => {\n effect(() => {\n const value = String(result());\n\n if (automatic) {\n automatic = false;\n } else {\n storage?.setItem(key, value);\n }\n });\n });\n\n return Object.assign(result, {\n reset: () => {\n storage?.removeItem(key);\n automatic = true;\n result.set(media.matches);\n },\n });\n },\n});\n","import {InjectionToken, Optional, type Provider, SkipSelf} from '@angular/core';\nimport {type TuiDateMode} from '@taiga-ui/cdk/date-time';\nimport {map, type Observable, of} from 'rxjs';\n\n/**\n * Formatting configuration for displayed dates\n */\nexport interface TuiDateFormatSettings {\n /**\n * Date format mode.\n */\n readonly mode: TuiDateMode;\n /**\n * Separator between date segments\n * @example 10.02 ('.' by default)\n */\n readonly separator: string;\n}\n\nexport const TUI_DEFAULT_DATE_FORMAT: TuiDateFormatSettings = {\n mode: 'DMY',\n separator: '.',\n};\n\n/**\n * Formatting configuration for displayed dates\n */\nexport const TUI_DATE_FORMAT = new InjectionToken<Observable<TuiDateFormatSettings>>(\n ngDevMode ? 'TUI_DATE_FORMAT' : '',\n {\n factory: () => of(TUI_DEFAULT_DATE_FORMAT),\n },\n);\n\nexport function tuiDateFormatProvider(options: Partial<TuiDateFormatSettings>): Provider {\n return {\n provide: TUI_DATE_FORMAT,\n deps: [[new Optional(), new SkipSelf(), TUI_DATE_FORMAT]],\n useFactory: (\n parent: Observable<TuiDateFormatSettings> | null,\n ): Observable<TuiDateFormatSettings> =>\n (parent || of(TUI_DEFAULT_DATE_FORMAT)).pipe(\n map((format) => ({...format, ...options})),\n ),\n };\n}\n","import {InjectionToken} from '@angular/core';\nimport {type TuiDay} from '@taiga-ui/cdk/date-time';\nimport {type TuiHandler} from '@taiga-ui/cdk/types';\n\n/**\n * Token for adding data-type attribute to calendar cell\n */\nexport const TUI_DAY_TYPE_HANDLER = new InjectionToken<TuiHandler<TuiDay, string>>(\n ngDevMode ? 'TUI_DAY_TYPE_HANDLER' : '',\n {\n factory: () => (day) => (day.isWeekend ? 'weekend' : 'weekday'),\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiDayOfWeek} from '@taiga-ui/cdk/date-time';\n\n/**\n * The first day of the week index\n */\nexport const TUI_FIRST_DAY_OF_WEEK = new InjectionToken<0 | 1 | 2 | 3 | 4 | 5 | 6>(\n ngDevMode ? 'TUI_FIRST_DAY_OF_WEEK' : '',\n {\n factory: () => TuiDayOfWeek.Monday,\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {tuiExtractI18n} from '@taiga-ui/i18n/utils';\n\n/**\n * Localized months names\n */\nexport const TUI_MONTHS = new InjectionToken(ngDevMode ? 'TUI_MONTHS' : '', {\n factory: tuiExtractI18n('months'),\n});\n\n/**\n * i18n 'close' word\n */\nexport const TUI_CLOSE_WORD = new InjectionToken(ngDevMode ? 'TUI_CLOSE_WORD' : '', {\n factory: tuiExtractI18n('close'),\n});\n\n/**\n * i18n 'clear' word\n */\nexport const TUI_CLEAR_WORD = new InjectionToken(ngDevMode ? 'TUI_CLEAR_WORD' : '', {\n factory: tuiExtractI18n('clear'),\n});\n\n/**\n * i18n 'Nothing found' message\n */\nexport const TUI_NOTHING_FOUND_MESSAGE = new InjectionToken(\n ngDevMode ? 'TUI_NOTHING_FOUND_MESSAGE' : '',\n {\n factory: tuiExtractI18n('nothingFoundMessage'),\n },\n);\n\n/**\n * i18n of error message\n */\nexport const TUI_DEFAULT_ERROR_MESSAGE = new InjectionToken(\n ngDevMode ? 'TUI_DEFAULT_ERROR_MESSAGE' : '',\n {\n factory: tuiExtractI18n('defaultErrorMessage'),\n },\n);\n\n/**\n * spin i18n texts\n */\nexport const TUI_SPIN_TEXTS = new InjectionToken(ngDevMode ? 'TUI_SPIN_TEXTS' : '', {\n factory: tuiExtractI18n('spinTexts'),\n});\n\n/**\n * calendars i18n texts\n */\nexport const TUI_SHORT_WEEK_DAYS = new InjectionToken(\n ngDevMode ? 'TUI_SHORT_WEEK_DAYS' : '',\n {\n factory: tuiExtractI18n('shortWeekDays'),\n },\n);\n","import {InjectionToken} from '@angular/core';\n\nexport const TUI_ICON_START = new InjectionToken(ngDevMode ? 'TUI_ICON_START' : '', {\n factory: () => '',\n});\nexport const TUI_ICON_END = new InjectionToken(ngDevMode ? 'TUI_ICON_END' : '', {\n factory: () => '',\n});\n","import {type FactoryProvider, inject, InjectionToken} from '@angular/core';\n\nexport const TUI_ICON_REGISTRY = new InjectionToken<Record<string, string>>(\n ngDevMode ? 'TUI_ICON_REGISTRY' : '',\n {\n factory: () => ({}),\n },\n);\n\n/**\n * @deprecated: use {@link TUI_ICON_REGISTRY}\n */\nexport const TUI_ICON_STARTS = TUI_ICON_REGISTRY;\n\nexport function tuiIconsProvider(icons: Record<string, string>): FactoryProvider {\n return {\n provide: TUI_ICON_REGISTRY,\n useFactory: () => ({\n ...(inject(TUI_ICON_REGISTRY, {skipSelf: true, optional: true}) || {}),\n ...Object.fromEntries(\n Object.entries(icons).map(([key, value]) => [\n key,\n `\"data:image/svg+xml;charset=UTF-8,${encodeURIComponent(value)}\"`,\n ]),\n ),\n }),\n };\n}\n","import {inject, InjectionToken, type Provider} from '@angular/core';\nimport {type TuiStringHandler} from '@taiga-ui/cdk/types';\n\nimport {TUI_ASSETS_PATH} from './assets-path';\nimport {TUI_ICON_REGISTRY} from './icons';\n\nexport const TUI_ICON_RESOLVER = new InjectionToken<TuiStringHandler<string>>(\n ngDevMode ? 'TUI_ICON_RESOLVER' : '',\n {\n factory: () => {\n const path = inject(TUI_ASSETS_PATH);\n\n // regex for @{any text}. used as a default fallback, returns path to svg from icon pack\n return (icon) =>\n `${path}/${icon.replace(/@[a-zA-Z]+\\./, '').replaceAll('.', '/')}.svg`;\n },\n },\n);\n\nexport function tuiGetIconMode(icon?: string | null): string | undefined {\n return icon?.match(/@([^.]*)\\./)?.[1] || icon || undefined;\n}\n\nexport function tuiInjectIconResolver(): TuiStringHandler<string> {\n const icons = inject(TUI_ICON_REGISTRY);\n const resolver = inject(TUI_ICON_RESOLVER);\n\n return (icon) => {\n if (!icon || icon.includes('/')) {\n return icon;\n }\n\n return icon.startsWith('@font.')\n ? icon.replace('@font.', '')\n : (icons[icon] ?? resolver(icon));\n };\n}\n\nexport function tuiIconResolverProvider(useValue: TuiStringHandler<string>): Provider {\n return {provide: TUI_ICON_RESOLVER, useValue};\n}\n","import {InjectionToken} from '@angular/core';\n\nexport interface TuiMedia {\n readonly desktopLarge: number;\n readonly desktopSmall: number;\n readonly mobile: number;\n readonly tablet?: number;\n}\n\n/**\n * Token for media constant\n */\nexport const TUI_MEDIA = new InjectionToken<TuiMedia>(ngDevMode ? 'TUI_MEDIA' : '', {\n factory: () => ({\n mobile: 768,\n desktopSmall: 1024,\n desktopLarge: 1280,\n }),\n});\n","import {InjectionToken, Optional, type Provider, SkipSelf} from '@angular/core';\nimport {CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk/constants';\nimport {type TuiRounding} from '@taiga-ui/cdk/types';\nimport {map, type Observable, of} from 'rxjs';\n\nexport type TuiDecimalMode = 'always' | 'not-zero' | 'pad';\nexport type TuiDecimalSymbol = ',' | '.';\n\n/**\n * Formatting configuration for displayed numbers\n */\nexport interface TuiNumberFormatSettings {\n /**\n * Number of digits of decimal part.\n * @note Use `Infinity` to keep untouched.\n */\n readonly precision: number;\n /**\n * Separator between the integer and the decimal part.\n * @example 0,42 (',' by default)\n */\n readonly decimalSeparator: TuiDecimalSymbol;\n /**\n * Rounding method.\n */\n readonly rounding: TuiRounding;\n /**\n * Separator between thousands.\n * @example 360 000 (' ' by default)\n */\n readonly thousandSeparator: string;\n /**\n * Decimal part display mode. ('pad' by default)\n */\n readonly decimalMode: TuiDecimalMode;\n}\n\nexport const TUI_DEFAULT_NUMBER_FORMAT: TuiNumberFormatSettings = {\n precision: NaN,\n decimalSeparator: '.',\n thousandSeparator: CHAR_NO_BREAK_SPACE,\n rounding: 'truncate',\n decimalMode: 'pad',\n};\n\n/**\n * Formatting configuration for displayed numbers\n */\nexport const TUI_NUMBER_FORMAT = new InjectionToken<Observable<TuiNumberFormatSettings>>(\n ngDevMode ? 'TUI_NUMBER_FORMAT' : '',\n {\n factory: () => of(TUI_DEFAULT_NUMBER_FORMAT),\n },\n);\n\nexport function tuiNumberFormatProvider(\n options: Partial<TuiNumberFormatSettings>,\n): Provider {\n return {\n provide: TUI_NUMBER_FORMAT,\n deps: [[new Optional(), new SkipSelf(), TUI_NUMBER_FORMAT]],\n useFactory: (\n parent: Observable<TuiNumberFormatSettings> | null,\n ): Observable<TuiNumberFormatSettings> =>\n (parent || of(TUI_DEFAULT_NUMBER_FORMAT)).pipe(\n map((format) => ({...format, ...options})),\n ),\n };\n}\n","import {DOCUMENT} from '@angular/common';\nimport {ElementRef, inject, InjectionToken} from '@angular/core';\n\nexport const TUI_SCROLL_REF = new InjectionToken(ngDevMode ? 'TUI_SCROLL_REF' : '', {\n factory: () => new ElementRef(inject(DOCUMENT).documentElement),\n});\n","import {DOCUMENT} from '@angular/common';\nimport {inject, InjectionToken} from '@angular/core';\nimport {tuiTypedFromEvent} from '@taiga-ui/cdk/observables';\nimport {merge, type Observable, share, switchMap, takeUntil} from 'rxjs';\n\n/**\n * A stream of possible selection changes\n */\nexport const TUI_SELECTION_STREAM = new InjectionToken<Observable<unknown>>(\n ngDevMode ? 'TUI_SELECTION_STREAM' : '',\n {\n factory: () => {\n const doc = inject(DOCUMENT);\n\n return merge(\n tuiTypedFromEvent(doc, 'selectionchange'),\n tuiTypedFromEvent(doc, 'mouseup'),\n tuiTypedFromEvent(doc, 'mousedown').pipe(\n switchMap(() =>\n tuiTypedFromEvent(doc, 'mousemove').pipe(\n takeUntil(tuiTypedFromEvent(doc, 'mouseup')),\n ),\n ),\n ),\n tuiTypedFromEvent(doc, 'keydown'),\n tuiTypedFromEvent(doc, 'keyup'),\n ).pipe(share());\n },\n },\n);\n","import {InjectionToken} from '@angular/core';\n\nexport interface TuiSpinIcons {\n readonly decrement: string;\n readonly increment: string;\n}\n\nexport const TUI_SPIN_ICONS = new InjectionToken<TuiSpinIcons>(\n ngDevMode ? 'TUI_SPIN_ICONS' : '',\n {\n factory: () => ({\n decrement: '@tui.chevron-left',\n increment: '@tui.chevron-right',\n }),\n },\n);\n","import {InjectionToken} from '@angular/core';\n\nexport const TUI_THEME = new InjectionToken(ngDevMode ? 'TUI_THEME' : '', {\n factory: () => 'Taiga UI',\n});\n","import {InjectionToken, type Provider, type Signal} from '@angular/core';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\nexport const TUI_VALIDATION_ERRORS = new InjectionToken<\n Record<string, PolymorpheusContent | Signal<PolymorpheusContent>>\n>(ngDevMode ? 'TUI_VALIDATION_ERRORS' : '', {\n factory: () => ({}),\n});\n\nexport const tuiValidationErrorsProvider = (\n useValue: Record<string, PolymorpheusContent | Signal<PolymorpheusContent>>,\n): Provider => ({provide: TUI_VALIDATION_ERRORS, useValue});\n","import {inject, InjectionToken, type Provider, type Type} from '@angular/core';\nimport {WA_WINDOW} from '@ng-web-apis/common';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiRectAccessor} from '@taiga-ui/core/classes';\n\n/**\n * Viewport accessor\n */\nexport const TUI_VIEWPORT = new InjectionToken<TuiRectAccessor>(\n ngDevMode ? 'TUI_VIEWPORT' : '',\n {\n factory: () => {\n const win = inject(WA_WINDOW);\n\n return {\n type: 'viewport',\n getClientRect() {\n const {height = 0, offsetTop = 0} = win.visualViewport || {};\n const rect = {\n top: 0,\n left: 0,\n right: win.innerWidth,\n bottom: win.innerHeight,\n width: win.innerWidth,\n height: height + offsetTop || win.innerHeight,\n x: 0,\n y: 0,\n };\n\n return {\n ...rect,\n toJSON: () => JSON.stringify(rect),\n };\n },\n };\n },\n },\n);\n\nexport function tuiAsViewport(accessor: Type<TuiRectAccessor>): Provider {\n return tuiProvide(TUI_VIEWPORT, accessor);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n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ACvB,KAAK,EAAE,GAAG,CAAC,UAAU;AACrB,oBAAA,MAAM,EAAE,MAAM,GAAG,SAAS,IAAI,GAAG,CAAC,WAAW;AAC7C,oBAAA,CAAC,EAAE,CAAC;AACJ,oBAAA,CAAC,EAAE,CAAC;iBACP;gBAED,OAAO;AACH,oBAAA,GAAG,IAAI;oBACP,MAAM,EAAE,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;iBACrC;aACJ;SACJ;KACJ;AACJ,CAAA;AAGC,SAAU,aAAa,CAAC,QAA+B,EAAA;AACzD,IAAA,OAAO,UAAU,CAAC,YAAY,EAAE,QAAQ,CAAC;AAC7C;;ACzCA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-tokens.mjs","sources":["../../../projects/core/tokens/reduced-motion.ts","../../../projects/core/tokens/animations-speed.ts","../../../projects/core/tokens/assets-path.ts","../../../projects/core/tokens/auxiliary.ts","../../../projects/core/tokens/common-icons.ts","../../../projects/core/tokens/dark-mode.ts","../../../projects/core/tokens/date-format.ts","../../../projects/core/tokens/day-type-handler.ts","../../../projects/core/tokens/first-day-of-week.ts","../../../projects/core/tokens/i18n.ts","../../../projects/core/tokens/icon.ts","../../../projects/core/tokens/icons.ts","../../../projects/core/tokens/icon-resolver.ts","../../../projects/core/tokens/media.ts","../../../projects/core/tokens/number-format.ts","../../../projects/core/tokens/scroll-ref.ts","../../../projects/core/tokens/selection-stream.ts","../../../projects/core/tokens/spin-icons.ts","../../../projects/core/tokens/theme.ts","../../../projects/core/tokens/validation-errors.ts","../../../projects/core/tokens/viewport.ts","../../../projects/core/tokens/taiga-ui-core-tokens.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {inject, InjectionToken} from '@angular/core';\n\nexport const TUI_REDUCED_MOTION = new InjectionToken(\n ngDevMode ? 'TUI_REDUCED_MOTION' : '',\n {\n factory: () =>\n inject(DOCUMENT).defaultView?.matchMedia?.('(prefers-reduced-motion: reduce)')\n .matches ?? false,\n },\n);\n","import {inject, InjectionToken} from '@angular/core';\n\nimport {TUI_REDUCED_MOTION} from './reduced-motion';\n\n/**\n * Speed of all Taiga UI animations. 1 equals 300ms.\n */\nexport const TUI_ANIMATIONS_SPEED = new InjectionToken<number>(\n ngDevMode ? 'TUI_ANIMATIONS_SPEED' : '',\n {\n factory: () => (inject(TUI_REDUCED_MOTION) ? 0 : 1),\n },\n);\n","import {InjectionToken, type ValueProvider} from '@angular/core';\n\nexport const TUI_ASSETS_PATH = new InjectionToken(ngDevMode ? 'TUI_ASSETS_PATH' : '', {\n factory: () => 'assets/taiga-ui/icons',\n});\n\nexport function tuiAssetsPathProvider(useValue: string): ValueProvider {\n return {\n provide: TUI_ASSETS_PATH,\n useValue,\n };\n}\n","import {InjectionToken, type Provider, type Type} from '@angular/core';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous';\n\nexport const TUI_AUXILIARY = new InjectionToken(ngDevMode ? 'TUI_AUXILIARY' : '', {\n factory: () => null,\n});\n\nexport function tuiAsAuxiliary(x: Type<unknown>): Provider {\n return tuiProvide(TUI_AUXILIARY, x);\n}\n","import {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\n\n// TODO: Rename `ellipsis` to `more` in the next major version\nconst COMMON_ICONS: TuiCommonIcons = {\n check: '@tui.check',\n close: '@tui.x',\n error: '@tui.circle-alert',\n more: '@tui.chevron-right',\n search: '@tui.search',\n ellipsis: '@tui.ellipsis',\n};\n\nexport interface TuiCommonIcons {\n readonly check: string;\n readonly close: string;\n readonly error: string;\n readonly more: string;\n readonly search: string;\n readonly ellipsis: string;\n}\n\nexport const [TUI_COMMON_ICONS, tuiCommonIconsProvider] = tuiCreateOptions(COMMON_ICONS);\n","import {\n effect,\n inject,\n InjectionToken,\n signal,\n untracked,\n type WritableSignal,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {WA_LOCAL_STORAGE, WA_WINDOW} from '@ng-web-apis/common';\nimport {filter, fromEvent} from 'rxjs';\n\nexport const TUI_DARK_MODE_DEFAULT_KEY = 'tuiDark';\nexport const TUI_DARK_MODE_KEY = new InjectionToken(\n ngDevMode ? 'TUI_DARK_MODE_KEY' : '',\n {\n factory: () => TUI_DARK_MODE_DEFAULT_KEY,\n },\n);\nexport const TUI_DARK_MODE = new InjectionToken<\n WritableSignal<boolean> & {reset(): void}\n>(ngDevMode ? 'TUI_DARK_MODE' : '', {\n factory: () => {\n let automatic = true;\n\n const storage = inject(WA_LOCAL_STORAGE);\n const key = inject(TUI_DARK_MODE_KEY);\n const saved = storage?.getItem(key);\n const media = inject(WA_WINDOW).matchMedia('(prefers-color-scheme: dark)');\n const result = signal(Boolean((saved && JSON.parse(saved)) ?? media.matches));\n\n fromEvent(media, 'change')\n .pipe(\n filter(() => !storage?.getItem(key)),\n takeUntilDestroyed(),\n )\n .subscribe(() => {\n automatic = true;\n result.set(media.matches);\n });\n\n untracked(() => {\n effect(() => {\n const value = String(result());\n\n if (automatic) {\n automatic = false;\n } else {\n storage?.setItem(key, value);\n }\n });\n });\n\n return Object.assign(result, {\n reset: () => {\n storage?.removeItem(key);\n automatic = true;\n result.set(media.matches);\n },\n });\n },\n});\n","import {\n computed,\n inject,\n InjectionToken,\n type Provider,\n type Signal,\n signal,\n} from '@angular/core';\nimport {type TuiDateMode} from '@taiga-ui/cdk/date-time';\n\n/**\n * Formatting configuration for displayed dates\n */\nexport interface TuiDateFormatSettings {\n /**\n * Date format mode.\n */\n readonly mode: TuiDateMode;\n /**\n * Separator between date segments\n * @example 10.02 ('.' by default)\n */\n readonly separator: string;\n}\n\nexport const TUI_DEFAULT_DATE_FORMAT: TuiDateFormatSettings = {\n mode: 'DMY',\n separator: '.',\n};\n\n/**\n * Formatting configuration for displayed dates\n */\nexport const TUI_DATE_FORMAT = new InjectionToken<Signal<TuiDateFormatSettings>>(\n ngDevMode ? 'TUI_DATE_FORMAT' : '',\n {\n factory: () => signal(TUI_DEFAULT_DATE_FORMAT),\n },\n);\n\nexport function tuiDateFormatProvider(options: Partial<TuiDateFormatSettings>): Provider {\n return {\n provide: TUI_DATE_FORMAT,\n useFactory: (): Signal<TuiDateFormatSettings> => {\n const parent = inject(TUI_DATE_FORMAT, {optional: true, skipSelf: true});\n\n return computed(() => ({\n ...(parent?.() || TUI_DEFAULT_DATE_FORMAT),\n ...options,\n }));\n },\n };\n}\n","import {InjectionToken} from '@angular/core';\nimport {type TuiDay} from '@taiga-ui/cdk/date-time';\nimport {type TuiHandler} from '@taiga-ui/cdk/types';\n\n/**\n * Token for adding data-type attribute to calendar cell\n */\nexport const TUI_DAY_TYPE_HANDLER = new InjectionToken<TuiHandler<TuiDay, string>>(\n ngDevMode ? 'TUI_DAY_TYPE_HANDLER' : '',\n {\n factory: () => (day) => (day.isWeekend ? 'weekend' : 'weekday'),\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiDayOfWeek} from '@taiga-ui/cdk/date-time';\n\n/**\n * The first day of the week index\n */\nexport const TUI_FIRST_DAY_OF_WEEK = new InjectionToken<0 | 1 | 2 | 3 | 4 | 5 | 6>(\n ngDevMode ? 'TUI_FIRST_DAY_OF_WEEK' : '',\n {\n factory: () => TuiDayOfWeek.Monday,\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {tuiExtractI18n} from '@taiga-ui/i18n/utils';\n\n/**\n * Localized months names\n */\nexport const TUI_MONTHS = new InjectionToken(ngDevMode ? 'TUI_MONTHS' : '', {\n factory: tuiExtractI18n('months'),\n});\n\n/**\n * i18n 'close' word\n */\nexport const TUI_CLOSE_WORD = new InjectionToken(ngDevMode ? 'TUI_CLOSE_WORD' : '', {\n factory: tuiExtractI18n('close'),\n});\n\n/**\n * i18n 'clear' word\n */\nexport const TUI_CLEAR_WORD = new InjectionToken(ngDevMode ? 'TUI_CLEAR_WORD' : '', {\n factory: tuiExtractI18n('clear'),\n});\n\n/**\n * i18n 'Nothing found' message\n */\nexport const TUI_NOTHING_FOUND_MESSAGE = new InjectionToken(\n ngDevMode ? 'TUI_NOTHING_FOUND_MESSAGE' : '',\n {\n factory: tuiExtractI18n('nothingFoundMessage'),\n },\n);\n\n/**\n * i18n of error message\n */\nexport const TUI_DEFAULT_ERROR_MESSAGE = new InjectionToken(\n ngDevMode ? 'TUI_DEFAULT_ERROR_MESSAGE' : '',\n {\n factory: tuiExtractI18n('defaultErrorMessage'),\n },\n);\n\n/**\n * spin i18n texts\n */\nexport const TUI_SPIN_TEXTS = new InjectionToken(ngDevMode ? 'TUI_SPIN_TEXTS' : '', {\n factory: tuiExtractI18n('spinTexts'),\n});\n\n/**\n * calendars i18n texts\n */\nexport const TUI_SHORT_WEEK_DAYS = new InjectionToken(\n ngDevMode ? 'TUI_SHORT_WEEK_DAYS' : '',\n {\n factory: tuiExtractI18n('shortWeekDays'),\n },\n);\n","import {InjectionToken} from '@angular/core';\n\nexport const TUI_ICON_START = new InjectionToken(ngDevMode ? 'TUI_ICON_START' : '', {\n factory: () => '',\n});\nexport const TUI_ICON_END = new InjectionToken(ngDevMode ? 'TUI_ICON_END' : '', {\n factory: () => '',\n});\n","import {type FactoryProvider, inject, InjectionToken} from '@angular/core';\n\nexport const TUI_ICON_REGISTRY = new InjectionToken<Record<string, string>>(\n ngDevMode ? 'TUI_ICON_REGISTRY' : '',\n {\n factory: () => ({}),\n },\n);\n\n/**\n * @deprecated: use {@link TUI_ICON_REGISTRY}\n */\nexport const TUI_ICON_STARTS = TUI_ICON_REGISTRY;\n\nexport function tuiIconsProvider(icons: Record<string, string>): FactoryProvider {\n return {\n provide: TUI_ICON_REGISTRY,\n useFactory: () => ({\n ...(inject(TUI_ICON_REGISTRY, {skipSelf: true, optional: true}) || {}),\n ...Object.fromEntries(\n Object.entries(icons).map(([key, value]) => [\n key,\n `\"data:image/svg+xml;charset=UTF-8,${encodeURIComponent(value)}\"`,\n ]),\n ),\n }),\n };\n}\n","import {inject, InjectionToken, type Provider} from '@angular/core';\nimport {type TuiStringHandler} from '@taiga-ui/cdk/types';\n\nimport {TUI_ASSETS_PATH} from './assets-path';\nimport {TUI_ICON_REGISTRY} from './icons';\n\nexport const TUI_ICON_RESOLVER = new InjectionToken<TuiStringHandler<string>>(\n ngDevMode ? 'TUI_ICON_RESOLVER' : '',\n {\n factory: () => {\n const path = inject(TUI_ASSETS_PATH);\n\n // regex for @{any text}. used as a default fallback, returns path to svg from icon pack\n return (icon) =>\n `${path}/${icon.replace(/@[a-zA-Z]+\\./, '').replaceAll('.', '/')}.svg`;\n },\n },\n);\n\nexport function tuiGetIconMode(icon?: string | null): string | undefined {\n return icon?.match(/@([^.]*)\\./)?.[1] || icon || undefined;\n}\n\nexport function tuiInjectIconResolver(): TuiStringHandler<string> {\n const icons = inject(TUI_ICON_REGISTRY);\n const resolver = inject(TUI_ICON_RESOLVER);\n\n return (icon) => {\n if (!icon || icon.includes('/')) {\n return icon;\n }\n\n return icon.startsWith('@font.')\n ? icon.replace('@font.', '')\n : (icons[icon] ?? resolver(icon));\n };\n}\n\nexport function tuiIconResolverProvider(useValue: TuiStringHandler<string>): Provider {\n return {provide: TUI_ICON_RESOLVER, useValue};\n}\n","import {InjectionToken} from '@angular/core';\n\nexport interface TuiMedia {\n readonly desktopLarge: number;\n readonly desktopSmall: number;\n readonly mobile: number;\n readonly tablet?: number;\n}\n\n/**\n * Token for media constant\n */\nexport const TUI_MEDIA = new InjectionToken<TuiMedia>(ngDevMode ? 'TUI_MEDIA' : '', {\n factory: () => ({\n mobile: 768,\n desktopSmall: 1024,\n desktopLarge: 1280,\n }),\n});\n","import {\n computed,\n inject,\n InjectionToken,\n type Provider,\n type Signal,\n signal,\n} from '@angular/core';\nimport {CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk/constants';\nimport {type TuiRounding} from '@taiga-ui/cdk/types';\n\nexport type TuiDecimalMode = 'always' | 'not-zero' | 'pad';\nexport type TuiDecimalSymbol = ',' | '.';\n\n/**\n * Formatting configuration for displayed numbers\n */\nexport interface TuiNumberFormatSettings {\n /**\n * Number of digits of decimal part.\n * @note Use `Infinity` to keep untouched.\n */\n readonly precision: number;\n /**\n * Separator between the integer and the decimal part.\n * @example 0,42 (',' by default)\n */\n readonly decimalSeparator: TuiDecimalSymbol;\n /**\n * Rounding method.\n */\n readonly rounding: TuiRounding;\n /**\n * Separator between thousands.\n * @example 360 000 (' ' by default)\n */\n readonly thousandSeparator: string;\n /**\n * Decimal part display mode. ('pad' by default)\n */\n readonly decimalMode: TuiDecimalMode;\n}\n\nexport const TUI_DEFAULT_NUMBER_FORMAT: TuiNumberFormatSettings = {\n precision: NaN,\n decimalSeparator: '.',\n thousandSeparator: CHAR_NO_BREAK_SPACE,\n rounding: 'truncate',\n decimalMode: 'pad',\n};\n\n/**\n * Formatting configuration for displayed numbers\n */\nexport const TUI_NUMBER_FORMAT = new InjectionToken<Signal<TuiNumberFormatSettings>>(\n ngDevMode ? 'TUI_NUMBER_FORMAT' : '',\n {\n factory: () => signal(TUI_DEFAULT_NUMBER_FORMAT),\n },\n);\n\nexport function tuiNumberFormatProvider(\n options: Partial<TuiNumberFormatSettings>,\n): Provider {\n return {\n provide: TUI_NUMBER_FORMAT,\n useFactory: (): Signal<TuiNumberFormatSettings> => {\n const parent = inject(TUI_NUMBER_FORMAT, {optional: true, skipSelf: true});\n\n return computed(() => ({\n ...(parent?.() || TUI_DEFAULT_NUMBER_FORMAT),\n ...options,\n }));\n },\n };\n}\n","import {DOCUMENT} from '@angular/common';\nimport {ElementRef, inject, InjectionToken} from '@angular/core';\n\nexport const TUI_SCROLL_REF = new InjectionToken(ngDevMode ? 'TUI_SCROLL_REF' : '', {\n factory: () => new ElementRef(inject(DOCUMENT).documentElement),\n});\n","import {DOCUMENT} from '@angular/common';\nimport {inject, InjectionToken} from '@angular/core';\nimport {tuiTypedFromEvent} from '@taiga-ui/cdk/observables';\nimport {merge, type Observable, share, switchMap, takeUntil} from 'rxjs';\n\n/**\n * A stream of possible selection changes\n */\nexport const TUI_SELECTION_STREAM = new InjectionToken<Observable<unknown>>(\n ngDevMode ? 'TUI_SELECTION_STREAM' : '',\n {\n factory: () => {\n const doc = inject(DOCUMENT);\n\n return merge(\n tuiTypedFromEvent(doc, 'selectionchange'),\n tuiTypedFromEvent(doc, 'mouseup'),\n tuiTypedFromEvent(doc, 'mousedown').pipe(\n switchMap(() =>\n tuiTypedFromEvent(doc, 'mousemove').pipe(\n takeUntil(tuiTypedFromEvent(doc, 'mouseup')),\n ),\n ),\n ),\n tuiTypedFromEvent(doc, 'keydown'),\n tuiTypedFromEvent(doc, 'keyup'),\n ).pipe(share());\n },\n },\n);\n","import {InjectionToken} from '@angular/core';\n\nexport interface TuiSpinIcons {\n readonly decrement: string;\n readonly increment: string;\n}\n\nexport const TUI_SPIN_ICONS = new InjectionToken<TuiSpinIcons>(\n ngDevMode ? 'TUI_SPIN_ICONS' : '',\n {\n factory: () => ({\n decrement: '@tui.chevron-left',\n increment: '@tui.chevron-right',\n }),\n },\n);\n","import {InjectionToken} from '@angular/core';\n\nexport const TUI_THEME = new InjectionToken(ngDevMode ? 'TUI_THEME' : '', {\n factory: () => 'Taiga UI',\n});\n","import {InjectionToken, type Provider, type Signal} from '@angular/core';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\nexport const TUI_VALIDATION_ERRORS = new InjectionToken<\n Record<string, PolymorpheusContent | Signal<PolymorpheusContent>>\n>(ngDevMode ? 'TUI_VALIDATION_ERRORS' : '', {\n factory: () => ({}),\n});\n\nexport const tuiValidationErrorsProvider = (\n useValue: Record<string, PolymorpheusContent | Signal<PolymorpheusContent>>,\n): Provider => ({provide: TUI_VALIDATION_ERRORS, useValue});\n","import {inject, InjectionToken, type Provider, type Type} from '@angular/core';\nimport {WA_WINDOW} from '@ng-web-apis/common';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiRectAccessor} from '@taiga-ui/core/classes';\n\n/**\n * Viewport accessor\n */\nexport const TUI_VIEWPORT = new InjectionToken<TuiRectAccessor>(\n ngDevMode ? 'TUI_VIEWPORT' : '',\n {\n factory: () => {\n const win = inject(WA_WINDOW);\n\n return {\n type: 'viewport',\n getClientRect() {\n const {height = 0, offsetTop = 0} = win.visualViewport || {};\n const rect = {\n top: 0,\n left: 0,\n right: win.innerWidth,\n bottom: win.innerHeight,\n width: win.innerWidth,\n height: height + offsetTop || win.innerHeight,\n x: 0,\n y: 0,\n };\n\n return {\n ...rect,\n toJSON: () => JSON.stringify(rect),\n };\n },\n };\n },\n },\n);\n\nexport function tuiAsViewport(accessor: Type<TuiRectAccessor>): Provider {\n return tuiProvide(TUI_VIEWPORT, accessor);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAGa,MAAA,kBAAkB,GAAG,IAAI,cAAc,CAChD,SAAS,GAAG,oBAAoB,GAAG,EAAE,EACrC;AACI,IAAA,OAAO,EAAE,MACL,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,UAAU,GAAG,kCAAkC;AACxE,SAAA,OAAO,IAAI,KAAK;AAC5B,CAAA;;ACLL;;AAEG;AACU,MAAA,oBAAoB,GAAG,IAAI,cAAc,CAClD,SAAS,GAAG,sBAAsB,GAAG,EAAE,EACvC;AACI,IAAA,OAAO,EAAE,OAAO,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACtD,CAAA;;ACTQ,MAAA,eAAe,GAAG,IAAI,cAAc,CAAC,SAAS,GAAG,iBAAiB,GAAG,EAAE,EAAE;AAClF,IAAA,OAAO,EAAE,MAAM,uBAAuB;AACzC,CAAA;AAEK,SAAU,qBAAqB,CAAC,QAAgB,EAAA;IAClD,OAAO;AACH,QAAA,OAAO,EAAE,eAAe;QACxB,QAAQ;KACX;AACL;;ACRa,MAAA,aAAa,GAAG,IAAI,cAAc,CAAC,SAAS,GAAG,eAAe,GAAG,EAAE,EAAE;AAC9E,IAAA,OAAO,EAAE,MAAM,IAAI;AACtB,CAAA;AAEK,SAAU,cAAc,CA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AAC,cAAc,IAAI,EAAE;AAC5D,gBAAA,MAAM,IAAI,GAAG;AACT,oBAAA,GAAG,EAAE,CAAC;AACN,oBAAA,IAAI,EAAE,CAAC;oBACP,KAAK,EAAE,GAAG,CAAC,UAAU;oBACrB,MAAM,EAAE,GAAG,CAAC,WAAW;oBACvB,KAAK,EAAE,GAAG,CAAC,UAAU;AACrB,oBAAA,MAAM,EAAE,MAAM,GAAG,SAAS,IAAI,GAAG,CAAC,WAAW;AAC7C,oBAAA,CAAC,EAAE,CAAC;AACJ,oBAAA,CAAC,EAAE,CAAC;iBACP;gBAED,OAAO;AACH,oBAAA,GAAG,IAAI;oBACP,MAAM,EAAE,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;iBACrC;aACJ;SACJ;KACJ;AACJ,CAAA;AAGC,SAAU,aAAa,CAAC,QAA+B,EAAA;AACzD,IAAA,OAAO,UAAU,CAAC,YAAY,EAAE,QAAQ,CAAC;AAC7C;;ACzCA;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-utils-format.mjs","sources":["../../../projects/core/utils/format/number-to-string-without-exp.ts","../../../projects/core/utils/format/get-fractional-part-padded.ts","../../../projects/core/utils/format/format-number.ts","../../../projects/core/utils/format/string-hash-to-hsl.ts","../../../projects/core/utils/format/taiga-ui-core-utils-format.ts"],"sourcesContent":["/**\n * Convert number to string with replacing exponent part on decimals\n *\n * @param value the number\n * @return string representation of a number\n */\nexport function tuiNumberToStringWithoutExp(value: number): string {\n const valueAsString = String(value);\n const [numberPart, expPart] = valueAsString.split('e-');\n\n let valueWithoutExp = valueAsString;\n\n if (expPart) {\n const [, fractionalPart = ''] = numberPart?.split('.') ?? [];\n const decimalDigits = Number(expPart) + (fractionalPart?.length || 0);\n\n valueWithoutExp = value.toFixed(decimalDigits);\n }\n\n return valueWithoutExp;\n}\n","import {tuiIsNumber} from '@taiga-ui/cdk/utils/miscellaneous';\n\nimport {tuiNumberToStringWithoutExp} from './number-to-string-without-exp';\n\n/**\n * Return fractional part of number\n *\n * @param value the number\n * @param precision number of digits of decimal part, null to keep untouched\n * @return the fractional part of number\n */\nexport function tuiGetFractionPartPadded(\n value: number,\n precision?: number | null,\n): string {\n const [, fractionPartPadded = ''] = tuiNumberToStringWithoutExp(value).split('.');\n\n return tuiIsNumber(precision)\n ? fractionPartPadded.slice(0, Math.max(0, precision))\n : fractionPartPadded;\n}\n","import {CHAR_HYPHEN} from '@taiga-ui/cdk/constants';\nimport {tuiRoundWith} from '@taiga-ui/cdk/utils/math';\nimport {\n TUI_DEFAULT_NUMBER_FORMAT,\n type TuiNumberFormatSettings,\n} from '@taiga-ui/core/tokens';\n\nimport {tuiGetFractionPartPadded} from './get-fractional-part-padded';\n\n/**\n * Formats number adding a thousand separators and correct decimal separator\n * padding decimal part with zeroes to given length\n *\n * @param value the input number\n * @param settings See {@link TuiNumberFormatSettings}\n * @return the formatted string\n */\nexport function tuiFormatNumber(\n value: number,\n settings: Partial<TuiNumberFormatSettings> = {},\n): string {\n const {precision, decimalSeparator, thousandSeparator, decimalMode, rounding} = {\n ...TUI_DEFAULT_NUMBER_FORMAT,\n decimalMode: 'always',\n precision: Infinity,\n ...settings,\n };\n\n const rounded = Number.isFinite(precision)\n ? tuiRoundWith({value, precision, method: rounding})\n : value;\n const integerPartString = String(Math.floor(Math.abs(rounded)));\n\n let fractionPartPadded = tuiGetFractionPartPadded(rounded, precision);\n const hasFraction = Number(fractionPartPadded) > 0;\n\n if (Number.isFinite(precision)) {\n if (decimalMode === 'always' || (hasFraction && decimalMode === 'pad')) {\n const zeroPaddingSize: number = Math.max(\n precision - fractionPartPadded.length,\n 0,\n );\n const zeroPartString = '0'.repeat(zeroPaddingSize);\n\n fractionPartPadded = `${fractionPartPadded}${zeroPartString}`;\n } else {\n fractionPartPadded = fractionPartPadded.replace(/0*$/, '');\n }\n }\n\n const remainder = integerPartString.length % 3;\n const sign = value < 0 ? CHAR_HYPHEN : '';\n let result = sign + integerPartString.charAt(0);\n\n for (let i = 1; i < integerPartString.length; i++) {\n if (i % 3 === remainder && integerPartString.length > 3) {\n result += thousandSeparator;\n }\n\n result += integerPartString.charAt(i);\n }\n\n return fractionPartPadded ? result + decimalSeparator + fractionPartPadded : result;\n}\n","/**\n * Converts a string to an HSL color\n * @param value string to convert\n * @return HSL color string\n */\n// @bad TODO: convert stringHashToHsl to stringHashToRgb\nexport function tuiStringHashToHsl(value: string): string {\n if (value === '') {\n return '';\n }\n\n let hash = 0;\n\n for (let i = 0; i < value.length; i++) {\n hash = value.charCodeAt(i) + ((hash << 5) - hash);\n hash &= hash;\n }\n\n const hue = hash % 360;\n const saturation = 60 + (hash % 5);\n const lightness = 80 + (hash % 5);\n\n return `hsl(${hue},${saturation}%,${lightness}%)`;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AACG,SAAU,2BAA2B,CAAC,KAAa,EAAA;AACrD,IAAA,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC;AACnC,IAAA,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC;IAEvD,IAAI,eAAe,GAAG,aAAa;IAEnC,IAAI,OAAO,EAAE;AACT,QAAA,MAAM,GAAG,cAAc,GAAG,EAAE,CAAC,GAAG,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE;AAC5D,QAAA,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,cAAc,EAAE,MAAM,IAAI,CAAC,CAAC;AAErE,QAAA,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC;;AAGlD,IAAA,OAAO,eAAe;AAC1B;;AChBA;;;;;;AAMG;AACa,SAAA,wBAAwB,CACpC,KAAa,EACb,SAAyB,EAAA;AAEzB,IAAA,MAAM,GAAG,kBAAkB,GAAG,EAAE,CAAC,GAAG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AAG,EAAE,IAAI,IAAI,GAAG,CAAC,CAAC;AAEjC,IAAA,OAAO,OAAO,GAAG,CAAA,CAAA,EAAI,UAAU,CAAK,EAAA,EAAA,SAAS,IAAI;AACrD;;
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-utils-format.mjs","sources":["../../../projects/core/utils/format/number-to-string-without-exp.ts","../../../projects/core/utils/format/get-fractional-part-padded.ts","../../../projects/core/utils/format/format-number.ts","../../../projects/core/utils/format/string-hash-to-hsl.ts","../../../projects/core/utils/format/taiga-ui-core-utils-format.ts"],"sourcesContent":["/**\n * Convert number to string with replacing exponent part on decimals\n *\n * @param value the number\n * @return string representation of a number\n */\nexport function tuiNumberToStringWithoutExp(value: number): string {\n const valueAsString = String(value);\n const [numberPart, expPart] = valueAsString.split('e-');\n\n let valueWithoutExp = valueAsString;\n\n if (expPart) {\n const [, fractionalPart = ''] = numberPart?.split('.') ?? [];\n const decimalDigits = Number(expPart) + (fractionalPart?.length || 0);\n\n valueWithoutExp = value.toFixed(decimalDigits);\n }\n\n return valueWithoutExp;\n}\n","import {tuiIsNumber} from '@taiga-ui/cdk/utils/miscellaneous';\n\nimport {tuiNumberToStringWithoutExp} from './number-to-string-without-exp';\n\n/**\n * Return fractional part of number\n *\n * @param value the number\n * @param precision number of digits of decimal part, null to keep untouched\n * @return the fractional part of number\n */\nexport function tuiGetFractionPartPadded(\n value: number,\n precision?: number | null,\n): string {\n const [, fractionPartPadded = ''] = tuiNumberToStringWithoutExp(value).split('.');\n\n return tuiIsNumber(precision)\n ? fractionPartPadded.slice(0, Math.max(0, precision))\n : fractionPartPadded;\n}\n","import {CHAR_HYPHEN} from '@taiga-ui/cdk/constants';\nimport {tuiRoundWith} from '@taiga-ui/cdk/utils/math';\nimport {\n TUI_DEFAULT_NUMBER_FORMAT,\n type TuiNumberFormatSettings,\n} from '@taiga-ui/core/tokens';\n\nimport {tuiGetFractionPartPadded} from './get-fractional-part-padded';\n\n/**\n * Formats number adding a thousand separators and correct decimal separator\n * padding decimal part with zeroes to given length\n *\n * @param value the input number\n * @param settings See {@link TuiNumberFormatSettings}\n * @return the formatted string\n */\nexport function tuiFormatNumber(\n value: number,\n settings: Partial<TuiNumberFormatSettings> = {},\n): string {\n const {precision, decimalSeparator, thousandSeparator, decimalMode, rounding} = {\n ...TUI_DEFAULT_NUMBER_FORMAT,\n decimalMode: 'always',\n precision: Infinity,\n ...settings,\n };\n\n const rounded = Number.isFinite(precision)\n ? tuiRoundWith({value, precision, method: rounding})\n : value;\n const integerPartString = String(Math.floor(Math.abs(rounded)));\n\n let fractionPartPadded = tuiGetFractionPartPadded(rounded, precision);\n const hasFraction = Number(fractionPartPadded) > 0;\n\n if (Number.isFinite(precision)) {\n if (decimalMode === 'always' || (hasFraction && decimalMode === 'pad')) {\n const zeroPaddingSize: number = Math.max(\n precision - fractionPartPadded.length,\n 0,\n );\n const zeroPartString = '0'.repeat(zeroPaddingSize);\n\n fractionPartPadded = `${fractionPartPadded}${zeroPartString}`;\n } else {\n fractionPartPadded = fractionPartPadded.replace(/0*$/, '');\n }\n }\n\n const remainder = integerPartString.length % 3;\n const sign = value < 0 ? CHAR_HYPHEN : '';\n let result = sign + integerPartString.charAt(0);\n\n for (let i = 1; i < integerPartString.length; i++) {\n if (i % 3 === remainder && integerPartString.length > 3) {\n result += thousandSeparator;\n }\n\n result += integerPartString.charAt(i);\n }\n\n return fractionPartPadded ? result + decimalSeparator + fractionPartPadded : result;\n}\n","/* eslint-disable no-bitwise */\n/**\n * Converts a string to an HSL color\n * @param value string to convert\n * @return HSL color string\n */\n// @bad TODO: convert stringHashToHsl to stringHashToRgb\nexport function tuiStringHashToHsl(value: string): string {\n if (value === '') {\n return '';\n }\n\n let hash = 0;\n\n for (let i = 0; i < value.length; i++) {\n hash = value.charCodeAt(i) + ((hash << 5) - hash);\n hash &= hash;\n }\n\n const hue = hash % 360;\n const saturation = 60 + (hash % 5);\n const lightness = 80 + (hash % 5);\n\n return `hsl(${hue},${saturation}%,${lightness}%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AAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE;YACrD,MAAM,IAAI,iBAAiB;;AAG/B,QAAA,MAAM,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;;AAGzC,IAAA,OAAO,kBAAkB,GAAG,MAAM,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,MAAM;AACvF;;AC/DA;AACA;;;;AAIG;AACH;AACM,SAAU,kBAAkB,CAAC,KAAa,EAAA;AAC5C,IAAA,IAAI,KAAK,KAAK,EAAE,EAAE;AACd,QAAA,OAAO,EAAE;;IAGb,IAAI,IAAI,GAAG,CAAC;AAEZ,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACnC,QAAA,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC;QACjD,IAAI,IAAI,IAAI;;AAGhB,IAAA,MAAM,GAAG,GAAG,IAAI,GAAG,GAAG;IACtB,MAAM,UAAU,GAAG,EAAE,IAAI,IAAI,GAAG,CAAC,CAAC;IAClC,MAAM,SAAS,GAAG,EAAE,IAAI,IAAI,GAAG,CAAC,CAAC;AAEjC,IAAA,OAAO,OAAO,GAAG,CAAA,CAAA,EAAI,UAAU,CAAK,EAAA,EAAA,SAAS,IAAI;AACrD;;ACxBA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/core",
|
|
3
|
-
"version": "4.52.0-canary.
|
|
3
|
+
"version": "4.52.0-canary.ec0802b",
|
|
4
4
|
"description": "Core library for creating Angular components and applications using Taiga UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
"directive"
|
|
13
13
|
],
|
|
14
14
|
"homepage": "https://github.com/taiga-family/taiga-ui",
|
|
15
|
-
"repository":
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/taiga-family/taiga-ui"
|
|
18
|
+
},
|
|
16
19
|
"license": "Apache-2.0",
|
|
17
20
|
"exports": {
|
|
18
21
|
"./styles/*": "./styles/*",
|
|
@@ -59,10 +62,6 @@
|
|
|
59
62
|
"types": "./utils/index.d.ts",
|
|
60
63
|
"default": "./fesm2022/taiga-ui-core-utils.mjs"
|
|
61
64
|
},
|
|
62
|
-
"./components/alert": {
|
|
63
|
-
"types": "./components/alert/index.d.ts",
|
|
64
|
-
"default": "./fesm2022/taiga-ui-core-components-alert.mjs"
|
|
65
|
-
},
|
|
66
65
|
"./components/button": {
|
|
67
66
|
"types": "./components/button/index.d.ts",
|
|
68
67
|
"default": "./fesm2022/taiga-ui-core-components-button.mjs"
|
|
@@ -91,10 +90,6 @@
|
|
|
91
90
|
"types": "./components/expand/index.d.ts",
|
|
92
91
|
"default": "./fesm2022/taiga-ui-core-components-expand.mjs"
|
|
93
92
|
},
|
|
94
|
-
"./components/header": {
|
|
95
|
-
"types": "./components/header/index.d.ts",
|
|
96
|
-
"default": "./fesm2022/taiga-ui-core-components-header.mjs"
|
|
97
|
-
},
|
|
98
93
|
"./components/icon": {
|
|
99
94
|
"types": "./components/icon/index.d.ts",
|
|
100
95
|
"default": "./fesm2022/taiga-ui-core-components-icon.mjs"
|
|
@@ -111,6 +106,10 @@
|
|
|
111
106
|
"types": "./components/loader/index.d.ts",
|
|
112
107
|
"default": "./fesm2022/taiga-ui-core-components-loader.mjs"
|
|
113
108
|
},
|
|
109
|
+
"./components/modal": {
|
|
110
|
+
"types": "./components/modal/index.d.ts",
|
|
111
|
+
"default": "./fesm2022/taiga-ui-core-components-modal.mjs"
|
|
112
|
+
},
|
|
114
113
|
"./components/notification": {
|
|
115
114
|
"types": "./components/notification/index.d.ts",
|
|
116
115
|
"default": "./fesm2022/taiga-ui-core-components-notification.mjs"
|
|
@@ -131,6 +130,10 @@
|
|
|
131
130
|
"types": "./components/textfield/index.d.ts",
|
|
132
131
|
"default": "./fesm2022/taiga-ui-core-components-textfield.mjs"
|
|
133
132
|
},
|
|
133
|
+
"./directives/alert": {
|
|
134
|
+
"types": "./directives/alert/index.d.ts",
|
|
135
|
+
"default": "./fesm2022/taiga-ui-core-directives-alert.mjs"
|
|
136
|
+
},
|
|
134
137
|
"./directives/appearance": {
|
|
135
138
|
"types": "./directives/appearance/index.d.ts",
|
|
136
139
|
"default": "./fesm2022/taiga-ui-core-directives-appearance.mjs"
|
|
@@ -159,10 +162,6 @@
|
|
|
159
162
|
"types": "./directives/items-handlers/index.d.ts",
|
|
160
163
|
"default": "./fesm2022/taiga-ui-core-directives-items-handlers.mjs"
|
|
161
164
|
},
|
|
162
|
-
"./directives/notification": {
|
|
163
|
-
"types": "./directives/notification/index.d.ts",
|
|
164
|
-
"default": "./fesm2022/taiga-ui-core-directives-notification.mjs"
|
|
165
|
-
},
|
|
166
165
|
"./directives/number-format": {
|
|
167
166
|
"types": "./directives/number-format/index.d.ts",
|
|
168
167
|
"default": "./fesm2022/taiga-ui-core-directives-number-format.mjs"
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { type PipeTransform } from '@angular/core';
|
|
2
2
|
import { type TuiNumberFormatSettings } from '@taiga-ui/core/tokens';
|
|
3
|
-
import { type Observable } from 'rxjs';
|
|
4
3
|
import * as i0 from "@angular/core";
|
|
5
4
|
export declare class TuiFormatNumberPipe implements PipeTransform {
|
|
6
|
-
private readonly
|
|
5
|
+
private readonly format;
|
|
6
|
+
private readonly value;
|
|
7
|
+
private readonly settings;
|
|
8
|
+
private readonly formatted;
|
|
7
9
|
/**
|
|
8
10
|
* Formats number adding thousand separators and correct decimal separator
|
|
9
11
|
* padding decimal part with zeroes to given length
|
|
10
12
|
* @param value number
|
|
11
13
|
* @param settings See {@link TuiNumberFormatSettings}
|
|
12
14
|
*/
|
|
13
|
-
transform(value: number, settings?: Partial<TuiNumberFormatSettings>):
|
|
15
|
+
transform(value: number, settings?: Partial<TuiNumberFormatSettings>): string;
|
|
14
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiFormatNumberPipe, never>;
|
|
15
17
|
static ɵpipe: i0.ɵɵPipeDeclaration<TuiFormatNumberPipe, "tuiFormatNumber", true>;
|
|
16
18
|
}
|