@taiga-ui/cdk 3.41.1-canary.db03a1d → 3.41.1-canary.fc0a9eb
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-cdk-components-alert-host.umd.js +1 -1
- package/bundles/taiga-ui-cdk-components-alert-host.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-dialog-host.umd.js +6 -8
- package/bundles/taiga-ui-cdk-components-dialog-host.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-date-time.umd.js +17 -10
- package/bundles/taiga-ui-cdk-date-time.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js +1 -1
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-observables.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.js +7 -12
- package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-color.umd.js +380 -0
- package/bundles/taiga-ui-cdk-utils-color.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js +16 -10
- package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils.umd.js +4 -10
- package/bundles/taiga-ui-cdk-utils.umd.js.map +1 -1
- package/components/dialog-host/dialog-host.component.d.ts +2 -2
- package/{utils/calendar → date-time}/date-clamp.d.ts +1 -1
- package/date-time/date-format.d.ts +1 -2
- package/date-time/date-separator.d.ts +1 -2
- package/date-time/index.d.ts +1 -0
- package/esm2015/components/alert-host/alert-host.component.js +2 -2
- package/esm2015/components/dialog-host/dialog-host.component.js +5 -6
- package/esm2015/date-time/date-clamp.js +10 -0
- package/esm2015/date-time/date-format.js +3 -5
- package/esm2015/date-time/date-separator.js +3 -5
- package/esm2015/date-time/day-range.js +1 -1
- package/esm2015/date-time/day.js +1 -1
- package/esm2015/date-time/index.js +2 -1
- package/esm2015/date-time/month-range.js +1 -1
- package/esm2015/date-time/month.js +1 -1
- package/esm2015/directives/auto-focus/autofocus.options.js +3 -3
- package/esm2015/observables/drag-and-drop-from.js +1 -1
- package/esm2015/tokens/alerts.js +3 -5
- package/esm2015/tokens/dialogs.js +3 -5
- package/esm2015/tokens/swipe-options.js +5 -4
- package/esm2015/tokens/zoom-options.js +4 -6
- package/esm2015/utils/color/hex-to-rgba.js +31 -0
- package/esm2015/utils/color/index.js +3 -1
- package/esm2015/utils/color/rgba-to-hex.js +26 -0
- package/esm2015/utils/index.js +1 -2
- package/esm2015/utils/miscellaneous/create-options.js +2 -1
- package/esm2015/utils/miscellaneous/create-token.js +7 -0
- package/esm2015/utils/miscellaneous/default-sort.js +5 -8
- package/esm2015/utils/miscellaneous/index.js +2 -1
- package/fesm2015/taiga-ui-cdk-components-alert-host.js +1 -1
- package/fesm2015/taiga-ui-cdk-components-alert-host.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-components-dialog-host.js +4 -5
- package/fesm2015/taiga-ui-cdk-components-dialog-host.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-date-time.js +14 -8
- package/fesm2015/taiga-ui-cdk-date-time.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-auto-focus.js +2 -2
- package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-observables.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-tokens.js +8 -13
- package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-color.js +58 -1
- package/fesm2015/taiga-ui-cdk-utils-color.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js +12 -8
- package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils.js +0 -1
- package/fesm2015/taiga-ui-cdk-utils.js.map +1 -1
- package/package.json +2 -2
- package/schematics/ng-update/v3/index.js +3 -1
- package/schematics/ng-update/v3/steps/migrate-templates.js +2 -1
- package/schematics/ng-update/v3/steps/replace-styles.js +1 -1
- package/tokens/alerts.d.ts +2 -2
- package/tokens/dialogs.d.ts +2 -2
- package/tokens/swipe-options.d.ts +1 -2
- package/tokens/zoom-options.d.ts +1 -2
- package/utils/color/hex-to-rgba.d.ts +3 -0
- package/utils/color/index.d.ts +2 -0
- package/utils/color/rgba-to-hex.d.ts +2 -0
- package/utils/index.d.ts +0 -1
- package/utils/miscellaneous/create-options.d.ts +1 -0
- package/utils/miscellaneous/create-token.d.ts +2 -0
- package/utils/miscellaneous/index.d.ts +1 -0
- package/bundles/taiga-ui-cdk-utils-calendar.umd.js +0 -26
- package/bundles/taiga-ui-cdk-utils-calendar.umd.js.map +0 -1
- package/esm2015/utils/calendar/date-clamp.js +0 -10
- package/esm2015/utils/calendar/index.js +0 -2
- package/esm2015/utils/calendar/taiga-ui-cdk-utils-calendar.js +0 -5
- package/fesm2015/taiga-ui-cdk-utils-calendar.js +0 -16
- package/fesm2015/taiga-ui-cdk-utils-calendar.js.map +0 -1
- package/utils/calendar/index.d.ts +0 -1
- package/utils/calendar/package.json +0 -10
- package/utils/calendar/taiga-ui-cdk-utils-calendar.d.ts +0 -5
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-utils-miscellaneous.js","sources":["../../../projects/cdk/utils/miscellaneous/array-remove.ts","../../../projects/cdk/utils/miscellaneous/array-shallow-equals.ts","../../../projects/cdk/utils/miscellaneous/array-toggle.ts","../../../projects/cdk/utils/miscellaneous/is-string.ts","../../../projects/cdk/utils/miscellaneous/clean-object.ts","../../../projects/cdk/utils/miscellaneous/create-options.ts","../../../projects/cdk/utils/miscellaneous/default-sort.ts","../../../projects/cdk/utils/miscellaneous/distance-between-touches.ts","../../../projects/cdk/utils/miscellaneous/ease-in-out-quad.ts","../../../projects/cdk/utils/miscellaneous/flat-length.ts","../../../projects/cdk/utils/miscellaneous/get-original-array-from-query-list.ts","../../../projects/cdk/utils/miscellaneous/get-swipe-direction.ts","../../../projects/cdk/utils/miscellaneous/is-falsy.ts","../../../projects/cdk/utils/miscellaneous/is-number.ts","../../../projects/cdk/utils/miscellaneous/is-object.ts","../../../projects/cdk/utils/miscellaneous/is-present.ts","../../../projects/cdk/utils/miscellaneous/is-valid-url.ts","../../../projects/cdk/utils/miscellaneous/mark-control-as-touched-and-validate.ts","../../../projects/cdk/utils/miscellaneous/nullable-same.ts","../../../projects/cdk/utils/miscellaneous/object-from-entries.ts","../../../projects/cdk/utils/miscellaneous/provide-options.ts","../../../projects/cdk/utils/miscellaneous/uniq-by.ts","../../../projects/cdk/utils/miscellaneous/taiga-ui-cdk-utils-miscellaneous.ts"],"sourcesContent":["export function tuiArrayRemove<T>(array: readonly T[], index: number): T[] {\n return array.slice(0, Math.max(index, 0)).concat(array.slice(Math.max(index + 1, 0)));\n}\n","export function tuiArrayShallowEquals<T>(a: readonly T[], b: readonly T[]): boolean {\n return a.length === b.length && a.every((item, index) => item === b[index]);\n}\n","import {tuiArrayRemove} from './array-remove';\n\nexport function tuiArrayToggle<T>(array: readonly T[], item: T): T[] {\n const index = array.indexOf(item);\n\n return index === -1 ? [...array, item] : tuiArrayRemove(array, index);\n}\n","export function tuiIsString(value: unknown): value is string {\n // eslint-disable-next-line @taiga-ui/experience/no-typeof\n return typeof value === `string`;\n}\n","import {TuiDeepPartial} from '@taiga-ui/cdk/types';\n\nimport {tuiIsString} from './is-string';\n\nexport function tuiCleanObject<T>(object: T): TuiDeepPartial<T> {\n return JSON.parse(\n JSON.stringify(object, (_key: string, value: unknown) =>\n checkValueIsEmpty(value) ? undefined : value,\n ),\n );\n}\n\ntype EmptyValue = '' | null | undefined;\n\nfunction checkValueIsEmpty<T>(value: EmptyValue | T): value is EmptyValue {\n const nextValue: any = tuiIsString(value) ? value.trim() : value;\n\n return [undefined, null, NaN, ``].includes(nextValue);\n}\n","import {InjectionToken} from '@angular/core';\n\nexport function tuiCreateOptions<T>(defaults: T): InjectionToken<T> {\n return new InjectionToken<T>(``, {\n factory: () => defaults,\n });\n}\n","import {TuiDay} from '@taiga-ui/cdk/date-time';\n\nimport {tuiIsString} from './is-string';\n\nexport function tuiDefaultSort<T>(x: T, y: T): number {\n const a = x instanceof TuiDay ? Number(x.toUtcNativeDate()) : x;\n const b = y instanceof TuiDay ? Number(y.toUtcNativeDate()) : y;\n\n if (a === b) {\n return 0;\n }\n\n if (tuiIsString(a) && tuiIsString(b)) {\n return a.localeCompare(b);\n }\n\n return a > b ? 1 : -1;\n}\n","export function tuiDistanceBetweenTouches({touches}: TouchEvent): number {\n return Math.hypot(\n touches[0].clientX - touches[1].clientX,\n touches[0].clientY - touches[1].clientY,\n );\n}\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\nexport function tuiEaseInOutQuad(t: number): number {\n ngDevMode &&\n tuiAssert.assert(\n t >= 0 && t <= 1,\n `Input must be between 0 and 1 inclusive but received `,\n t,\n );\n\n return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;\n}\n","/**\n * Flattens two-dimensional array and calculates resulting length\n *\n * @param array twi dimensional array\n */\nexport function tuiFlatLength(array: ReadonlyArray<readonly unknown[]>): number {\n return array.reduce((count, section) => count + section.length, 0);\n}\n","import {QueryList} from '@angular/core';\n\n/**\n * Extracts original array from {@link QueryList} rather than\n * creating a copy like {@link QueryList.toArray} does.\n * @param queryList\n * @returns original array from {@link QueryList}.\n */\nexport function tuiGetOriginalArrayFromQueryList<T>(\n queryList: QueryList<T>,\n): readonly T[] {\n let array: readonly T[] = [];\n\n queryList.find((_item, _index, originalArray) => {\n array = originalArray;\n\n return true;\n });\n\n return array;\n}\n","import {TuiSwipeDirection} from '@taiga-ui/cdk/interfaces';\n\nexport function tuiGetSwipeDirection(deltaX: number, deltaY: number): TuiSwipeDirection {\n if (Math.abs(deltaY) > Math.abs(deltaX)) {\n return deltaY > 0 ? `top` : `bottom`;\n }\n\n return deltaX > 0 ? `left` : `right`;\n}\n","export function tuiIsFalsy(value: unknown): boolean {\n return !value;\n}\n","export function tuiIsNumber(value: unknown): value is number {\n // eslint-disable-next-line @taiga-ui/experience/no-typeof\n return typeof value === `number`;\n}\n","export function tuiIsObject<T extends Record<string, any>>(\n value: unknown,\n): value is NonNullable<T> {\n // eslint-disable-next-line @taiga-ui/experience/no-typeof\n return typeof value === `object` && !!value;\n}\n","export function tuiIsPresent<T>(value?: T | null): value is T {\n return value !== null && value !== undefined;\n}\n","export function tuiIsValidUrl(url: string): boolean {\n const pattern = new RegExp(\n `^([a-zA-Z]+:\\\\/\\\\/)?` + // protocol\n `((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|localhost|` + // domain name\n `((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))` + // OR IP (v4) address\n `(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*` + // port and path\n `(\\\\?[;&a-z\\\\d%_.~+=-]*)?` + // query string\n `(\\\\#[-a-z\\\\d_]*)?$`, // fragment locator\n `i`,\n );\n\n return pattern.test(url);\n}\n","import {AbstractControl, FormArray, FormGroup} from '@angular/forms';\n\nexport function tuiMarkControlAsTouchedAndValidate(control: AbstractControl): void {\n if (control instanceof FormArray) {\n control.controls.forEach(nestedControl => {\n tuiMarkControlAsTouchedAndValidate(nestedControl);\n });\n }\n\n if (control instanceof FormGroup) {\n Object.values(control.controls).forEach(nestedControl => {\n tuiMarkControlAsTouchedAndValidate(nestedControl);\n });\n }\n\n control.markAsTouched();\n control.updateValueAndValidity();\n}\n","import {TuiIdentityMatcher} from '@taiga-ui/cdk/types';\n\n/**\n * Checks identity for nullable elements.\n *\n * @param a element a\n * @param b element b\n * @param handler called if both elements are not null\n * @return true if either both are null or they pass identity handler\n */\nexport function tuiNullableSame<T>(\n a: T | null,\n b: T | null,\n handler: TuiIdentityMatcher<T>,\n): boolean {\n if (a === null) {\n return b === null;\n }\n\n if (b === null) {\n return false;\n }\n\n return handler(a, b);\n}\n","/**\n * @deprecated use `Object.fromEntries` instead\n * (check browser support first https://caniuse.com/mdn-javascript_builtins_object_fromentries)\n * ___\n * TODO: after we bump Firefox to 63+ replace this function with `Object.fromEntries`.\n * TODO: Add `es2019.object` to `tsconfig.json` => `compilerOptions.lib`.\n *\n */\nexport function tuiObjectFromEntries<K extends number | string, V>(\n keyValuePairs: Array<[K, V]>,\n): Record<K, V> {\n return keyValuePairs.reduce(\n (obj, [key, val]) => ({...obj, [key]: val}),\n {} as Record<K, V>,\n );\n}\n","import {FactoryProvider, InjectionToken, Optional, SkipSelf} from '@angular/core';\n\nexport function tuiProvideOptions<T>(\n provide: InjectionToken<T>,\n options: Partial<T>,\n fallback: T,\n): FactoryProvider {\n return {\n provide,\n deps: [[new Optional(), new SkipSelf(), provide]],\n useFactory: (parent: T | null): T => ({\n ...(parent || fallback),\n ...options,\n }),\n };\n}\n","import {TuiValuesOf} from '@taiga-ui/cdk/types';\n\nexport function tuiUniqBy<T extends Record<string, any>>(\n array: readonly T[],\n key: keyof T,\n): readonly T[] {\n return Array.from(\n array\n .reduce(\n (map, item) => (map.has(item[key]) ? map : map.set(item[key], item)),\n new Map<TuiValuesOf<T>, T>(),\n )\n .values(),\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAgB,SAAA,cAAc,CAAI,KAAmB,EAAE,KAAa,EAAA;AAChE,IAAA,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1F;;ACFgB,SAAA,qBAAqB,CAAI,CAAe,EAAE,CAAe,EAAA;IACrE,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAA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,EAAA,GAAG,CAAE,EAAA,EAAA,CAAC,GAAG,GAAG,GAAG,EAAE,CAAA,CAAA,EAC3C,EAAkB,CACrB,CAAC;AACN;;SCbgB,iBAAiB,CAC7B,OAA0B,EAC1B,OAAmB,EACnB,QAAW,EAAA;IAEX,OAAO;QACH,OAAO;AACP,QAAA,IAAI,EAAE,CAAC,CAAC,IAAI,QAAQ,EAAE,EAAE,IAAI,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;AACjD,QAAA,UAAU,EAAE,CAAC,MAAgB,MAAQ,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,GAC7B,MAAM,IAAI,QAAQ,EAAC,EACpB,OAAO,CACZ,CAAA;KACL,CAAC;AACN;;ACbgB,SAAA,SAAS,CACrB,KAAmB,EACnB,GAAY,EAAA;AAEZ,IAAA,OAAO,KAAK,CAAC,IAAI,CACb,KAAK;AACA,SAAA,MAAM,CACH,CAAC,GAAG,EAAE,IAAI,MAAM,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,EACpE,IAAI,GAAG,EAAqB,CAC/B;SACA,MAAM,EAAE,CAChB,CAAC;AACN;;ACdA;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-utils-miscellaneous.js","sources":["../../../projects/cdk/utils/miscellaneous/array-remove.ts","../../../projects/cdk/utils/miscellaneous/array-shallow-equals.ts","../../../projects/cdk/utils/miscellaneous/array-toggle.ts","../../../projects/cdk/utils/miscellaneous/is-string.ts","../../../projects/cdk/utils/miscellaneous/clean-object.ts","../../../projects/cdk/utils/miscellaneous/create-options.ts","../../../projects/cdk/utils/miscellaneous/create-token.ts","../../../projects/cdk/utils/miscellaneous/default-sort.ts","../../../projects/cdk/utils/miscellaneous/distance-between-touches.ts","../../../projects/cdk/utils/miscellaneous/ease-in-out-quad.ts","../../../projects/cdk/utils/miscellaneous/flat-length.ts","../../../projects/cdk/utils/miscellaneous/get-original-array-from-query-list.ts","../../../projects/cdk/utils/miscellaneous/get-swipe-direction.ts","../../../projects/cdk/utils/miscellaneous/is-falsy.ts","../../../projects/cdk/utils/miscellaneous/is-number.ts","../../../projects/cdk/utils/miscellaneous/is-object.ts","../../../projects/cdk/utils/miscellaneous/is-present.ts","../../../projects/cdk/utils/miscellaneous/is-valid-url.ts","../../../projects/cdk/utils/miscellaneous/mark-control-as-touched-and-validate.ts","../../../projects/cdk/utils/miscellaneous/nullable-same.ts","../../../projects/cdk/utils/miscellaneous/object-from-entries.ts","../../../projects/cdk/utils/miscellaneous/provide-options.ts","../../../projects/cdk/utils/miscellaneous/uniq-by.ts","../../../projects/cdk/utils/miscellaneous/taiga-ui-cdk-utils-miscellaneous.ts"],"sourcesContent":["export function tuiArrayRemove<T>(array: readonly T[], index: number): T[] {\n return array.slice(0, Math.max(index, 0)).concat(array.slice(Math.max(index + 1, 0)));\n}\n","export function tuiArrayShallowEquals<T>(a: readonly T[], b: readonly T[]): boolean {\n return a.length === b.length && a.every((item, index) => item === b[index]);\n}\n","import {tuiArrayRemove} from './array-remove';\n\nexport function tuiArrayToggle<T>(array: readonly T[], item: T): T[] {\n const index = array.indexOf(item);\n\n return index === -1 ? [...array, item] : tuiArrayRemove(array, index);\n}\n","export function tuiIsString(value: unknown): value is string {\n // eslint-disable-next-line @taiga-ui/experience/no-typeof\n return typeof value === `string`;\n}\n","import {TuiDeepPartial} from '@taiga-ui/cdk/types';\n\nimport {tuiIsString} from './is-string';\n\nexport function tuiCleanObject<T>(object: T): TuiDeepPartial<T> {\n return JSON.parse(\n JSON.stringify(object, (_key: string, value: unknown) =>\n checkValueIsEmpty(value) ? undefined : value,\n ),\n );\n}\n\ntype EmptyValue = '' | null | undefined;\n\nfunction checkValueIsEmpty<T>(value: EmptyValue | T): value is EmptyValue {\n const nextValue: any = tuiIsString(value) ? value.trim() : value;\n\n return [undefined, null, NaN, ``].includes(nextValue);\n}\n","import {InjectionToken} from '@angular/core';\n\n/** @deprecated use {@link tuiCreateToken} instead */\nexport function tuiCreateOptions<T>(defaults: T): InjectionToken<T> {\n return new InjectionToken<T>(``, {\n factory: () => defaults,\n });\n}\n","import {InjectionToken} from '@angular/core';\n\nexport function tuiCreateToken<T>(defaults: T): InjectionToken<T> {\n return new InjectionToken<T>(``, {\n factory: () => defaults,\n });\n}\n","import {tuiIsString} from './is-string';\n\nexport function tuiDefaultSort<T>(x: T, y: T): number {\n if (x === y) {\n return 0;\n }\n\n if (tuiIsString(x) && tuiIsString(y)) {\n return x.localeCompare(y);\n }\n\n return x > y ? 1 : -1;\n}\n","export function tuiDistanceBetweenTouches({touches}: TouchEvent): number {\n return Math.hypot(\n touches[0].clientX - touches[1].clientX,\n touches[0].clientY - touches[1].clientY,\n );\n}\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\nexport function tuiEaseInOutQuad(t: number): number {\n ngDevMode &&\n tuiAssert.assert(\n t >= 0 && t <= 1,\n `Input must be between 0 and 1 inclusive but received `,\n t,\n );\n\n return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;\n}\n","/**\n * Flattens two-dimensional array and calculates resulting length\n *\n * @param array twi dimensional array\n */\nexport function tuiFlatLength(array: ReadonlyArray<readonly unknown[]>): number {\n return array.reduce((count, section) => count + section.length, 0);\n}\n","import {QueryList} from '@angular/core';\n\n/**\n * Extracts original array from {@link QueryList} rather than\n * creating a copy like {@link QueryList.toArray} does.\n * @param queryList\n * @returns original array from {@link QueryList}.\n */\nexport function tuiGetOriginalArrayFromQueryList<T>(\n queryList: QueryList<T>,\n): readonly T[] {\n let array: readonly T[] = [];\n\n queryList.find((_item, _index, originalArray) => {\n array = originalArray;\n\n return true;\n });\n\n return array;\n}\n","import {TuiSwipeDirection} from '@taiga-ui/cdk/interfaces';\n\nexport function tuiGetSwipeDirection(deltaX: number, deltaY: number): TuiSwipeDirection {\n if (Math.abs(deltaY) > Math.abs(deltaX)) {\n return deltaY > 0 ? `top` : `bottom`;\n }\n\n return deltaX > 0 ? `left` : `right`;\n}\n","export function tuiIsFalsy(value: unknown): boolean {\n return !value;\n}\n","export function tuiIsNumber(value: unknown): value is number {\n // eslint-disable-next-line @taiga-ui/experience/no-typeof\n return typeof value === `number`;\n}\n","export function tuiIsObject<T extends Record<string, any>>(\n value: unknown,\n): value is NonNullable<T> {\n // eslint-disable-next-line @taiga-ui/experience/no-typeof\n return typeof value === `object` && !!value;\n}\n","export function tuiIsPresent<T>(value?: T | null): value is T {\n return value !== null && value !== undefined;\n}\n","export function tuiIsValidUrl(url: string): boolean {\n const pattern = new RegExp(\n `^([a-zA-Z]+:\\\\/\\\\/)?` + // protocol\n `((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|localhost|` + // domain name\n `((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))` + // OR IP (v4) address\n `(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*` + // port and path\n `(\\\\?[;&a-z\\\\d%_.~+=-]*)?` + // query string\n `(\\\\#[-a-z\\\\d_]*)?$`, // fragment locator\n `i`,\n );\n\n return pattern.test(url);\n}\n","import {AbstractControl, FormArray, FormGroup} from '@angular/forms';\n\nexport function tuiMarkControlAsTouchedAndValidate(control: AbstractControl): void {\n if (control instanceof FormArray) {\n control.controls.forEach(nestedControl => {\n tuiMarkControlAsTouchedAndValidate(nestedControl);\n });\n }\n\n if (control instanceof FormGroup) {\n Object.values(control.controls).forEach(nestedControl => {\n tuiMarkControlAsTouchedAndValidate(nestedControl);\n });\n }\n\n control.markAsTouched();\n control.updateValueAndValidity();\n}\n","import {TuiIdentityMatcher} from '@taiga-ui/cdk/types';\n\n/**\n * Checks identity for nullable elements.\n *\n * @param a element a\n * @param b element b\n * @param handler called if both elements are not null\n * @return true if either both are null or they pass identity handler\n */\nexport function tuiNullableSame<T>(\n a: T | null,\n b: T | null,\n handler: TuiIdentityMatcher<T>,\n): boolean {\n if (a === null) {\n return b === null;\n }\n\n if (b === null) {\n return false;\n }\n\n return handler(a, b);\n}\n","/**\n * @deprecated use `Object.fromEntries` instead\n * (check browser support first https://caniuse.com/mdn-javascript_builtins_object_fromentries)\n * ___\n * TODO: after we bump Firefox to 63+ replace this function with `Object.fromEntries`.\n * TODO: Add `es2019.object` to `tsconfig.json` => `compilerOptions.lib`.\n *\n */\nexport function tuiObjectFromEntries<K extends number | string, V>(\n keyValuePairs: Array<[K, V]>,\n): Record<K, V> {\n return keyValuePairs.reduce(\n (obj, [key, val]) => ({...obj, [key]: val}),\n {} as Record<K, V>,\n );\n}\n","import {FactoryProvider, InjectionToken, Optional, SkipSelf} from '@angular/core';\n\nexport function tuiProvideOptions<T>(\n provide: InjectionToken<T>,\n options: Partial<T>,\n fallback: T,\n): FactoryProvider {\n return {\n provide,\n deps: [[new Optional(), new SkipSelf(), provide]],\n useFactory: (parent: T | null): T => ({\n ...(parent || fallback),\n ...options,\n }),\n };\n}\n","import {TuiValuesOf} from '@taiga-ui/cdk/types';\n\nexport function tuiUniqBy<T extends Record<string, any>>(\n array: readonly T[],\n key: keyof T,\n): readonly T[] {\n return Array.from(\n array\n .reduce(\n (map, item) => (map.has(item[key]) ? map : map.set(item[key], item)),\n new Map<TuiValuesOf<T>, T>(),\n )\n .values(),\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAgB,SAAA,cAAc,CAAI,KAAmB,EAAE,KAAa,EAAA;AAChE,IAAA,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1F;;ACFgB,SAAA,qBA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AA,CAAA,MAAA,CAAA,EAAA,EAAA,GAAG,CAAE,EAAA,EAAA,CAAC,GAAG,GAAG,GAAG,EAAE,CAAA,CAAA,EAC3C,EAAkB,CACrB,CAAC;AACN;;SCbgB,iBAAiB,CAC7B,OAA0B,EAC1B,OAAmB,EACnB,QAAW,EAAA;IAEX,OAAO;QACH,OAAO;AACP,QAAA,IAAI,EAAE,CAAC,CAAC,IAAI,QAAQ,EAAE,EAAE,IAAI,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;AACjD,QAAA,UAAU,EAAE,CAAC,MAAgB,MAAQ,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,GAC7B,MAAM,IAAI,QAAQ,EAAC,EACpB,OAAO,CACZ,CAAA;KACL,CAAC;AACN;;ACbgB,SAAA,SAAS,CACrB,KAAmB,EACnB,GAAY,EAAA;AAEZ,IAAA,OAAO,KAAK,CAAC,IAAI,CACb,KAAK;AACA,SAAA,MAAM,CACH,CAAC,GAAG,EAAE,IAAI,MAAM,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,EACpE,IAAI,GAAG,EAAqB,CAC/B;SACA,MAAM,EAAE,CAChB,CAAC;AACN;;ACdA;;AAEG;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-utils.js","sources":["../../../projects/cdk/utils/taiga-ui-cdk-utils.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-utils.js","sources":["../../../projects/cdk/utils/taiga-ui-cdk-utils.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;AAEG"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@taiga-ui/cdk",
|
3
|
-
"version": "3.41.1-canary.
|
3
|
+
"version": "3.41.1-canary.fc0a9eb",
|
4
4
|
"description": "Base library for creating Angular components and applications using Taiga UI principles regarding of actual visual appearance",
|
5
5
|
"keywords": [
|
6
6
|
"angular",
|
@@ -20,7 +20,7 @@
|
|
20
20
|
"@ng-web-apis/resize-observer": "3.0.2",
|
21
21
|
"@tinkoff/ng-event-plugins": "3.1.0",
|
22
22
|
"@tinkoff/ng-polymorpheus": "4.1.0",
|
23
|
-
"tslib": "2.6.
|
23
|
+
"tslib": "2.6.2"
|
24
24
|
},
|
25
25
|
"peerDependencies": {
|
26
26
|
"@angular/animations": ">=12.0.0",
|
@@ -99,7 +99,9 @@ function addTaigaStyles(options) {
|
|
99
99
|
`– Manually replace "${taiga_styles_1.TAIGA_GLOBAL_OLD_STYLE}" with "${taiga_styles_1.TAIGA_GLOBAL_NEW_STYLE}" inside "styles" of angular.json (don't forget to install "@taiga-ui/styles")`);
|
100
100
|
return;
|
101
101
|
}
|
102
|
-
return angular_json_manipulations_1.addStylesToAngularJson(options, context, taigaStyles, existingStyles => !!(existingStyles === null || existingStyles === void 0 ? void 0 : existingStyles.some(
|
102
|
+
return angular_json_manipulations_1.addStylesToAngularJson(options, context, taigaStyles, existingStyles => !!(existingStyles === null || existingStyles === void 0 ? void 0 : existingStyles.some(
|
103
|
+
// eslint-disable-next-line @taiga-ui/experience/no-typeof
|
104
|
+
style => typeof style === `string` && style.includes(`tinkoff-theme`))), stylesToReplace, tree);
|
103
105
|
});
|
104
106
|
}
|
105
107
|
function showNormalizeWarning() {
|
@@ -194,7 +194,8 @@ function migrateBinaryAttributes({ resource, fileSystem, recorder, }) {
|
|
194
194
|
templates_1.TRUTHY_BOOLEAN_INPUT_TO_HTML_BINARY_ATTRIBUTE.forEach(attrName => {
|
195
195
|
const elements = elements_1.findElementsInTemplateByFn(template, el => {
|
196
196
|
var _a;
|
197
|
-
return (_a = el.attrs) === null || _a === void 0 ? void 0 : _a.some(attr => attr.value === `true` &&
|
197
|
+
return (_a = el.attrs) === null || _a === void 0 ? void 0 : _a.some(attr => attr.value === `true` &&
|
198
|
+
attr.name.includes(attrName.toLowerCase()));
|
198
199
|
});
|
199
200
|
elements.forEach(el => {
|
200
201
|
var _a;
|
@@ -25,7 +25,7 @@ function replaceStyles() {
|
|
25
25
|
.replace(`tui-dropdown-box`, `tui-dropdown`)
|
26
26
|
.replace(`--tui-color-link`, `--tui-link`)
|
27
27
|
.replace(/@import '~@taiga-ui/g, `@import '@taiga-ui`)
|
28
|
-
.replace(
|
28
|
+
.replace(/@import '@taiga-ui\/core\/styles\/taiga-ui-global/g, `${exports.TUI_WARNING_NORMALIZE}\n@import '@taiga-ui/styles/taiga-ui-global`)
|
29
29
|
.replace(/@import '@taiga-ui\/.+(.less)?';/g, val => `${val.replace(`';`, ``)}.less';`.replace(`.less.less`, `.less`));
|
30
30
|
sourceFile.replaceWithText(fullText);
|
31
31
|
});
|
package/tokens/alerts.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import {
|
1
|
+
import { Provider, Type } from '@angular/core';
|
2
2
|
import { TuiAriaDialogContext } from '@taiga-ui/cdk/interfaces';
|
3
3
|
import { Observable } from 'rxjs';
|
4
4
|
/**
|
5
5
|
* A stream of alerts
|
6
6
|
*/
|
7
|
-
export declare const TUI_ALERTS: InjectionToken<readonly Observable<readonly TuiAriaDialogContext[]>[]>;
|
7
|
+
export declare const TUI_ALERTS: import("@angular/core").InjectionToken<readonly Observable<readonly TuiAriaDialogContext[]>[]>;
|
8
8
|
export declare function tuiAsAlerts(useExisting: Type<Observable<readonly TuiAriaDialogContext[]>>): Provider;
|
package/tokens/dialogs.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import {
|
1
|
+
import { Provider, Type } from '@angular/core';
|
2
2
|
import { TuiAriaDialogContext } from '@taiga-ui/cdk/interfaces';
|
3
3
|
import { Observable } from 'rxjs';
|
4
4
|
/**
|
5
5
|
* A stream of dialogs
|
6
6
|
*/
|
7
|
-
export declare const TUI_DIALOGS: InjectionToken<readonly Observable<readonly TuiAriaDialogContext[]>[]>;
|
7
|
+
export declare const TUI_DIALOGS: import("@angular/core").InjectionToken<readonly Observable<readonly TuiAriaDialogContext[]>[]>;
|
8
8
|
export declare function tuiAsDialog(useExisting: Type<Observable<readonly TuiAriaDialogContext[]>>): Provider;
|
@@ -1,6 +1,5 @@
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
2
1
|
import { TuiSwipeOptions } from '@taiga-ui/cdk/interfaces';
|
3
2
|
/**
|
4
3
|
* Swipe options
|
5
4
|
*/
|
6
|
-
export declare const TUI_SWIPE_OPTIONS: InjectionToken<TuiSwipeOptions>;
|
5
|
+
export declare const TUI_SWIPE_OPTIONS: import("@angular/core").InjectionToken<TuiSwipeOptions>;
|
package/tokens/zoom-options.d.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
2
1
|
import { TuiZoomOptions } from '@taiga-ui/cdk/interfaces';
|
3
2
|
/**
|
4
3
|
* Zoom options
|
5
4
|
*/
|
6
|
-
export declare const TUI_ZOOM_OPTIONS: InjectionToken<TuiZoomOptions>;
|
5
|
+
export declare const TUI_ZOOM_OPTIONS: import("@angular/core").InjectionToken<TuiZoomOptions>;
|
package/utils/color/index.d.ts
CHANGED
package/utils/index.d.ts
CHANGED
@@ -3,6 +3,7 @@ export * from './array-shallow-equals';
|
|
3
3
|
export * from './array-toggle';
|
4
4
|
export * from './clean-object';
|
5
5
|
export * from './create-options';
|
6
|
+
export * from './create-token';
|
6
7
|
export * from './default-sort';
|
7
8
|
export * from './distance-between-touches';
|
8
9
|
export * from './ease-in-out-quad';
|
@@ -1,26 +0,0 @@
|
|
1
|
-
(function (global, factory) {
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
3
|
-
typeof define === 'function' && define.amd ? define('@taiga-ui/cdk/utils/calendar', ['exports'], factory) :
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"].cdk = global["taiga-ui"].cdk || {}, global["taiga-ui"].cdk.utils = global["taiga-ui"].cdk.utils || {}, global["taiga-ui"].cdk.utils.calendar = {})));
|
5
|
-
})(this, (function (exports) { 'use strict';
|
6
|
-
|
7
|
-
function tuiDateClamp(date, min, max) {
|
8
|
-
if (max && max < date) {
|
9
|
-
return max;
|
10
|
-
}
|
11
|
-
if (min && min > date) {
|
12
|
-
return min;
|
13
|
-
}
|
14
|
-
return date;
|
15
|
-
}
|
16
|
-
|
17
|
-
/**
|
18
|
-
* Generated bundle index. Do not edit.
|
19
|
-
*/
|
20
|
-
|
21
|
-
exports.tuiDateClamp = tuiDateClamp;
|
22
|
-
|
23
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
24
|
-
|
25
|
-
}));
|
26
|
-
//# sourceMappingURL=taiga-ui-cdk-utils-calendar.umd.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-utils-calendar.umd.js","sources":["../../../projects/cdk/utils/calendar/date-clamp.ts","../../../projects/cdk/utils/calendar/taiga-ui-cdk-utils-calendar.ts"],"sourcesContent":["import {TuiYear} from '@taiga-ui/cdk/date-time';\n\nexport function tuiDateClamp<T extends TuiYear>(date: T, min?: T, max?: T): T {\n if (max && max < date) {\n return max;\n }\n\n if (min && min > date) {\n return min;\n }\n\n return date;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;aAEgB,YAAY,CAAoB,IAAO,EAAE,GAAO,EAAE,GAAO,EAAA;IACrE,IAAA,IAAI,GAAG,IAAI,GAAG,GAAG,IAAI,EAAE;IACnB,QAAA,OAAO,GAAG,CAAC;IACd,KAAA;IAED,IAAA,IAAI,GAAG,IAAI,GAAG,GAAG,IAAI,EAAE;IACnB,QAAA,OAAO,GAAG,CAAC;IACd,KAAA;IAED,IAAA,OAAO,IAAI,CAAC;IAChB;;ICZA;;IAEG;;;;;;;;;;"}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
export function tuiDateClamp(date, min, max) {
|
2
|
-
if (max && max < date) {
|
3
|
-
return max;
|
4
|
-
}
|
5
|
-
if (min && min > date) {
|
6
|
-
return min;
|
7
|
-
}
|
8
|
-
return date;
|
9
|
-
}
|
10
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZS1jbGFtcC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Nkay91dGlscy9jYWxlbmRhci9kYXRlLWNsYW1wLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE1BQU0sVUFBVSxZQUFZLENBQW9CLElBQU8sRUFBRSxHQUFPLEVBQUUsR0FBTztJQUNyRSxJQUFJLEdBQUcsSUFBSSxHQUFHLEdBQUcsSUFBSSxFQUFFO1FBQ25CLE9BQU8sR0FBRyxDQUFDO0tBQ2Q7SUFFRCxJQUFJLEdBQUcsSUFBSSxHQUFHLEdBQUcsSUFBSSxFQUFFO1FBQ25CLE9BQU8sR0FBRyxDQUFDO0tBQ2Q7SUFFRCxPQUFPLElBQUksQ0FBQztBQUNoQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtUdWlZZWFyfSBmcm9tICdAdGFpZ2EtdWkvY2RrL2RhdGUtdGltZSc7XG5cbmV4cG9ydCBmdW5jdGlvbiB0dWlEYXRlQ2xhbXA8VCBleHRlbmRzIFR1aVllYXI+KGRhdGU6IFQsIG1pbj86IFQsIG1heD86IFQpOiBUIHtcbiAgICBpZiAobWF4ICYmIG1heCA8IGRhdGUpIHtcbiAgICAgICAgcmV0dXJuIG1heDtcbiAgICB9XG5cbiAgICBpZiAobWluICYmIG1pbiA+IGRhdGUpIHtcbiAgICAgICAgcmV0dXJuIG1pbjtcbiAgICB9XG5cbiAgICByZXR1cm4gZGF0ZTtcbn1cbiJdfQ==
|
@@ -1,2 +0,0 @@
|
|
1
|
-
export * from './date-clamp';
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jZGsvdXRpbHMvY2FsZW5kYXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2RhdGUtY2xhbXAnO1xuIl19
|
@@ -1,5 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Generated bundle index. Do not edit.
|
3
|
-
*/
|
4
|
-
export * from './index';
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFpZ2EtdWktY2RrLXV0aWxzLWNhbGVuZGFyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2RrL3V0aWxzL2NhbGVuZGFyL3RhaWdhLXVpLWNkay11dGlscy1jYWxlbmRhci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
|
@@ -1,16 +0,0 @@
|
|
1
|
-
function tuiDateClamp(date, min, max) {
|
2
|
-
if (max && max < date) {
|
3
|
-
return max;
|
4
|
-
}
|
5
|
-
if (min && min > date) {
|
6
|
-
return min;
|
7
|
-
}
|
8
|
-
return date;
|
9
|
-
}
|
10
|
-
|
11
|
-
/**
|
12
|
-
* Generated bundle index. Do not edit.
|
13
|
-
*/
|
14
|
-
|
15
|
-
export { tuiDateClamp };
|
16
|
-
//# sourceMappingURL=taiga-ui-cdk-utils-calendar.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-utils-calendar.js","sources":["../../../projects/cdk/utils/calendar/date-clamp.ts","../../../projects/cdk/utils/calendar/taiga-ui-cdk-utils-calendar.ts"],"sourcesContent":["import {TuiYear} from '@taiga-ui/cdk/date-time';\n\nexport function tuiDateClamp<T extends TuiYear>(date: T, min?: T, max?: T): T {\n if (max && max < date) {\n return max;\n }\n\n if (min && min > date) {\n return min;\n }\n\n return date;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"SAEgB,YAAY,CAAoB,IAAO,EAAE,GAAO,EAAE,GAAO,EAAA;AACrE,IAAA,IAAI,GAAG,IAAI,GAAG,GAAG,IAAI,EAAE;AACnB,QAAA,OAAO,GAAG,CAAC;AACd,KAAA;AAED,IAAA,IAAI,GAAG,IAAI,GAAG,GAAG,IAAI,EAAE;AACnB,QAAA,OAAO,GAAG,CAAC;AACd,KAAA;AAED,IAAA,OAAO,IAAI,CAAC;AAChB;;ACZA;;AAEG;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './date-clamp';
|
@@ -1,10 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"main": "../../bundles/taiga-ui-cdk-utils-calendar.umd.js",
|
3
|
-
"module": "../../fesm2015/taiga-ui-cdk-utils-calendar.js",
|
4
|
-
"es2015": "../../fesm2015/taiga-ui-cdk-utils-calendar.js",
|
5
|
-
"esm2015": "../../esm2015/utils/calendar/taiga-ui-cdk-utils-calendar.js",
|
6
|
-
"fesm2015": "../../fesm2015/taiga-ui-cdk-utils-calendar.js",
|
7
|
-
"typings": "taiga-ui-cdk-utils-calendar.d.ts",
|
8
|
-
"sideEffects": false,
|
9
|
-
"name": "@taiga-ui/cdk/utils/calendar"
|
10
|
-
}
|