@tectra-ng/core 0.1.1 → 0.1.2

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 CHANGED
@@ -4,13 +4,13 @@ Behaviour without looks. Every component of `@tectra-ng/ui` stands on it. Built
4
4
 
5
5
  | Entry point | What it does |
6
6
  |---|---|
7
- | `@tectra-ng/core/config` | `provideTectra({ preset, mode, darkSelector, ripple, unstyled, pt, ptOptions, locale, translations })` — global config, writes theme CSS variables; `injectUnstyled`, `injectPassThrough` (objects or `({ instance }) => …` functions, `mergeSections` / `mergeProps`) for components |
7
+ | `@tectra-ng/core/config` | `provideTectra({ preset, mode, darkSelector, ripple, unstyled, pt, ptOptions, locale, translations })` — global config, writes theme CSS variables; `TxThemeService` switches at runtime: `applyPreset(preset)`, `setMode('light' | 'dark')`, `setRipple(enabled)`; `injectUnstyled`, `injectPassThrough` (objects or `({ instance }) => …` functions, `mergeSections` / `mergeProps`) for components |
8
8
  | `@tectra-ng/core/overlay` | `TxOverlay.open(template \| component, { origin, placement, offset, viewportMargin, layer, scroll, matchWidth, closeOnEscape, closeOnOutsideClick, restoreFocus })` → `TxOverlayRef` with `placement()` after flips, `closed`, `close()`; `txPositions(placement, offset)` for `cdkConnectedOverlay`; `txOverlayInset` on sticky / fixed chrome (measured live, only while pinned) or `provideTectra({ overlay: { viewportInsets: { top, bottom } } })` keeps panels out of headers / footers and closes them once the origin scrolls under one (for custom `cdkConnectedOverlay` panels: `TxOverlayInsets` + `watchOrigin`, and `TxOverlayRoom` — bind its `positions()` and `viewportMargin()`, call `open(insets)` / `move(insets)` and `fit(origin, panel, overlay, injector)` on the first position change so the first placement with room around the chrome goes first; CDK alone compares top placements with the viewport edge) |
9
9
  | `@tectra-ng/core/a11y` | `txFocusTrap` (auto focus, restore focus), `nextListIndex` (arrows, Home / End, PageUp / PageDown, disabled items, loop), `TxTypeahead`, `TxAnnouncer`, `uniqueId` |
10
10
  | `@tectra-ng/core/forms` | base for `ControlValueAccessor` + disabled / invalid / touched state, signal forms support |
11
11
  | `@tectra-ng/core/i18n` | `TX_LOCALE_US`, `TX_LOCALE_UA`, `TxLocaleService` (`setLocale`, `translate`, `formatNumber`, `formatDate`, `monthNames`, `weekdayNames`), `injectTranslations()` signal |
12
12
  | `@tectra-ng/core/styles` | `TxStyleLoader` — loads global styles of directive-based components once |
13
- | `@tectra-ng/core/ripple` | `txRipple` — ink wave: grows from the pointer while pressed, fades on release, starts from the centre on Enter / Space, calm fade with reduced motion. On with `provideTectra({ ripple: true })` or `[ripple]`; `rippleCentered`, `rippleColor`, `rippleDisabled`; tokens `--tx-ripple-{color,opacity,enter-duration,exit-duration,easing}` |
13
+ | `@tectra-ng/core/ripple` | `txRipple` — ink wave: grows from the pointer while pressed, fades on release, starts from the centre on Enter / Space, calm fade with reduced motion. On with `provideTectra({ ripple: true })`, `TxThemeService.setRipple(true)` at runtime, or `[ripple]`; `rippleCentered`, `rippleColor`, `rippleDisabled`; tokens `--tx-ripple-{color,opacity,enter-duration,exit-duration,easing}` |
14
14
  | `@tectra-ng/core/fluid` | `<tx-fluid>` / `[txFluid]` — every fluid-aware component inside takes the full width |
15
15
  | `@tectra-ng/core/utils` | `optionalBoolean` input transform |
16
16
 
@@ -7,6 +7,7 @@ var TxThemeService = class TxThemeService {
7
7
  config = inject(TECTRA_CONFIG, { optional: true });
8
8
  preset = signal(null, ...ngDevMode ? [{ debugName: "preset" }] : /* istanbul ignore next */ []);
9
9
  mode = signal("light", ...ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []);
10
+ ripple = signal(this.config?.ripple ?? false, ...ngDevMode ? [{ debugName: "ripple" }] : /* istanbul ignore next */ []);
10
11
  applyPreset(preset) {
11
12
  const id = "tectra-theme";
12
13
  const style = this.document.getElementById(id) ?? this.document.head.appendChild(this.document.createElement("style"));
@@ -16,6 +17,9 @@ var TxThemeService = class TxThemeService {
16
17
  style.textContent = darkSelector ? css.replace(":root[data-tx-theme=\"dark\"]", `:root[data-tx-theme="dark"], ${darkSelector}`) : css;
17
18
  this.preset.set(preset);
18
19
  }
20
+ setRipple(enabled) {
21
+ this.ripple.set(enabled);
22
+ }
19
23
  setMode(mode) {
20
24
  this.document.documentElement.setAttribute("data-tx-theme", mode);
21
25
  this.mode.set(mode);
@@ -1 +1 @@
1
- {"version":3,"file":"tectra-ng-core-config.mjs","names":[],"sources":["../../../../packages/core/config/src/tectra-config.token.ts","../../../../packages/core/config/src/theme.service.ts","../../../../packages/core/config/src/provide-tectra.ts","../../../../packages/core/config/src/component-config.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { TectraConfig } from './tectra-config.interface';\n\nexport const TECTRA_CONFIG = new InjectionToken<TectraConfig>('TECTRA_CONFIG');\n","import { DOCUMENT, Injectable, inject, signal } from '@angular/core';\nimport { TectraPreset, presetToCss } from '@tectra-ng/themes';\nimport { TxThemeMode } from './tectra-config.interface';\nimport { TECTRA_CONFIG } from './tectra-config.token';\n\n@Injectable({ providedIn: 'root' })\nexport class TxThemeService {\n private document = inject(DOCUMENT);\n private config = inject(TECTRA_CONFIG, { optional: true });\n\n readonly preset = signal<TectraPreset | null>(null);\n readonly mode = signal<TxThemeMode>('light');\n\n applyPreset(preset: TectraPreset): void {\n const id = 'tectra-theme';\n const style = this.document.getElementById(id) ?? this.document.head.appendChild(this.document.createElement('style'));\n style.id = id;\n const css = presetToCss(preset);\n const darkSelector = this.config?.darkSelector;\n style.textContent = darkSelector ? css.replace(':root[data-tx-theme=\"dark\"]', `:root[data-tx-theme=\"dark\"], ${darkSelector}`) : css;\n this.preset.set(preset);\n }\n\n setMode(mode: TxThemeMode): void {\n this.document.documentElement.setAttribute('data-tx-theme', mode);\n this.mode.set(mode);\n }\n\n toggleMode(): void {\n this.setMode(this.mode() === 'light' ? 'dark' : 'light');\n }\n}\n","import { EnvironmentProviders, inject, makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';\nimport { TectraConfig } from './tectra-config.interface';\nimport { TECTRA_CONFIG } from './tectra-config.token';\nimport { TxThemeService } from './theme.service';\n\nexport function provideTectra(config: TectraConfig): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: TECTRA_CONFIG, useValue: config },\n provideEnvironmentInitializer(() => {\n const themeService = inject(TxThemeService);\n themeService.applyPreset(config.preset);\n themeService.setMode(config.mode ?? 'light');\n }),\n ]);\n}\n","import { Signal, computed, inject } from '@angular/core';\nimport {\n TxPassThrough,\n TxPassThroughOptions,\n TxPassThroughPart,\n TxPassThroughValue,\n TxResolvedPassThrough,\n} from './pass-through.interface';\nimport { TECTRA_CONFIG } from './tectra-config.token';\n\nexport function injectUnstyled(local: Signal<boolean | undefined>): Signal<boolean> {\n const config = inject(TECTRA_CONFIG, { optional: true });\n return computed(() => local() ?? config?.unstyled ?? false);\n}\n\nfunction resolvePart<TInstance>(value: TxPassThroughValue<TInstance> | undefined, instance: TInstance): TxPassThroughPart | undefined {\n return typeof value === 'function' ? value({ instance }) : value;\n}\n\nfunction mergeParts(global: TxPassThroughPart, local: TxPassThroughPart): TxPassThroughPart {\n return {\n class: [global.class, local.class].filter(Boolean).join(' ') || undefined,\n style: { ...global.style, ...local.style },\n };\n}\n\nexport function injectPassThrough<TPart extends string, TInstance>(\n component: string,\n instance: TInstance,\n local: Signal<TxPassThrough<TPart, TInstance> | undefined>,\n localOptions: Signal<TxPassThroughOptions | undefined>,\n): Signal<TxResolvedPassThrough<TPart>> {\n const config = inject(TECTRA_CONFIG, { optional: true });\n\n return computed(() => {\n const global = (config?.pt?.[component] ?? {}) as TxPassThrough<TPart, TInstance>;\n const own: TxPassThrough<TPart, TInstance> = local() ?? {};\n const mergeSections = localOptions()?.mergeSections ?? config?.ptOptions?.mergeSections ?? true;\n const mergeProps = localOptions()?.mergeProps ?? config?.ptOptions?.mergeProps ?? false;\n const ownParts = Object.keys(own) as TPart[];\n const parts = mergeSections || !ownParts.length ? [...new Set([...(Object.keys(global) as TPart[]), ...ownParts])] : ownParts;\n\n return Object.fromEntries(\n parts.map((part) => {\n const fromGlobal = resolvePart(global[part], instance);\n const fromLocal = resolvePart(own[part], instance);\n const resolved = fromGlobal && fromLocal ? (mergeProps ? mergeParts(fromGlobal, fromLocal) : fromLocal) : (fromLocal ?? fromGlobal);\n return [part, resolved];\n }),\n ) as TxResolvedPassThrough<TPart>;\n });\n}\n"],"mappings":";;;AAGA,MAAa,gBAAgB,IAAI,eAA6B,eAAe;ACG7E,IAAa,iBAAb,MAAa,eAAc;CACjB,WAAW,OAAO,QAAQ;CAC1B,SAAS,OAAO,eAAe,EAAE,UAAU,KAAI,CAAE;CAEhD,SAAS,OAA4B,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAC1C,OAAO,OAAoB,SAAQ,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAE5C,YAAY,QAAoB;EAC9B,MAAM,KAAK;EACX,MAAM,QAAQ,KAAK,SAAS,eAAe,EAAE,KAAK,KAAK,SAAS,KAAK,YAAY,KAAK,SAAS,cAAc,OAAO,CAAC;EACrH,MAAM,KAAK;EACX,MAAM,MAAM,YAAY,MAAM;EAC9B,MAAM,eAAe,KAAK,QAAQ;EAClC,MAAM,cAAc,eAAe,IAAI,QAAQ,iCAA+B,gCAAgC,cAAc,IAAI;EAChI,KAAK,OAAO,IAAI,MAAM;CACxB;CAEA,QAAQ,MAAiB;EACvB,KAAK,SAAS,gBAAgB,aAAa,iBAAiB,IAAI;EAChE,KAAK,KAAK,IAAI,IAAI;CACpB;CAEA,aAAU;EACR,KAAK,QAAQ,KAAK,KAAI,MAAO,UAAU,SAAS,OAAO;CACzD;CAxBW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAc,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAd,OAAA,QAAA,GAAA,sBAAA;EAAA,YAAA;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AAK,GAAG;EAChC,MAAM,QAAQ,iBAAiB,CAAC,SAAS,SAAS,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAI,OAAO,KAAK,MAAM,GAAe,GAAG,QAAQ,CAAC,CAAC,IAAI;EAErH,OAAO,OAAO,YACZ,MAAM,KAAK,SAAQ;GACjB,MAAM,aAAa,YAAY,OAAO,OAAO,QAAQ;GACrD,MAAM,YAAY,YAAY,IAAI,OAAO,QAAQ;GAEjD,OAAO,CAAC,MADS,cAAc,YAAa,aAAa,WAAW,YAAY,SAAS,IAAI,YAAc,aAAa,UAClG;EACxB,CAAC,CAAC;CAEN,CAAC;AACH"}
1
+ {"version":3,"file":"tectra-ng-core-config.mjs","names":[],"sources":["../../../../packages/core/config/src/tectra-config.token.ts","../../../../packages/core/config/src/theme.service.ts","../../../../packages/core/config/src/provide-tectra.ts","../../../../packages/core/config/src/component-config.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { TectraConfig } from './tectra-config.interface';\n\nexport const TECTRA_CONFIG = new InjectionToken<TectraConfig>('TECTRA_CONFIG');\n","import { DOCUMENT, Injectable, inject, signal } from '@angular/core';\nimport { TectraPreset, presetToCss } from '@tectra-ng/themes';\nimport { TxThemeMode } from './tectra-config.interface';\nimport { TECTRA_CONFIG } from './tectra-config.token';\n\n@Injectable({ providedIn: 'root' })\nexport class TxThemeService {\n private document = inject(DOCUMENT);\n private config = inject(TECTRA_CONFIG, { optional: true });\n\n readonly preset = signal<TectraPreset | null>(null);\n readonly mode = signal<TxThemeMode>('light');\n readonly ripple = signal(this.config?.ripple ?? false);\n\n applyPreset(preset: TectraPreset): void {\n const id = 'tectra-theme';\n const style = this.document.getElementById(id) ?? this.document.head.appendChild(this.document.createElement('style'));\n style.id = id;\n const css = presetToCss(preset);\n const darkSelector = this.config?.darkSelector;\n style.textContent = darkSelector ? css.replace(':root[data-tx-theme=\"dark\"]', `:root[data-tx-theme=\"dark\"], ${darkSelector}`) : css;\n this.preset.set(preset);\n }\n\n setRipple(enabled: boolean): void {\n this.ripple.set(enabled);\n }\n\n setMode(mode: TxThemeMode): void {\n this.document.documentElement.setAttribute('data-tx-theme', mode);\n this.mode.set(mode);\n }\n\n toggleMode(): void {\n this.setMode(this.mode() === 'light' ? 'dark' : 'light');\n }\n}\n","import { EnvironmentProviders, inject, makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';\nimport { TectraConfig } from './tectra-config.interface';\nimport { TECTRA_CONFIG } from './tectra-config.token';\nimport { TxThemeService } from './theme.service';\n\nexport function provideTectra(config: TectraConfig): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: TECTRA_CONFIG, useValue: config },\n provideEnvironmentInitializer(() => {\n const themeService = inject(TxThemeService);\n themeService.applyPreset(config.preset);\n themeService.setMode(config.mode ?? 'light');\n }),\n ]);\n}\n","import { Signal, computed, inject } from '@angular/core';\nimport {\n TxPassThrough,\n TxPassThroughOptions,\n TxPassThroughPart,\n TxPassThroughValue,\n TxResolvedPassThrough,\n} from './pass-through.interface';\nimport { TECTRA_CONFIG } from './tectra-config.token';\n\nexport function injectUnstyled(local: Signal<boolean | undefined>): Signal<boolean> {\n const config = inject(TECTRA_CONFIG, { optional: true });\n return computed(() => local() ?? config?.unstyled ?? false);\n}\n\nfunction resolvePart<TInstance>(value: TxPassThroughValue<TInstance> | undefined, instance: TInstance): TxPassThroughPart | undefined {\n return typeof value === 'function' ? value({ instance }) : value;\n}\n\nfunction mergeParts(global: TxPassThroughPart, local: TxPassThroughPart): TxPassThroughPart {\n return {\n class: [global.class, local.class].filter(Boolean).join(' ') || undefined,\n style: { ...global.style, ...local.style },\n };\n}\n\nexport function injectPassThrough<TPart extends string, TInstance>(\n component: string,\n instance: TInstance,\n local: Signal<TxPassThrough<TPart, TInstance> | undefined>,\n localOptions: Signal<TxPassThroughOptions | undefined>,\n): Signal<TxResolvedPassThrough<TPart>> {\n const config = inject(TECTRA_CONFIG, { optional: true });\n\n return computed(() => {\n const global = (config?.pt?.[component] ?? {}) as TxPassThrough<TPart, TInstance>;\n const own: TxPassThrough<TPart, TInstance> = local() ?? {};\n const mergeSections = localOptions()?.mergeSections ?? config?.ptOptions?.mergeSections ?? true;\n const mergeProps = localOptions()?.mergeProps ?? config?.ptOptions?.mergeProps ?? false;\n const ownParts = Object.keys(own) as TPart[];\n const parts = mergeSections || !ownParts.length ? [...new Set([...(Object.keys(global) as TPart[]), ...ownParts])] : ownParts;\n\n return Object.fromEntries(\n parts.map((part) => {\n const fromGlobal = resolvePart(global[part], instance);\n const fromLocal = resolvePart(own[part], instance);\n const resolved = fromGlobal && fromLocal ? (mergeProps ? mergeParts(fromGlobal, fromLocal) : fromLocal) : (fromLocal ?? fromGlobal);\n return [part, resolved];\n }),\n ) as TxResolvedPassThrough<TPart>;\n });\n}\n"],"mappings":";;;AAGA,MAAa,gBAAgB,IAAI,eAA6B,eAAe;ACG7E,IAAa,iBAAb,MAAa,eAAc;CACjB,WAAW,OAAO,QAAQ;CAC1B,SAAS,OAAO,eAAe,EAAE,UAAU,KAAI,CAAE;CAEhD,SAAS,OAA4B,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAC1C,OAAO,OAAoB,SAAQ,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACnC,SAAS,OAAO,KAAK,QAAQ,UAAU,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAEtD,YAAY,QAAoB;EAC9B,MAAM,KAAK;EACX,MAAM,QAAQ,KAAK,SAAS,eAAe,EAAE,KAAK,KAAK,SAAS,KAAK,YAAY,KAAK,SAAS,cAAc,OAAO,CAAC;EACrH,MAAM,KAAK;EACX,MAAM,MAAM,YAAY,MAAM;EAC9B,MAAM,eAAe,KAAK,QAAQ;EAClC,MAAM,cAAc,eAAe,IAAI,QAAQ,iCAA+B,gCAAgC,cAAc,IAAI;EAChI,KAAK,OAAO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AAG,KAAK;EAChE,OAAO;GAAE,GAAG,OAAO;GAAO,GAAG,MAAM;EAAK;CACzC;AACH;AAEA,SAAgB,kBACd,WACA,UACA,OACA,cAAsD;CAEtD,MAAM,SAAS,OAAO,eAAe,EAAE,UAAU,KAAI,CAAE;CAEvD,OAAO,eAAc;EACnB,MAAM,SAAU,QAAQ,KAAK,cAAc,CAAA;EAC3C,MAAM,MAAuC,MAAK,KAAM,CAAA;EACxD,MAAM,gBAAgB,aAAY,CAAE,EAAE,iBAAiB,QAAQ,WAAW,iBAAiB;EAC3F,MAAM,aAAa,aAAY,CAAE,EAAE,cAAc,QAAQ,WAAW,cAAc;EAClF,MAAM,WAAW,OAAO,KAAK,GAAG;EAChC,MAAM,QAAQ,iBAAiB,CAAC,SAAS,SAAS,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAI,OAAO,KAAK,MAAM,GAAe,GAAG,QAAQ,CAAC,CAAC,IAAI;EAErH,OAAO,OAAO,YACZ,MAAM,KAAK,SAAQ;GACjB,MAAM,aAAa,YAAY,OAAO,OAAO,QAAQ;GACrD,MAAM,YAAY,YAAY,IAAI,OAAO,QAAQ;GAEjD,OAAO,CAAC,MADS,cAAc,YAAa,aAAa,WAAW,YAAY,SAAS,IAAI,YAAc,aAAa,UAClG;EACxB,CAAC,CAAC;CAEN,CAAC;AACH"}
@@ -83,6 +83,10 @@ const TX_LOCALE_US = {
83
83
  tableActions: "Actions",
84
84
  tableActionsHint: "Choose which row actions are shown inline",
85
85
  rowActions: "Row actions",
86
+ nodeActions: "Node actions",
87
+ listView: "List",
88
+ gridView: "Grid",
89
+ layout: "Layout",
86
90
  selectRow: "Select row",
87
91
  expandRow: "Expand row",
88
92
  collapseRow: "Collapse row",
@@ -204,6 +208,10 @@ const TX_LOCALE_UA = {
204
208
  tableActions: "Дії",
205
209
  tableActionsHint: "Оберіть, які дії рядка показувати одразу",
206
210
  rowActions: "Дії рядка",
211
+ nodeActions: "Дії з вузлом",
212
+ listView: "Список",
213
+ gridView: "Сітка",
214
+ layout: "Вигляд",
207
215
  selectRow: "Обрати рядок",
208
216
  expandRow: "Розгорнути рядок",
209
217
  collapseRow: "Згорнути рядок",
@@ -1 +1 @@
1
- {"version":3,"file":"tectra-ng-core-i18n.mjs","names":[],"sources":["../../../../packages/core/i18n/src/locales.ts","../../../../packages/core/i18n/src/locale.service.ts","../../../../packages/core/i18n/src/translations.ts"],"sourcesContent":["import { TxLocaleDefinition } from '@tectra-ng/core/config';\n\nexport const TX_LOCALE_US: TxLocaleDefinition = {\n code: 'us',\n intl: 'en-US',\n firstDayOfWeek: 0,\n translations: {\n emptyMessage: 'No results found',\n searchPlaceholder: 'Search',\n clear: 'Clear',\n selectAll: 'Select all',\n close: 'Close',\n loading: 'Loading',\n today: 'Today',\n previousPage: 'Previous page',\n nextPage: 'Next page',\n pageReport: '{first}–{last} of {total}',\n copy: 'Copy',\n copied: 'Copied',\n validationRequired: 'This field is required',\n validationEmail: 'Enter a valid email',\n validationMinlength: 'At least {requiredLength} characters',\n validationMaxlength: 'At most {requiredLength} characters',\n validationMin: 'Must be at least {min}',\n validationMax: 'Must be at most {max}',\n validationPattern: 'Invalid format',\n validationInvalid: 'Invalid value',\n passwordPrompt: 'Enter a password',\n passwordWeak: 'Weak',\n passwordMedium: 'Medium',\n passwordStrong: 'Strong',\n showPassword: 'Show password',\n hidePassword: 'Hide password',\n otpCell: 'Character {index} of {length}',\n increment: 'Increase',\n decrement: 'Decrease',\n ratingValue: '{value} of {stars}',\n rangeStart: 'from',\n rangeEnd: 'to',\n generatePassword: 'Generate password',\n remove: 'Remove',\n moreItems: '{count} more',\n selectedItems: '{count} items selected',\n selectedOfTotal: '{selected} of {total}',\n showOptions: 'Show options',\n removeItem: 'Remove {item}',\n itemsLimit: 'Up to {max}',\n pickColor: 'Pick a colour',\n noColor: 'No colour',\n colorArea: 'Saturation and brightness',\n colorAreaValue: 'Saturation {saturation}%, brightness {brightness}%',\n colorHue: 'Hue',\n colorHex: 'Hex colour',\n colorPresets: 'Preset colours',\n useEmail: 'Use {email}',\n didYouMean: 'Did you mean {email}?',\n yes: 'Yes',\n no: 'No',\n copyLink: 'Copy link',\n copyEmail: 'Copy email',\n copyPhone: 'Copy phone number',\n opensInNewTab: 'opens in a new tab',\n notifications: 'Notifications',\n confirm: 'Confirm',\n cancel: 'Cancel',\n delete: 'Delete',\n confirmQuestion: 'Are you sure?',\n maximize: 'Maximize',\n restore: 'Restore',\n moreActions: 'More actions',\n firstPage: 'First page',\n lastPage: 'Last page',\n pageNumber: 'Page {page}',\n rowsPerPage: 'Rows per page',\n jumpToPage: 'Go to page',\n currentPageReport: '{currentPage} of {totalPages}',\n totalCount: 'Total: {count}',\n pagination: 'Pagination',\n tableSettings: 'Table settings',\n tableColumns: 'Columns',\n tableColumnsHint: 'Show or hide table columns',\n tableActions: 'Actions',\n tableActionsHint: 'Choose which row actions are shown inline',\n rowActions: 'Row actions',\n selectRow: 'Select row',\n expandRow: 'Expand row',\n collapseRow: 'Collapse row',\n resizeColumn: 'Resize {column}',\n filterColumn: 'Filter {column}',\n filterValue: 'Value',\n filterMatchMode: 'Match mode',\n filterMatchAll: 'Match all',\n filterMatchAny: 'Match any',\n filterAddRule: 'Add rule',\n filterRemoveRule: 'Remove rule',\n filterApply: 'Apply',\n filterAny: 'Any',\n filterFrom: 'From',\n filterTo: 'To',\n startsWith: 'Starts with',\n contains: 'Contains',\n notContains: 'Not contains',\n endsWith: 'Ends with',\n equals: 'Equals',\n notEquals: 'Not equals',\n in: 'Is one of',\n lt: 'Less than',\n lte: 'Less than or equal to',\n gt: 'Greater than',\n gte: 'Greater than or equal to',\n between: 'Between',\n dateIs: 'Date is',\n dateIsNot: 'Date is not',\n dateBefore: 'Date is before',\n dateAfter: 'Date is after',\n editRow: 'Edit row',\n saveRow: 'Save row',\n cancelEdit: 'Cancel editing',\n editCell: 'Edit {column}',\n moveRow: 'Move row',\n rowGroup: '{count} rows',\n },\n};\n\nexport const TX_LOCALE_UA: TxLocaleDefinition = {\n code: 'ua',\n intl: 'uk-UA',\n firstDayOfWeek: 1,\n translations: {\n emptyMessage: 'Нічого не знайдено',\n searchPlaceholder: 'Пошук',\n clear: 'Очистити',\n selectAll: 'Вибрати все',\n close: 'Закрити',\n loading: 'Завантаження',\n today: 'Сьогодні',\n previousPage: 'Попередня сторінка',\n nextPage: 'Наступна сторінка',\n pageReport: '{first}–{last} з {total}',\n copy: 'Копіювати',\n copied: 'Скопійовано',\n validationRequired: \"Обов'язкове поле\",\n validationEmail: 'Введіть коректний email',\n validationMinlength: 'Щонайменше {requiredLength} символів',\n validationMaxlength: 'Не більше {requiredLength} символів',\n validationMin: 'Не менше {min}',\n validationMax: 'Не більше {max}',\n validationPattern: 'Неправильний формат',\n validationInvalid: 'Некоректне значення',\n passwordPrompt: 'Введіть пароль',\n passwordWeak: 'Слабкий',\n passwordMedium: 'Середній',\n passwordStrong: 'Надійний',\n showPassword: 'Показати пароль',\n hidePassword: 'Сховати пароль',\n otpCell: 'Символ {index} з {length}',\n increment: 'Збільшити',\n decrement: 'Зменшити',\n ratingValue: '{value} з {stars}',\n rangeStart: 'від',\n rangeEnd: 'до',\n generatePassword: 'Згенерувати пароль',\n remove: 'Видалити',\n moreItems: 'ще {count}',\n selectedItems: 'Вибрано: {count}',\n selectedOfTotal: '{selected} з {total}',\n showOptions: 'Показати варіанти',\n removeItem: 'Видалити {item}',\n itemsLimit: 'Не більше {max}',\n pickColor: 'Вибрати колір',\n noColor: 'Без кольору',\n colorArea: 'Насиченість і яскравість',\n colorAreaValue: 'Насиченість {saturation}%, яскравість {brightness}%',\n colorHue: 'Відтінок',\n colorHex: 'Колір hex',\n colorPresets: 'Готові кольори',\n useEmail: 'Використати {email}',\n didYouMean: 'Можливо, {email}?',\n yes: 'Так',\n no: 'Ні',\n copyLink: 'Копіювати посилання',\n copyEmail: 'Копіювати email',\n copyPhone: 'Копіювати номер телефону',\n opensInNewTab: 'відкривається в новій вкладці',\n notifications: 'Сповіщення',\n confirm: 'Підтвердити',\n cancel: 'Скасувати',\n delete: 'Видалити',\n confirmQuestion: 'Ви впевнені?',\n maximize: 'Розгорнути',\n restore: 'Відновити',\n moreActions: 'Більше дій',\n firstPage: 'Перша сторінка',\n lastPage: 'Остання сторінка',\n pageNumber: 'Сторінка {page}',\n rowsPerPage: 'Рядків на сторінці',\n jumpToPage: 'Перейти до сторінки',\n currentPageReport: '{currentPage} з {totalPages}',\n totalCount: 'Усього: {count}',\n pagination: 'Пагінація',\n tableSettings: 'Налаштування таблиці',\n tableColumns: 'Колонки',\n tableColumnsHint: 'Показати або сховати колонки таблиці',\n tableActions: 'Дії',\n tableActionsHint: 'Оберіть, які дії рядка показувати одразу',\n rowActions: 'Дії рядка',\n selectRow: 'Обрати рядок',\n expandRow: 'Розгорнути рядок',\n collapseRow: 'Згорнути рядок',\n resizeColumn: 'Змінити ширину «{column}»',\n filterColumn: 'Фільтр «{column}»',\n filterValue: 'Значення',\n filterMatchMode: 'Умова',\n filterMatchAll: 'Усі умови',\n filterMatchAny: 'Будь-яка умова',\n filterAddRule: 'Додати умову',\n filterRemoveRule: 'Прибрати умову',\n filterApply: 'Застосувати',\n filterAny: 'Будь-яке',\n filterFrom: 'Від',\n filterTo: 'До',\n startsWith: 'Починається з',\n contains: 'Містить',\n notContains: 'Не містить',\n endsWith: 'Закінчується на',\n equals: 'Дорівнює',\n notEquals: 'Не дорівнює',\n in: 'Одне з',\n lt: 'Менше ніж',\n lte: 'Менше або дорівнює',\n gt: 'Більше ніж',\n gte: 'Більше або дорівнює',\n between: 'Між',\n dateIs: 'Дата',\n dateIsNot: 'Дата не',\n dateBefore: 'Дата до',\n dateAfter: 'Дата після',\n editRow: 'Редагувати рядок',\n saveRow: 'Зберегти рядок',\n cancelEdit: 'Скасувати редагування',\n editCell: 'Редагувати «{column}»',\n moveRow: 'Перемістити рядок',\n rowGroup: 'Рядків: {count}',\n },\n};\n\nexport const TX_LOCALES: Record<string, TxLocaleDefinition> = { us: TX_LOCALE_US, ua: TX_LOCALE_UA };\n","import { Injectable, computed, inject, signal } from '@angular/core';\nimport { TECTRA_CONFIG, TxLocaleCode, TxLocaleDefinition, TxTranslations } from '@tectra-ng/core/config';\nimport { TX_LOCALES, TX_LOCALE_US } from './locales';\n\n@Injectable({ providedIn: 'root' })\nexport class TxLocaleService {\n private config = inject(TECTRA_CONFIG, { optional: true });\n\n readonly locale = signal<TxLocaleDefinition>(this.resolve(this.config?.locale ?? 'us'));\n readonly translations = computed<TxTranslations>(() => ({ ...this.locale().translations, ...this.config?.translations }));\n\n setLocale(locale: TxLocaleCode | TxLocaleDefinition): void {\n this.locale.set(this.resolve(locale));\n }\n\n translate(key: keyof TxTranslations, params: Record<string, string | number> = {}): string {\n return this.translations()[key].replace(/\\{(\\w+)\\}/g, (match, name: string) => String(params[name] ?? match));\n }\n\n formatNumber(value: number, options?: Intl.NumberFormatOptions): string {\n return new Intl.NumberFormat(this.locale().intl, options).format(value);\n }\n\n formatDate(value: Date | number, options?: Intl.DateTimeFormatOptions): string {\n return new Intl.DateTimeFormat(this.locale().intl, options).format(value);\n }\n\n monthNames(style: 'long' | 'short' = 'long'): string[] {\n const format = new Intl.DateTimeFormat(this.locale().intl, { month: style });\n return Array.from({ length: 12 }, (_, month) => format.format(new Date(2024, month, 1)));\n }\n\n weekdayNames(style: 'long' | 'short' | 'narrow' = 'short'): string[] {\n const format = new Intl.DateTimeFormat(this.locale().intl, { weekday: style });\n const first = this.locale().firstDayOfWeek;\n return Array.from({ length: 7 }, (_, day) => format.format(new Date(2024, 0, 7 + ((day + first) % 7))));\n }\n\n private resolve(locale: TxLocaleCode | TxLocaleDefinition): TxLocaleDefinition {\n return typeof locale === 'string' ? (TX_LOCALES[locale] ?? TX_LOCALE_US) : locale;\n }\n}\n","import { Signal, inject } from '@angular/core';\nimport { TxTranslations } from '@tectra-ng/core/config';\nimport { TxLocaleService } from './locale.service';\n\nexport function injectTranslations(): Signal<TxTranslations> {\n return inject(TxLocaleService).translations;\n}\n"],"mappings":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CAAC,CAAC,OAAO,KAAK;CAC1E;CAEA,WAAW,QAA0B,QAAM;EACzC,MAAM,SAAS,IAAI,KAAK,eAAe,KAAK,OAAM,CAAE,CAAC,MAAM,EAAE,OAAO,MAAK,CAAE;EAC3E,OAAO,MAAM,KAAK,EAAE,QAAQ,GAAE,IAAK,GAAG,UAAU,OAAO,OAAO,IAAI,KAAK,MAAM,OAAO,CAAC,CAAC,CAAC;CACzF;CAEA,aAAa,QAAqC,SAAO;EACvD,MAAM,SAAS,IAAI,KAAK,eAAe,KAAK,OAAM,CAAE,CAAC,MAAM,EAAE,SAAS,MAAK,CAAE;EAC7E,MAAM,QAAQ,KAAK,OAAM,CAAE,CAAC;EAC5B,OAAO,MAAM,KAAK,EAAE,QAAQ,EAAC,IAAK,GAAG,QAAQ,OAAO,OAAO,IAAI,KAAK,MAAM,GAAG,KAAM,MAAM,SAAS,CAAE,CAAC,CAAC;CACxG;CAEQ,QAAQ,QAAyC;EACvD,OAAO,OAAO,WAAW,WAAY,WAAW,WAAW,eAAgB;CAC7E;CAnCW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAe,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAf,OAAA,QAAA,GAAA,sBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAe,YADF;CAAM,CAAA;;AACnB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAe,YAAA,CAAA;EAD3B,MAAA;EAAW,MAAA,CAAA,EAAE,YAAY,OAAM,CAAE;;;ACAlC,SAAgB,qBAAkB;CAChC,OAAO,OAAO,eAAe,CAAC,CAAC;AACjC"}
1
+ {"version":3,"file":"tectra-ng-core-i18n.mjs","names":[],"sources":["../../../../packages/core/i18n/src/locales.ts","../../../../packages/core/i18n/src/locale.service.ts","../../../../packages/core/i18n/src/translations.ts"],"sourcesContent":["import { TxLocaleDefinition } from '@tectra-ng/core/config';\n\nexport const TX_LOCALE_US: TxLocaleDefinition = {\n code: 'us',\n intl: 'en-US',\n firstDayOfWeek: 0,\n translations: {\n emptyMessage: 'No results found',\n searchPlaceholder: 'Search',\n clear: 'Clear',\n selectAll: 'Select all',\n close: 'Close',\n loading: 'Loading',\n today: 'Today',\n previousPage: 'Previous page',\n nextPage: 'Next page',\n pageReport: '{first}–{last} of {total}',\n copy: 'Copy',\n copied: 'Copied',\n validationRequired: 'This field is required',\n validationEmail: 'Enter a valid email',\n validationMinlength: 'At least {requiredLength} characters',\n validationMaxlength: 'At most {requiredLength} characters',\n validationMin: 'Must be at least {min}',\n validationMax: 'Must be at most {max}',\n validationPattern: 'Invalid format',\n validationInvalid: 'Invalid value',\n passwordPrompt: 'Enter a password',\n passwordWeak: 'Weak',\n passwordMedium: 'Medium',\n passwordStrong: 'Strong',\n showPassword: 'Show password',\n hidePassword: 'Hide password',\n otpCell: 'Character {index} of {length}',\n increment: 'Increase',\n decrement: 'Decrease',\n ratingValue: '{value} of {stars}',\n rangeStart: 'from',\n rangeEnd: 'to',\n generatePassword: 'Generate password',\n remove: 'Remove',\n moreItems: '{count} more',\n selectedItems: '{count} items selected',\n selectedOfTotal: '{selected} of {total}',\n showOptions: 'Show options',\n removeItem: 'Remove {item}',\n itemsLimit: 'Up to {max}',\n pickColor: 'Pick a colour',\n noColor: 'No colour',\n colorArea: 'Saturation and brightness',\n colorAreaValue: 'Saturation {saturation}%, brightness {brightness}%',\n colorHue: 'Hue',\n colorHex: 'Hex colour',\n colorPresets: 'Preset colours',\n useEmail: 'Use {email}',\n didYouMean: 'Did you mean {email}?',\n yes: 'Yes',\n no: 'No',\n copyLink: 'Copy link',\n copyEmail: 'Copy email',\n copyPhone: 'Copy phone number',\n opensInNewTab: 'opens in a new tab',\n notifications: 'Notifications',\n confirm: 'Confirm',\n cancel: 'Cancel',\n delete: 'Delete',\n confirmQuestion: 'Are you sure?',\n maximize: 'Maximize',\n restore: 'Restore',\n moreActions: 'More actions',\n firstPage: 'First page',\n lastPage: 'Last page',\n pageNumber: 'Page {page}',\n rowsPerPage: 'Rows per page',\n jumpToPage: 'Go to page',\n currentPageReport: '{currentPage} of {totalPages}',\n totalCount: 'Total: {count}',\n pagination: 'Pagination',\n tableSettings: 'Table settings',\n tableColumns: 'Columns',\n tableColumnsHint: 'Show or hide table columns',\n tableActions: 'Actions',\n tableActionsHint: 'Choose which row actions are shown inline',\n rowActions: 'Row actions',\n nodeActions: 'Node actions',\n listView: 'List',\n gridView: 'Grid',\n layout: 'Layout',\n selectRow: 'Select row',\n expandRow: 'Expand row',\n collapseRow: 'Collapse row',\n resizeColumn: 'Resize {column}',\n filterColumn: 'Filter {column}',\n filterValue: 'Value',\n filterMatchMode: 'Match mode',\n filterMatchAll: 'Match all',\n filterMatchAny: 'Match any',\n filterAddRule: 'Add rule',\n filterRemoveRule: 'Remove rule',\n filterApply: 'Apply',\n filterAny: 'Any',\n filterFrom: 'From',\n filterTo: 'To',\n startsWith: 'Starts with',\n contains: 'Contains',\n notContains: 'Not contains',\n endsWith: 'Ends with',\n equals: 'Equals',\n notEquals: 'Not equals',\n in: 'Is one of',\n lt: 'Less than',\n lte: 'Less than or equal to',\n gt: 'Greater than',\n gte: 'Greater than or equal to',\n between: 'Between',\n dateIs: 'Date is',\n dateIsNot: 'Date is not',\n dateBefore: 'Date is before',\n dateAfter: 'Date is after',\n editRow: 'Edit row',\n saveRow: 'Save row',\n cancelEdit: 'Cancel editing',\n editCell: 'Edit {column}',\n moveRow: 'Move row',\n rowGroup: '{count} rows',\n },\n};\n\nexport const TX_LOCALE_UA: TxLocaleDefinition = {\n code: 'ua',\n intl: 'uk-UA',\n firstDayOfWeek: 1,\n translations: {\n emptyMessage: 'Нічого не знайдено',\n searchPlaceholder: 'Пошук',\n clear: 'Очистити',\n selectAll: 'Вибрати все',\n close: 'Закрити',\n loading: 'Завантаження',\n today: 'Сьогодні',\n previousPage: 'Попередня сторінка',\n nextPage: 'Наступна сторінка',\n pageReport: '{first}–{last} з {total}',\n copy: 'Копіювати',\n copied: 'Скопійовано',\n validationRequired: \"Обов'язкове поле\",\n validationEmail: 'Введіть коректний email',\n validationMinlength: 'Щонайменше {requiredLength} символів',\n validationMaxlength: 'Не більше {requiredLength} символів',\n validationMin: 'Не менше {min}',\n validationMax: 'Не більше {max}',\n validationPattern: 'Неправильний формат',\n validationInvalid: 'Некоректне значення',\n passwordPrompt: 'Введіть пароль',\n passwordWeak: 'Слабкий',\n passwordMedium: 'Середній',\n passwordStrong: 'Надійний',\n showPassword: 'Показати пароль',\n hidePassword: 'Сховати пароль',\n otpCell: 'Символ {index} з {length}',\n increment: 'Збільшити',\n decrement: 'Зменшити',\n ratingValue: '{value} з {stars}',\n rangeStart: 'від',\n rangeEnd: 'до',\n generatePassword: 'Згенерувати пароль',\n remove: 'Видалити',\n moreItems: 'ще {count}',\n selectedItems: 'Вибрано: {count}',\n selectedOfTotal: '{selected} з {total}',\n showOptions: 'Показати варіанти',\n removeItem: 'Видалити {item}',\n itemsLimit: 'Не більше {max}',\n pickColor: 'Вибрати колір',\n noColor: 'Без кольору',\n colorArea: 'Насиченість і яскравість',\n colorAreaValue: 'Насиченість {saturation}%, яскравість {brightness}%',\n colorHue: 'Відтінок',\n colorHex: 'Колір hex',\n colorPresets: 'Готові кольори',\n useEmail: 'Використати {email}',\n didYouMean: 'Можливо, {email}?',\n yes: 'Так',\n no: 'Ні',\n copyLink: 'Копіювати посилання',\n copyEmail: 'Копіювати email',\n copyPhone: 'Копіювати номер телефону',\n opensInNewTab: 'відкривається в новій вкладці',\n notifications: 'Сповіщення',\n confirm: 'Підтвердити',\n cancel: 'Скасувати',\n delete: 'Видалити',\n confirmQuestion: 'Ви впевнені?',\n maximize: 'Розгорнути',\n restore: 'Відновити',\n moreActions: 'Більше дій',\n firstPage: 'Перша сторінка',\n lastPage: 'Остання сторінка',\n pageNumber: 'Сторінка {page}',\n rowsPerPage: 'Рядків на сторінці',\n jumpToPage: 'Перейти до сторінки',\n currentPageReport: '{currentPage} з {totalPages}',\n totalCount: 'Усього: {count}',\n pagination: 'Пагінація',\n tableSettings: 'Налаштування таблиці',\n tableColumns: 'Колонки',\n tableColumnsHint: 'Показати або сховати колонки таблиці',\n tableActions: 'Дії',\n tableActionsHint: 'Оберіть, які дії рядка показувати одразу',\n rowActions: 'Дії рядка',\n nodeActions: 'Дії з вузлом',\n listView: 'Список',\n gridView: 'Сітка',\n layout: 'Вигляд',\n selectRow: 'Обрати рядок',\n expandRow: 'Розгорнути рядок',\n collapseRow: 'Згорнути рядок',\n resizeColumn: 'Змінити ширину «{column}»',\n filterColumn: 'Фільтр «{column}»',\n filterValue: 'Значення',\n filterMatchMode: 'Умова',\n filterMatchAll: 'Усі умови',\n filterMatchAny: 'Будь-яка умова',\n filterAddRule: 'Додати умову',\n filterRemoveRule: 'Прибрати умову',\n filterApply: 'Застосувати',\n filterAny: 'Будь-яке',\n filterFrom: 'Від',\n filterTo: 'До',\n startsWith: 'Починається з',\n contains: 'Містить',\n notContains: 'Не містить',\n endsWith: 'Закінчується на',\n equals: 'Дорівнює',\n notEquals: 'Не дорівнює',\n in: 'Одне з',\n lt: 'Менше ніж',\n lte: 'Менше або дорівнює',\n gt: 'Більше ніж',\n gte: 'Більше або дорівнює',\n between: 'Між',\n dateIs: 'Дата',\n dateIsNot: 'Дата не',\n dateBefore: 'Дата до',\n dateAfter: 'Дата після',\n editRow: 'Редагувати рядок',\n saveRow: 'Зберегти рядок',\n cancelEdit: 'Скасувати редагування',\n editCell: 'Редагувати «{column}»',\n moveRow: 'Перемістити рядок',\n rowGroup: 'Рядків: {count}',\n },\n};\n\nexport const TX_LOCALES: Record<string, TxLocaleDefinition> = { us: TX_LOCALE_US, ua: TX_LOCALE_UA };\n","import { Injectable, computed, inject, signal } from '@angular/core';\nimport { TECTRA_CONFIG, TxLocaleCode, TxLocaleDefinition, TxTranslations } from '@tectra-ng/core/config';\nimport { TX_LOCALES, TX_LOCALE_US } from './locales';\n\n@Injectable({ providedIn: 'root' })\nexport class TxLocaleService {\n private config = inject(TECTRA_CONFIG, { optional: true });\n\n readonly locale = signal<TxLocaleDefinition>(this.resolve(this.config?.locale ?? 'us'));\n readonly translations = computed<TxTranslations>(() => ({ ...this.locale().translations, ...this.config?.translations }));\n\n setLocale(locale: TxLocaleCode | TxLocaleDefinition): void {\n this.locale.set(this.resolve(locale));\n }\n\n translate(key: keyof TxTranslations, params: Record<string, string | number> = {}): string {\n return this.translations()[key].replace(/\\{(\\w+)\\}/g, (match, name: string) => String(params[name] ?? match));\n }\n\n formatNumber(value: number, options?: Intl.NumberFormatOptions): string {\n return new Intl.NumberFormat(this.locale().intl, options).format(value);\n }\n\n formatDate(value: Date | number, options?: Intl.DateTimeFormatOptions): string {\n return new Intl.DateTimeFormat(this.locale().intl, options).format(value);\n }\n\n monthNames(style: 'long' | 'short' = 'long'): string[] {\n const format = new Intl.DateTimeFormat(this.locale().intl, { month: style });\n return Array.from({ length: 12 }, (_, month) => format.format(new Date(2024, month, 1)));\n }\n\n weekdayNames(style: 'long' | 'short' | 'narrow' = 'short'): string[] {\n const format = new Intl.DateTimeFormat(this.locale().intl, { weekday: style });\n const first = this.locale().firstDayOfWeek;\n return Array.from({ length: 7 }, (_, day) => format.format(new Date(2024, 0, 7 + ((day + first) % 7))));\n }\n\n private resolve(locale: TxLocaleCode | TxLocaleDefinition): TxLocaleDefinition {\n return typeof locale === 'string' ? (TX_LOCALES[locale] ?? TX_LOCALE_US) : locale;\n }\n}\n","import { Signal, inject } from '@angular/core';\nimport { TxTranslations } from '@tectra-ng/core/config';\nimport { TxLocaleService } from './locale.service';\n\nexport function injectTranslations(): Signal<TxTranslations> {\n return inject(TxLocaleService).translations;\n}\n"],"mappings":";;;AAEA,MAAa,eAAmC;CAC9C,MAAM;CACN,MAAM;CACN,gBAAgB;CAChB,cAAc;EACZ,cAAc;EACd,mBAAmB;EACnB,OAAO;EACP,WAAW;EACX,OAAO;E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QAA0B,QAAM;EACzC,MAAM,SAAS,IAAI,KAAK,eAAe,KAAK,OAAM,CAAE,CAAC,MAAM,EAAE,OAAO,MAAK,CAAE;EAC3E,OAAO,MAAM,KAAK,EAAE,QAAQ,GAAE,IAAK,GAAG,UAAU,OAAO,OAAO,IAAI,KAAK,MAAM,OAAO,CAAC,CAAC,CAAC;CACzF;CAEA,aAAa,QAAqC,SAAO;EACvD,MAAM,SAAS,IAAI,KAAK,eAAe,KAAK,OAAM,CAAE,CAAC,MAAM,EAAE,SAAS,MAAK,CAAE;EAC7E,MAAM,QAAQ,KAAK,OAAM,CAAE,CAAC;EAC5B,OAAO,MAAM,KAAK,EAAE,QAAQ,EAAC,IAAK,GAAG,QAAQ,OAAO,OAAO,IAAI,KAAK,MAAM,GAAG,KAAM,MAAM,SAAS,CAAE,CAAC,CAAC;CACxG;CAEQ,QAAQ,QAAyC;EACvD,OAAO,OAAO,WAAW,WAAY,WAAW,WAAW,eAAgB;CAC7E;CAnCW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAe,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAf,OAAA,QAAA,GAAA,sBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAe,YADF;CAAM,CAAA;;AACnB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAe,YAAA,CAAA;EAD3B,MAAA;EAAW,MAAA,CAAA,EAAE,YAAY,OAAM,CAAE;;;ACAlC,SAAgB,qBAAkB;CAChC,OAAO,OAAO,eAAe,CAAC,CAAC;AACjC"}
@@ -1,6 +1,6 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import { ChangeDetectionStrategy, Component, DOCUMENT, Directive, ElementRef, ViewEncapsulation, booleanAttribute, computed, inject, input } from "@angular/core";
3
- import { TECTRA_CONFIG } from "@tectra-ng/core/config";
3
+ import { TxThemeService } from "@tectra-ng/core/config";
4
4
  import { TxStyleLoader } from "@tectra-ng/core/styles";
5
5
  import { optionalBoolean } from "@tectra-ng/core/utils";
6
6
  var TxRippleStyles = class TxRippleStyles {
@@ -45,7 +45,7 @@ i0.ɵɵngDeclareClassMetadata({
45
45
  var TxRipple = class TxRipple {
46
46
  elementRef = inject(ElementRef);
47
47
  document = inject(DOCUMENT);
48
- config = inject(TECTRA_CONFIG, { optional: true });
48
+ txThemeService = inject(TxThemeService);
49
49
  txStyleLoader = inject(TxStyleLoader);
50
50
  ripples = /* @__PURE__ */ new Set();
51
51
  container = null;
@@ -62,7 +62,7 @@ var TxRipple = class TxRipple {
62
62
  transform: booleanAttribute
63
63
  });
64
64
  rippleColor = input(void 0, ...ngDevMode ? [{ debugName: "rippleColor" }] : /* istanbul ignore next */ []);
65
- isEnabled = computed(() => !this.rippleDisabled() && (this.ripple() ?? !!this.config?.ripple), ...ngDevMode ? [{ debugName: "isEnabled" }] : /* istanbul ignore next */ []);
65
+ isEnabled = computed(() => !this.rippleDisabled() && (this.ripple() ?? this.txThemeService.ripple()), ...ngDevMode ? [{ debugName: "isEnabled" }] : /* istanbul ignore next */ []);
66
66
  onPointerDown(event) {
67
67
  if (event.button === 0 && !event.defaultPrevented) this.launch(event.clientX, event.clientY, false);
68
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tectra-ng-core-ripple.mjs","names":[],"sources":["../../../../packages/core/ripple/src/ripple.styles.ts","../../../../packages/core/ripple/src/ripple.directive.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'tx-ripple-styles',\n template: '',\n styles: `\n .tx-ripple-host {\n position: relative;\n isolation: isolate;\n -webkit-tap-highlight-color: transparent;\n }\n\n .tx-ripple-container {\n position: absolute;\n inset: 0;\n z-index: -1;\n overflow: hidden;\n border-radius: inherit;\n pointer-events: none;\n }\n\n .tx-ripple {\n position: absolute;\n border-radius: 50%;\n background: var(--tx-ripple-color, currentColor);\n opacity: var(--tx-ripple-opacity, 0.2);\n transform: scale(0);\n pointer-events: none;\n will-change: transform, opacity;\n }\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TxRippleStyles {}\n","import { DOCUMENT, Directive, ElementRef, booleanAttribute, computed, inject, input } from '@angular/core';\nimport { TECTRA_CONFIG } from '@tectra-ng/core/config';\nimport { TxStyleLoader } from '@tectra-ng/core/styles';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TxRippleStyles } from './ripple.styles';\nimport { TxRippleRef } from './ripple.types';\n\n@Directive({\n selector: '[txRipple]',\n host: {\n '[class.tx-ripple-host]': 'isEnabled()',\n '[style.--tx-ripple-color]': 'rippleColor() ?? null',\n '(pointerdown)': 'onPointerDown($event)',\n '(pointerup)': 'releasePointerRipples()',\n '(pointerleave)': 'releasePointerRipples()',\n '(pointercancel)': 'releasePointerRipples()',\n '(keydown)': 'onKeyDown($event)',\n '(keyup)': 'onKeyUp($event)',\n '(blur)': 'releaseAll()',\n },\n})\nexport class TxRipple {\n private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private document = inject(DOCUMENT);\n private config = inject(TECTRA_CONFIG, { optional: true });\n private txStyleLoader = inject(TxStyleLoader);\n private ripples = new Set<TxRippleRef>();\n private container: HTMLElement | null = null;\n\n readonly ripple = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n readonly rippleDisabled = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly rippleCentered = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly rippleColor = input<string | undefined>(undefined);\n\n readonly isEnabled = computed(() => !this.rippleDisabled() && (this.ripple() ?? !!this.config?.ripple));\n\n onPointerDown(event: PointerEvent): void {\n if (event.button === 0 && !event.defaultPrevented) {\n this.launch(event.clientX, event.clientY, false);\n }\n }\n\n onKeyDown(event: KeyboardEvent): void {\n if ((event.key === 'Enter' || event.key === ' ') && !event.repeat) {\n this.launch(0, 0, true);\n }\n }\n\n onKeyUp(event: KeyboardEvent): void {\n if (event.key === 'Enter' || event.key === ' ') {\n this.ripples.forEach((ref) => ref.fromKeyboard && this.release(ref));\n }\n }\n\n releasePointerRipples(): void {\n this.ripples.forEach((ref) => !ref.fromKeyboard && this.release(ref));\n }\n\n releaseAll(): void {\n this.ripples.forEach((ref) => this.release(ref));\n }\n\n private launch(clientX: number, clientY: number, fromKeyboard: boolean): void {\n const host = this.elementRef.nativeElement;\n if (!this.isEnabled() || host.matches(':disabled, [aria-disabled=\"true\"]') || typeof host.animate !== 'function') {\n return;\n }\n this.txStyleLoader.load(TxRippleStyles);\n\n const rect = host.getBoundingClientRect();\n const centered = fromKeyboard || this.rippleCentered();\n const x = centered ? rect.width / 2 : clientX - rect.left;\n const y = centered ? rect.height / 2 : clientY - rect.top;\n const radius = Math.hypot(Math.max(x, rect.width - x), Math.max(y, rect.height - y));\n\n const element = this.document.createElement('span');\n element.className = 'tx-ripple';\n element.style.width = element.style.height = `${radius * 2}px`;\n element.style.left = `${x - radius}px`;\n element.style.top = `${y - radius}px`;\n this.coverBorder(this.ensureContainer(), host).appendChild(element);\n\n const ref: TxRippleRef = { element, isEntered: false, isReleased: false, fromKeyboard };\n this.ripples.add(ref);\n\n const styles = getComputedStyle(host);\n const reduceMotion = this.document.defaultView?.matchMedia('(prefers-reduced-motion: reduce)').matches;\n const enter = element.animate(\n reduceMotion ? [{ transform: 'scale(1)', opacity: 0 }, { transform: 'scale(1)' }] : [{ transform: 'scale(0)' }, { transform: 'scale(1)' }],\n {\n duration: this.readDuration(styles, '--tx-ripple-enter-duration', 450) * (centered ? 0.8 : 1),\n easing: styles.getPropertyValue('--tx-ripple-easing').trim() || 'cubic-bezier(0.2, 0, 0, 1)',\n fill: 'forwards',\n },\n );\n enter.finished.then(() => {\n ref.isEntered = true;\n if (ref.isReleased) {\n this.fadeOut(ref, styles);\n }\n }, () => this.remove(ref));\n }\n\n private release(ref: TxRippleRef): void {\n if (ref.isReleased) {\n return;\n }\n ref.isReleased = true;\n if (ref.isEntered) {\n this.fadeOut(ref, getComputedStyle(this.elementRef.nativeElement));\n }\n }\n\n private fadeOut(ref: TxRippleRef, styles: CSSStyleDeclaration): void {\n const opacity = getComputedStyle(ref.element).opacity;\n ref.element\n .animate([{ opacity }, { opacity: 0 }], {\n duration: this.readDuration(styles, '--tx-ripple-exit-duration', 350),\n easing: 'ease-out',\n fill: 'forwards',\n })\n .finished.then(() => this.remove(ref), () => this.remove(ref));\n }\n\n private remove(ref: TxRippleRef): void {\n ref.element.remove();\n this.ripples.delete(ref);\n }\n\n private ensureContainer(): HTMLElement {\n const host = this.elementRef.nativeElement;\n if (!this.container || this.container.parentElement !== host) {\n this.container = this.document.createElement('span');\n this.container.className = 'tx-ripple-container';\n this.container.setAttribute('aria-hidden', 'true');\n host.appendChild(this.container);\n }\n return this.container;\n }\n\n private coverBorder(container: HTMLElement, host: HTMLElement): HTMLElement {\n const styles = getComputedStyle(host);\n container.style.top = `-${styles.borderTopWidth}`;\n container.style.right = `-${styles.borderRightWidth}`;\n container.style.bottom = `-${styles.borderBottomWidth}`;\n container.style.left = `-${styles.borderLeftWidth}`;\n return container;\n }\n\n private readDuration(styles: CSSStyleDeclaration, name: string, fallback: number): number {\n const value = styles.getPropertyValue(name).trim();\n const number = parseFloat(value);\n if (Number.isNaN(number)) {\n return fallback;\n }\n return value.endsWith('ms') ? number : number * 1000;\n }\n}\n"],"mappings":";;;;;AAkCA,IAAa,iBAAb,MAAa,eAAc;CAAd,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAc,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAd,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAc,cAAA;EAAA,UAAA;EAAA,UAAA;EAAA,UA9Bf;EAAE,UAAA;EAAA,QAAA,CA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IAAA,SAAA;IAAA,QAAA;GAAA;GAAA,YAAA;IAAA,wBAAA;IAAA,2BAAA;GAAA;EAAA;EAAA,UAAA;CAAA,CAAA;;AAAR,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAQ,YAAA,CAAA;EAdpB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM;IACJ,0BAA0B;IAC1B,6BAA6B;IAC7B,iBAAiB;IACjB,eAAe;IACf,kBAAkB;IAClB,mBAAmB;IACnB,aAAa;IACb,WAAW;IACX,UAAU;GACX;EACF,CAAA"}
1
+ {"version":3,"file":"tectra-ng-core-ripple.mjs","names":[],"sources":["../../../../packages/core/ripple/src/ripple.styles.ts","../../../../packages/core/ripple/src/ripple.directive.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'tx-ripple-styles',\n template: '',\n styles: `\n .tx-ripple-host {\n position: relative;\n isolation: isolate;\n -webkit-tap-highlight-color: transparent;\n }\n\n .tx-ripple-container {\n position: absolute;\n inset: 0;\n z-index: -1;\n overflow: hidden;\n border-radius: inherit;\n pointer-events: none;\n }\n\n .tx-ripple {\n position: absolute;\n border-radius: 50%;\n background: var(--tx-ripple-color, currentColor);\n opacity: var(--tx-ripple-opacity, 0.2);\n transform: scale(0);\n pointer-events: none;\n will-change: transform, opacity;\n }\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TxRippleStyles {}\n","import { DOCUMENT, Directive, ElementRef, booleanAttribute, computed, inject, input } from '@angular/core';\nimport { TxThemeService } from '@tectra-ng/core/config';\nimport { TxStyleLoader } from '@tectra-ng/core/styles';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TxRippleStyles } from './ripple.styles';\nimport { TxRippleRef } from './ripple.types';\n\n@Directive({\n selector: '[txRipple]',\n host: {\n '[class.tx-ripple-host]': 'isEnabled()',\n '[style.--tx-ripple-color]': 'rippleColor() ?? null',\n '(pointerdown)': 'onPointerDown($event)',\n '(pointerup)': 'releasePointerRipples()',\n '(pointerleave)': 'releasePointerRipples()',\n '(pointercancel)': 'releasePointerRipples()',\n '(keydown)': 'onKeyDown($event)',\n '(keyup)': 'onKeyUp($event)',\n '(blur)': 'releaseAll()',\n },\n})\nexport class TxRipple {\n private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private document = inject(DOCUMENT);\n private txThemeService = inject(TxThemeService);\n private txStyleLoader = inject(TxStyleLoader);\n private ripples = new Set<TxRippleRef>();\n private container: HTMLElement | null = null;\n\n readonly ripple = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n readonly rippleDisabled = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly rippleCentered = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly rippleColor = input<string | undefined>(undefined);\n\n readonly isEnabled = computed(() => !this.rippleDisabled() && (this.ripple() ?? this.txThemeService.ripple()));\n\n onPointerDown(event: PointerEvent): void {\n if (event.button === 0 && !event.defaultPrevented) {\n this.launch(event.clientX, event.clientY, false);\n }\n }\n\n onKeyDown(event: KeyboardEvent): void {\n if ((event.key === 'Enter' || event.key === ' ') && !event.repeat) {\n this.launch(0, 0, true);\n }\n }\n\n onKeyUp(event: KeyboardEvent): void {\n if (event.key === 'Enter' || event.key === ' ') {\n this.ripples.forEach((ref) => ref.fromKeyboard && this.release(ref));\n }\n }\n\n releasePointerRipples(): void {\n this.ripples.forEach((ref) => !ref.fromKeyboard && this.release(ref));\n }\n\n releaseAll(): void {\n this.ripples.forEach((ref) => this.release(ref));\n }\n\n private launch(clientX: number, clientY: number, fromKeyboard: boolean): void {\n const host = this.elementRef.nativeElement;\n if (!this.isEnabled() || host.matches(':disabled, [aria-disabled=\"true\"]') || typeof host.animate !== 'function') {\n return;\n }\n this.txStyleLoader.load(TxRippleStyles);\n\n const rect = host.getBoundingClientRect();\n const centered = fromKeyboard || this.rippleCentered();\n const x = centered ? rect.width / 2 : clientX - rect.left;\n const y = centered ? rect.height / 2 : clientY - rect.top;\n const radius = Math.hypot(Math.max(x, rect.width - x), Math.max(y, rect.height - y));\n\n const element = this.document.createElement('span');\n element.className = 'tx-ripple';\n element.style.width = element.style.height = `${radius * 2}px`;\n element.style.left = `${x - radius}px`;\n element.style.top = `${y - radius}px`;\n this.coverBorder(this.ensureContainer(), host).appendChild(element);\n\n const ref: TxRippleRef = { element, isEntered: false, isReleased: false, fromKeyboard };\n this.ripples.add(ref);\n\n const styles = getComputedStyle(host);\n const reduceMotion = this.document.defaultView?.matchMedia('(prefers-reduced-motion: reduce)').matches;\n const enter = element.animate(\n reduceMotion ? [{ transform: 'scale(1)', opacity: 0 }, { transform: 'scale(1)' }] : [{ transform: 'scale(0)' }, { transform: 'scale(1)' }],\n {\n duration: this.readDuration(styles, '--tx-ripple-enter-duration', 450) * (centered ? 0.8 : 1),\n easing: styles.getPropertyValue('--tx-ripple-easing').trim() || 'cubic-bezier(0.2, 0, 0, 1)',\n fill: 'forwards',\n },\n );\n enter.finished.then(() => {\n ref.isEntered = true;\n if (ref.isReleased) {\n this.fadeOut(ref, styles);\n }\n }, () => this.remove(ref));\n }\n\n private release(ref: TxRippleRef): void {\n if (ref.isReleased) {\n return;\n }\n ref.isReleased = true;\n if (ref.isEntered) {\n this.fadeOut(ref, getComputedStyle(this.elementRef.nativeElement));\n }\n }\n\n private fadeOut(ref: TxRippleRef, styles: CSSStyleDeclaration): void {\n const opacity = getComputedStyle(ref.element).opacity;\n ref.element\n .animate([{ opacity }, { opacity: 0 }], {\n duration: this.readDuration(styles, '--tx-ripple-exit-duration', 350),\n easing: 'ease-out',\n fill: 'forwards',\n })\n .finished.then(() => this.remove(ref), () => this.remove(ref));\n }\n\n private remove(ref: TxRippleRef): void {\n ref.element.remove();\n this.ripples.delete(ref);\n }\n\n private ensureContainer(): HTMLElement {\n const host = this.elementRef.nativeElement;\n if (!this.container || this.container.parentElement !== host) {\n this.container = this.document.createElement('span');\n this.container.className = 'tx-ripple-container';\n this.container.setAttribute('aria-hidden', 'true');\n host.appendChild(this.container);\n }\n return this.container;\n }\n\n private coverBorder(container: HTMLElement, host: HTMLElement): HTMLElement {\n const styles = getComputedStyle(host);\n container.style.top = `-${styles.borderTopWidth}`;\n container.style.right = `-${styles.borderRightWidth}`;\n container.style.bottom = `-${styles.borderBottomWidth}`;\n container.style.left = `-${styles.borderLeftWidth}`;\n return container;\n }\n\n private readDuration(styles: CSSStyleDeclaration, name: string, fallback: number): number {\n const value = styles.getPropertyValue(name).trim();\n const number = parseFloat(value);\n if (Number.isNaN(number)) {\n return fallback;\n }\n return value.endsWith('ms') ? number : number * 1000;\n }\n}\n"],"mappings":";;;;;AAkCA,IAAa,iBAAb,MAAa,eAAc;CAAd,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAc,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAd,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAc,cAAA;EAAA,UAAA;EAAA,UAAA;EAAA,UA9Bf;EAAE,UAAA;EAAA,QAAA,CAAA,6ZAAA;EAAA,iBAAA,GAAA,wBAAA;EAAA,eAAA,GAAA,kBAAA;CAAA,CAAA;;AA8BD,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAc,YAAA,CAAA;EAhC1B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAkB,UAClB;GAAE,eA2BG,kBAAkB;GAAI,iBACpB,wBAAwB;GAAM,QAAA,CAAA,6ZAAA;EAAA,CAAA;;;ACXjD,IAAa,WAAb,MAAa,SAAQ;CACX,aAAa,OAAgC,UAAU;CACvD,WAAW,OAAO,QAAQ;CAC1B,iBAAiB,OAAO,cAAc;CACtC,gBAAgB,OAAO,aAAa;CACpC,0BAAU,IAAI,IAAG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ectra core for Angular: provideTectra, overlay, accessibility helpers, forms, locale and styles.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://tectra-ng.com",
@@ -95,6 +95,10 @@ export interface TxTranslations {
95
95
  tableActions: string;
96
96
  tableActionsHint: string;
97
97
  rowActions: string;
98
+ nodeActions: string;
99
+ listView: string;
100
+ gridView: string;
101
+ layout: string;
98
102
  selectRow: string;
99
103
  expandRow: string;
100
104
  collapseRow: string;
@@ -171,7 +175,9 @@ export declare class TxThemeService {
171
175
  private config;
172
176
  readonly preset: import("@angular/core").WritableSignal<TectraPreset | null>;
173
177
  readonly mode: import("@angular/core").WritableSignal<TxThemeMode>;
178
+ readonly ripple: import("@angular/core").WritableSignal<boolean>;
174
179
  applyPreset(preset: TectraPreset): void;
180
+ setRipple(enabled: boolean): void;
175
181
  setMode(mode: TxThemeMode): void;
176
182
  toggleMode(): void;
177
183
  static ɵfac: i0.ɵɵFactoryDeclaration<TxThemeService, never>;
@@ -1 +1 @@
1
- {"version":3,"file":"tectra-ng-core-config.d.ts","names":[],"sources":["../../../../packages/core/config/src/pass-through.interface.ts","../../../../packages/core/config/src/tectra-config.interface.ts","../../../../packages/core/config/src/provide-tectra.ts","../../../../packages/core/config/src/component-config.ts","../../../../packages/core/config/src/tectra-config.token.ts","../../../../packages/core/config/src/theme.service.ts"],"mappings":";;;iBAAiB;EACf;EACA,QAAQ;;iBAGO,qBAAqB;EACpC,UAAU;;YAGA,mBAAmB,aAC3B,sBACE,SAAS,qBAAqB,eAAe;YAEvC,cAAc,sBAAsB,qBAAqB,QAAQ,OAAO,OAAO,mBAAmB;YAElG,sBAAsB,wBAAwB,QAAQ,OAAO,OAAO;iBAE/D;EACf;EACA;;YAGU,sBAAsB,eAAe,eAAe;YCnBpD;iBAEK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;YAGU,iCAAiC;YACjC,uBAAuB,eAAe;iBAEjC;EACf;EACA;EACA;EACA,cAAc;;YAGJ;iBAEK;EACf;EACA;;iBAGe;EACf,iBAAiB;;iBAGF;EACf,QAAQ;EACR,OAAO;EACP;EACA;EACA;EACA,KAAK;EACL,YAAY;EACZ,SAAS,eAAe;EACxB,eAAe,QAAQ;EACvB,UAAU;EACV,qBAAqB;;wBCrJP,cAAc,QAAQ,eAAe;wBCKrC,eAAe,OAAO,8BAA8B;wBAgBpD,kBAAkB,sBAAsB,WACtD,mBACA,UAAU,WACV,OAAO,OAAO,cAAc,OAAO,yBACnC,cAAc,OAAO,oCACpB,OAAO,sBAAsB;qBC5BnB,eAAa,eAAA;qBCGb;UACH;UACA;WAEC,gCAAM,eAAA;WACN,8BAAI,eAAA;EAEb,YAAY,QAAQ;EAUpB,QAAQ,MAAM;EAKd;SAtBW,MAAA,GAAA,qBAAA"}
1
+ {"version":3,"file":"tectra-ng-core-config.d.ts","names":[],"sources":["../../../../packages/core/config/src/pass-through.interface.ts","../../../../packages/core/config/src/tectra-config.interface.ts","../../../../packages/core/config/src/provide-tectra.ts","../../../../packages/core/config/src/component-config.ts","../../../../packages/core/config/src/tectra-config.token.ts","../../../../packages/core/config/src/theme.service.ts"],"mappings":";;;iBAAiB;EACf;EACA,QAAQ;;iBAGO,qBAAqB;EACpC,UAAU;;YAGA,mBAAmB,aAC3B,sBACE,SAAS,qBAAqB,eAAe;YAEvC,cAAc,sBAAsB,qBAAqB,QAAQ,OAAO,OAAO,mBAAmB;YAElG,sBAAsB,wBAAwB,QAAQ,OAAO,OAAO;iBAE/D;EACf;EACA;;YAGU,sBAAsB,eAAe,eAAe;YCnBpD;iBAEK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;YAGU,iCAAiC;YACjC,uBAAuB,eAAe;iBAEjC;EACf;EACA;EACA;EACA,cAAc;;YAGJ;iBAEK;EACf;EACA;;iBAGe;EACf,iBAAiB;;iBAGF;EACf,QAAQ;EACR,OAAO;EACP;EACA;EACA;EACA,KAAK;EACL,YAAY;EACZ,SAAS,eAAe;EACxB,eAAe,QAAQ;EACvB,UAAU;EACV,qBAAqB;;wBCzJP,cAAc,QAAQ,eAAe;wBCKrC,eAAe,OAAO,8BAA8B;wBAgBpD,kBAAkB,sBAAsB,WACtD,mBACA,UAAU,WACV,OAAO,OAAO,cAAc,OAAO,yBACnC,cAAc,OAAO,oCACpB,OAAO,sBAAsB;qBC5BnB,eAAa,eAAA;qBCGb;UACH;UACA;WAEC,gCAAM,eAAA;WACN,8BAAI,eAAA;WACJ,gCAAM;EAEf,YAAY,QAAQ;EAUpB,UAAU;EAIV,QAAQ,MAAM;EAKd;SA3BW,MAAA,GAAA,qBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"tectra-ng-core-i18n.d.ts","names":[],"sources":["../../../../packages/core/i18n/src/locales.ts","../../../../packages/core/i18n/src/locale.service.ts","../../../../packages/core/i18n/src/translations.ts"],"mappings":";;;qBAEa,cAAc;qBA0Hd,cAAc;qBA0Hd,YAAY,eAAe;qBCjP3B;UACH;WAEC,gCAAM,eAAA;WACN,sCAAY,OAAA;EAErB,UAAU,QAAQ,eAAe;EAIjC,UAAU,WAAW,gBAAgB,SAAQ;EAI7C,aAAa,eAAe,UAAU,KAAK;EAI3C,WAAW,OAAO,eAAe,UAAU,KAAK;EAIhD,WAAW;EAKX,aAAa;UAML;SAjCG,MAAA,GAAA,qBAAA;;;wBCDG,sBAAsB,OAAO"}
1
+ {"version":3,"file":"tectra-ng-core-i18n.d.ts","names":[],"sources":["../../../../packages/core/i18n/src/locales.ts","../../../../packages/core/i18n/src/locale.service.ts","../../../../packages/core/i18n/src/translations.ts"],"mappings":";;;qBAEa,cAAc;qBA8Hd,cAAc;qBA8Hd,YAAY,eAAe;qBCzP3B;UACH;WAEC,gCAAM,eAAA;WACN,sCAAY,OAAA;EAErB,UAAU,QAAQ,eAAe;EAIjC,UAAU,WAAW,gBAAgB,SAAQ;EAI7C,aAAa,eAAe,UAAU,KAAK;EAI3C,WAAW,OAAO,eAAe,UAAU,KAAK;EAIhD,WAAW;EAKX,aAAa;UAML;SAjCG,MAAA,GAAA,qBAAA;;;wBCDG,sBAAsB,OAAO"}
@@ -2,7 +2,7 @@ import * as i0 from "@angular/core";
2
2
  export declare class TxRipple {
3
3
  private elementRef;
4
4
  private document;
5
- private config;
5
+ private txThemeService;
6
6
  private txStyleLoader;
7
7
  private ripples;
8
8
  private container;