@spartan-ng/brain 0.0.1-alpha.452 → 0.0.1-alpha.454

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.
@@ -65,7 +65,9 @@ export interface BrnDateAdapter<T> {
65
65
  */
66
66
  getDate(date: T): number;
67
67
  /**
68
- * Get the day.
68
+ * Get the day of the week.
69
+ *
70
+ * Returns a value between 0 and 6 where 0 is Sunday
69
71
  */
70
72
  getDay(date: T): number;
71
73
  /**
@@ -50,7 +50,9 @@ class BrnLuxonDateAdapter {
50
50
  return date.day;
51
51
  }
52
52
  getDay(date) {
53
- return date.weekday;
53
+ // Adjust the range, Luxon calculates week days starting with Monday 1 to Sunday 7
54
+ // , and we should return Sunday 0 to Saturday 6
55
+ return date.weekday % 7;
54
56
  }
55
57
  getHours(date) {
56
58
  return date.hour;
@@ -1 +1 @@
1
- {"version":3,"file":"spartan-ng-brain-date-time-luxon.mjs","sources":["../../../../libs/brain/date-time-luxon/src/lib/date-adapter.ts","../../../../libs/brain/date-time-luxon/src/spartan-ng-brain-date-time-luxon.ts"],"sourcesContent":["import { BrnDateAdapter, BrnDateUnits, BrnDuration } from '@spartan-ng/brain/date-time';\nimport { DateTime } from 'luxon';\n\nexport class BrnLuxonDateAdapter implements BrnDateAdapter<DateTime> {\n\tnow() {\n\t\treturn DateTime.now();\n\t}\n\n\tset(date: DateTime, values: BrnDateUnits) {\n\t\treturn date.set(values);\n\t}\n\n\tadd(date: DateTime, duration: BrnDuration) {\n\t\treturn date.plus(duration);\n\t}\n\n\tsubtract(date: DateTime, duration: BrnDuration) {\n\t\treturn date.minus(duration);\n\t}\n\n\tcompare(a: DateTime, b: DateTime): number {\n\t\tif (a < b) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tif (a > b) {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tisEqual(a: DateTime, b: DateTime): boolean {\n\t\treturn a.equals(b);\n\t}\n\n\tisBefore(a: DateTime, b: DateTime): boolean {\n\t\treturn a < b;\n\t}\n\n\tisAfter(a: DateTime, b: DateTime): boolean {\n\t\treturn a > b;\n\t}\n\n\tisSameDay(a: DateTime, b: DateTime): boolean {\n\t\treturn a.hasSame(b, 'day') && a.hasSame(b, 'month') && a.hasSame(b, 'year');\n\t}\n\n\tisSameMonth(a: DateTime, b: DateTime): boolean {\n\t\treturn a.hasSame(b, 'month') && a.hasSame(b, 'year');\n\t}\n\n\tisSameYear(a: DateTime, b: DateTime): boolean {\n\t\treturn a.hasSame(b, 'year');\n\t}\n\n\tgetYear(date: DateTime): number {\n\t\treturn date.year;\n\t}\n\n\tgetMonth(date: DateTime): number {\n\t\treturn date.month;\n\t}\n\n\tgetDate(date: DateTime): number {\n\t\treturn date.day;\n\t}\n\n\tgetDay(date: DateTime): number {\n\t\treturn date.weekday;\n\t}\n\n\tgetHours(date: DateTime): number {\n\t\treturn date.hour;\n\t}\n\n\tgetMinutes(date: DateTime): number {\n\t\treturn date.minute;\n\t}\n\n\tgetSeconds(date: DateTime): number {\n\t\treturn date.second;\n\t}\n\n\tgetMilliseconds(date: DateTime): number {\n\t\treturn date.millisecond;\n\t}\n\n\tgetTime(date: DateTime<boolean>): number {\n\t\treturn date.toMillis();\n\t}\n\n\tstartOfMonth(date: DateTime) {\n\t\treturn date.startOf('month');\n\t}\n\n\tendOfMonth(date: DateTime) {\n\t\treturn date.endOf('month');\n\t}\n\n\tstartOfDay(date: DateTime) {\n\t\treturn date.startOf('day');\n\t}\n\n\tendOfDay(date: DateTime) {\n\t\treturn date.endOf('day');\n\t}\n\n\tcreate(values: BrnDateUnits) {\n\t\treturn DateTime.fromObject(values);\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;MAGa,mBAAmB,CAAA;IAC/B,GAAG,GAAA;AACF,QAAA,OAAO,QAAQ,CAAC,GAAG,EAAE;;IAGtB,GAAG,CAAC,IAAc,EAAE,MAAoB,EAAA;AAC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,OAAO,IAAI,CAAC,IAAI;;AAGjB,IAAA,QAAQ,CAAC,IAAc,EAAA;QACtB,OAAO,IAAI,CAAC,KAAK;;AAGlB,IAAA,OAAO,CAAC,IAAc,EAAA;QACrB,OAAO,IAAI,CAAC,GAAG;;AAGhB,IAAA,MAAM,CAAC,IAAc,EAAA;QACpB,OAAO,IAAI,CAAC,OAAO;;AAGpB,IAAA,QAAQ,CAAC,IAAc,EAAA;QACtB,OAAO,IAAI,CAAC,IAAI;;AAGjB,IAAA,UAAU,CAAC,IAAc,EAAA;QACxB,OAAO,IAAI,CAAC,MAAM;;AAGnB,IAAA,UAAU,CAAC,IAAc,EAAA;QACxB,OAAO,IAAI,CAAC,MAAM;;AAGnB,IAAA,eAAe,CAAC,IAAc,EAAA;QAC7B,OAAO,IAAI,CAAC,WAAW;;AAGxB,IAAA,OAAO,CAAC,IAAuB,EAAA;AAC9B,QAAA,OAAO,IAAI,CAAC,QAAQ,EAAE;;AAGvB,IAAA,YAAY,CAAC,IAAc,EAAA;AAC1B,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;;AAG7B,IAAA,UAAU,CAAC,IAAc,EAAA;AACxB,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;;AAG3B,IAAA,UAAU,CAAC,IAAc,EAAA;AACxB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;;AAG3B,IAAA,QAAQ,CAAC,IAAc,EAAA;AACtB,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;;AAGzB,IAAA,MAAM,CAAC,MAAoB,EAAA;AAC1B,QAAA,OAAO,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC;;AAEnC;;AC/GD;;AAEG;;;;"}
1
+ {"version":3,"file":"spartan-ng-brain-date-time-luxon.mjs","sources":["../../../../libs/brain/date-time-luxon/src/lib/date-adapter.ts","../../../../libs/brain/date-time-luxon/src/spartan-ng-brain-date-time-luxon.ts"],"sourcesContent":["import { BrnDateAdapter, BrnDateUnits, BrnDuration } from '@spartan-ng/brain/date-time';\nimport { DateTime } from 'luxon';\n\nexport class BrnLuxonDateAdapter implements BrnDateAdapter<DateTime> {\n\tnow() {\n\t\treturn DateTime.now();\n\t}\n\n\tset(date: DateTime, values: BrnDateUnits) {\n\t\treturn date.set(values);\n\t}\n\n\tadd(date: DateTime, duration: BrnDuration) {\n\t\treturn date.plus(duration);\n\t}\n\n\tsubtract(date: DateTime, duration: BrnDuration) {\n\t\treturn date.minus(duration);\n\t}\n\n\tcompare(a: DateTime, b: DateTime): number {\n\t\tif (a < b) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tif (a > b) {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tisEqual(a: DateTime, b: DateTime): boolean {\n\t\treturn a.equals(b);\n\t}\n\n\tisBefore(a: DateTime, b: DateTime): boolean {\n\t\treturn a < b;\n\t}\n\n\tisAfter(a: DateTime, b: DateTime): boolean {\n\t\treturn a > b;\n\t}\n\n\tisSameDay(a: DateTime, b: DateTime): boolean {\n\t\treturn a.hasSame(b, 'day') && a.hasSame(b, 'month') && a.hasSame(b, 'year');\n\t}\n\n\tisSameMonth(a: DateTime, b: DateTime): boolean {\n\t\treturn a.hasSame(b, 'month') && a.hasSame(b, 'year');\n\t}\n\n\tisSameYear(a: DateTime, b: DateTime): boolean {\n\t\treturn a.hasSame(b, 'year');\n\t}\n\n\tgetYear(date: DateTime): number {\n\t\treturn date.year;\n\t}\n\n\tgetMonth(date: DateTime): number {\n\t\treturn date.month;\n\t}\n\n\tgetDate(date: DateTime): number {\n\t\treturn date.day;\n\t}\n\n\tgetDay(date: DateTime): number {\n\t\t// Adjust the range, Luxon calculates week days starting with Monday 1 to Sunday 7\n\t\t// , and we should return Sunday 0 to Saturday 6\n\t\treturn date.weekday % 7;\n\t}\n\n\tgetHours(date: DateTime): number {\n\t\treturn date.hour;\n\t}\n\n\tgetMinutes(date: DateTime): number {\n\t\treturn date.minute;\n\t}\n\n\tgetSeconds(date: DateTime): number {\n\t\treturn date.second;\n\t}\n\n\tgetMilliseconds(date: DateTime): number {\n\t\treturn date.millisecond;\n\t}\n\n\tgetTime(date: DateTime<boolean>): number {\n\t\treturn date.toMillis();\n\t}\n\n\tstartOfMonth(date: DateTime) {\n\t\treturn date.startOf('month');\n\t}\n\n\tendOfMonth(date: DateTime) {\n\t\treturn date.endOf('month');\n\t}\n\n\tstartOfDay(date: DateTime) {\n\t\treturn date.startOf('day');\n\t}\n\n\tendOfDay(date: DateTime) {\n\t\treturn date.endOf('day');\n\t}\n\n\tcreate(values: BrnDateUnits) {\n\t\treturn DateTime.fromObject(values);\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;MAGa,mBAAmB,CAAA;IAC/B,GAAG,GAAA;AACF,QAAA,OAAO,QAAQ,CAAC,GAAG,EAAE;;IAGtB,GAAG,CAAC,IAAc,EAAE,MAAoB,EAAA;AACvC,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;;IAGxB,GAAG,CAAC,IAAc,EAAE,QAAqB,EAAA;AACxC,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;;IAG3B,QAAQ,CAAC,IAAc,EAAE,QAAqB,EAAA;AAC7C,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;;IAG5B,OAAO,CAAC,CAAW,EAAE,CAAW,EAAA;AAC/B,QAAA,IAAI,CAAC,GAAG,CAAC,EAAE;YACV,OAAO,CAAC,CAAC;;AAGV,QAAA,IAAI,CAAC,GAAG,CAAC,EAAE;AACV,YAAA,OAAO,CAAC;;AAGT,QAAA,OAAO,CAAC;;IAGT,OAAO,CAAC,CAAW,EAAE,CAAW,EAAA;AAC/B,QAAA,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;;IAGnB,QAAQ,CAAC,CAAW,EAAE,CAAW,EAAA;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AAQ,EAAE;;AAGvB,IAAA,YAAY,CAAC,IAAc,EAAA;AAC1B,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;;AAG7B,IAAA,UAAU,CAAC,IAAc,EAAA;AACxB,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;;AAG3B,IAAA,UAAU,CAAC,IAAc,EAAA;AACxB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;;AAG3B,IAAA,QAAQ,CAAC,IAAc,EAAA;AACtB,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;;AAGzB,IAAA,MAAM,CAAC,MAAoB,EAAA;AAC1B,QAAA,OAAO,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC;;AAEnC;;ACjHD;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"spartan-ng-brain-date-time.mjs","sources":["../../../../libs/brain/date-time/src/lib/native-date-adapter.ts","../../../../libs/brain/date-time/src/lib/date-adapter.ts","../../../../libs/brain/date-time/src/spartan-ng-brain-date-time.ts"],"sourcesContent":["import type { BrnDateAdapter, BrnDateUnits, BrnDuration } from './date-adapter';\n\nexport class BrnNativeDateAdapter implements BrnDateAdapter<Date> {\n\t/**\n\t * Create a new date time object.\n\t */\n\tcreate({ day, hour, minute, month, second, year, millisecond }: BrnDateUnits): Date {\n\t\tconst now = new Date();\n\n\t\treturn new Date(\n\t\t\tyear ?? now.getFullYear(),\n\t\t\tmonth ?? now.getMonth(),\n\t\t\tday ?? now.getDate(),\n\t\t\thour ?? now.getHours(),\n\t\t\tminute ?? now.getMinutes(),\n\t\t\tsecond ?? now.getSeconds(),\n\t\t\tmillisecond ?? now.getMilliseconds(),\n\t\t);\n\t}\n\n\t/**\n\t * Create a new date with the current date and time.\n\t */\n\tnow(): Date {\n\t\treturn new Date();\n\t}\n\n\t/**\n\t * Set the year of the date time object based on a duration.\n\t */\n\tset(date: Date, values: BrnDateUnits): Date {\n\t\treturn new Date(\n\t\t\tvalues.year ?? date.getFullYear(),\n\t\t\tvalues.month ?? date.getMonth(),\n\t\t\tvalues.day ?? date.getDate(),\n\t\t\tvalues.hour ?? date.getHours(),\n\t\t\tvalues.minute ?? date.getMinutes(),\n\t\t\tvalues.second ?? date.getSeconds(),\n\t\t\tvalues.millisecond ?? date.getMilliseconds(),\n\t\t);\n\t}\n\n\t/**\n\t * Add a duration to the date time object.\n\t */\n\tadd(date: Date, duration: BrnDuration): Date {\n\t\treturn new Date(\n\t\t\tdate.getFullYear() + (duration.years ?? 0),\n\t\t\tdate.getMonth() + (duration.months ?? 0),\n\t\t\tdate.getDate() + (duration.days ?? 0),\n\t\t\tdate.getHours() + (duration.hours ?? 0),\n\t\t\tdate.getMinutes() + (duration.minutes ?? 0),\n\t\t\tdate.getSeconds() + (duration.seconds ?? 0),\n\t\t\tdate.getMilliseconds() + (duration.milliseconds ?? 0),\n\t\t);\n\t}\n\n\t/**\n\t * Subtract a duration from the date time object\n\t */\n\tsubtract(date: Date, duration: BrnDuration): Date {\n\t\treturn new Date(\n\t\t\tdate.getFullYear() - (duration.years ?? 0),\n\t\t\tdate.getMonth() - (duration.months ?? 0),\n\t\t\tdate.getDate() - (duration.days ?? 0),\n\t\t\tdate.getHours() - (duration.hours ?? 0),\n\t\t\tdate.getMinutes() - (duration.minutes ?? 0),\n\t\t\tdate.getSeconds() - (duration.seconds ?? 0),\n\t\t\tdate.getMilliseconds() - (duration.milliseconds ?? 0),\n\t\t);\n\t}\n\n\t/**\n\t * Compare two date time objects\n\t */\n\tcompare(a: Date, b: Date): number {\n\t\tconst diff = a.getTime() - b.getTime();\n\t\treturn diff === 0 ? 0 : diff > 0 ? 1 : -1;\n\t}\n\n\t/**\n\t * Determine if two date time objects are equal.\n\t */\n\tisEqual(a: Date, b: Date): boolean {\n\t\treturn a.getTime() === b.getTime();\n\t}\n\n\t/**\n\t * Determine if a date time object is before another.\n\t */\n\tisBefore(a: Date, b: Date): boolean {\n\t\treturn a.getTime() < b.getTime();\n\t}\n\n\t/**\n\t * Determine if a date time object is after another.\n\t */\n\tisAfter(a: Date, b: Date): boolean {\n\t\treturn a.getTime() > b.getTime();\n\t}\n\n\t/**\n\t * Determine if two date objects are on the same day.\n\t */\n\tisSameDay(a: Date, b: Date): boolean {\n\t\treturn this.isSameYear(a, b) && this.isSameMonth(a, b) && a.getDate() === b.getDate();\n\t}\n\n\t/**\n\t * Determine if two date objects are on the same month.\n\t */\n\tisSameMonth(a: Date, b: Date): boolean {\n\t\treturn this.isSameYear(a, b) && a.getMonth() === b.getMonth();\n\t}\n\n\t/**\n\t * Determine if two date objects are on the same year.\n\t */\n\tisSameYear(a: Date, b: Date): boolean {\n\t\treturn a.getFullYear() === b.getFullYear();\n\t}\n\n\t/**\n\t * Get the year.\n\t */\n\tgetYear(date: Date): number {\n\t\treturn date.getFullYear();\n\t}\n\n\t/**\n\t * Get the month.\n\t */\n\tgetMonth(date: Date): number {\n\t\treturn date.getMonth();\n\t}\n\n\t/**\n\t * Get the day.\n\t */\n\tgetDay(date: Date): number {\n\t\treturn date.getDay();\n\t}\n\n\t/**\n\t * Get the date.\n\t */\n\tgetDate(date: Date): number {\n\t\treturn date.getDate();\n\t}\n\n\t/**\n\t * Get the hours.\n\t */\n\tgetHours(date: Date): number {\n\t\treturn date.getHours();\n\t}\n\n\t/**\n\t * Get the minutes.\n\t */\n\tgetMinutes(date: Date): number {\n\t\treturn date.getMinutes();\n\t}\n\n\t/**\n\t * Get the seconds.\n\t */\n\tgetSeconds(date: Date): number {\n\t\treturn date.getSeconds();\n\t}\n\n\t/**\n\t * Get the milliseconds.\n\t */\n\tgetMilliseconds(date: Date): number {\n\t\treturn date.getMilliseconds();\n\t}\n\n\t/**\n\t * Get the first day of the month.\n\t */\n\tstartOfMonth(date: Date): Date {\n\t\treturn new Date(date.getFullYear(), date.getMonth(), 1);\n\t}\n\n\t/**\n\t * Get the last day of the month.\n\t */\n\tendOfMonth(date: Date): Date {\n\t\treturn new Date(date.getFullYear(), date.getMonth() + 1, 0);\n\t}\n\n\t/**\n\t * Get the start of the day.\n\t */\n\tstartOfDay(date: Date): Date {\n\t\treturn new Date(date.getFullYear(), date.getMonth(), date.getDate());\n\t}\n\n\t/**\n\t * Get the end of the day.\n\t */\n\tendOfDay(date: Date): Date {\n\t\treturn new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59, 999);\n\t}\n\n\t/**\n\t * Get the time.\n\t */\n\tgetTime(date: Date): number {\n\t\treturn date.getTime();\n\t}\n}\n","import { ClassProvider, InjectionToken, Type, inject } from '@angular/core';\nimport { BrnNativeDateAdapter } from './native-date-adapter';\n\n/**\n * An abstraction that can be used to create and modify date time objects\n * immutably regardless of the underlying implementation.\n */\nexport interface BrnDateAdapter<T> {\n\t/**\n\t * Create a new date time object.\n\t */\n\tcreate(values: BrnDateUnits): T;\n\n\t/**\n\t * Create a new date with the current date and time.\n\t */\n\tnow(): T;\n\n\t/**\n\t * Set the year of the date time object based on a duration.\n\t */\n\tset(date: T, values: BrnDateUnits): T;\n\n\t/**\n\t * Add a duration to the date time object.\n\t */\n\tadd(date: T, duration: BrnDuration): T;\n\n\t/**\n\t * Subtract a duration from the date time object.\n\t */\n\tsubtract(date: T, duration: BrnDuration): T;\n\n\t/**\n\t * Compare two date time objects.\n\t */\n\tcompare(a: T, b: T): number;\n\n\t/**\n\t * Determine if two date time objects are equal.\n\t */\n\tisEqual(a: T, b: T): boolean;\n\n\t/**\n\t * Determine if a date time object is before another.\n\t */\n\tisBefore(a: T, b: T): boolean;\n\n\t/**\n\t * Determine if a date time object is after another.\n\t */\n\tisAfter(a: T, b: T): boolean;\n\n\t/**\n\t * Determine if two date objects are on the same day.\n\t */\n\tisSameDay(a: T, b: T): boolean;\n\n\t/**\n\t * Determine if two date objects are on the same month.\n\t */\n\tisSameMonth(a: T, b: T): boolean;\n\n\t/**\n\t * Determine if two date objects are on the same year.\n\t */\n\tisSameYear(a: T, b: T): boolean;\n\n\t/**\n\t * Get the year.\n\t */\n\tgetYear(date: T): number;\n\n\t/**\n\t * Get the month.\n\t */\n\tgetMonth(date: T): number;\n\n\t/**\n\t * Get the date.\n\t */\n\tgetDate(date: T): number;\n\n\t/**\n\t * Get the day.\n\t */\n\tgetDay(date: T): number;\n\n\t/**\n\t * Get the hours.\n\t */\n\tgetHours(date: T): number;\n\n\t/**\n\t * Get the minutes.\n\t */\n\tgetMinutes(date: T): number;\n\n\t/**\n\t * Get the seconds.\n\t */\n\tgetSeconds(date: T): number;\n\n\t/**\n\t * Get the milliseconds.\n\t */\n\tgetMilliseconds(date: T): number;\n\n\t/**\n\t * Get the time.\n\t */\n\tgetTime(date: T): number;\n\n\t/**\n\t * Get the first day of the month.\n\t */\n\tstartOfMonth(date: T): T;\n\n\t/**\n\t * Get the last day of the month.\n\t */\n\tendOfMonth(date: T): T;\n\n\t/**\n\t * Get the start of the day.\n\t */\n\tstartOfDay(date: T): T;\n\n\t/**\n\t * Get the end of the day.\n\t */\n\tendOfDay(date: T): T;\n}\n\nexport interface BrnDateUnits {\n\t/**\n\t * The year.\n\t */\n\tyear?: number;\n\n\t/**\n\t * The month.\n\t */\n\tmonth?: number;\n\n\t/**\n\t * The day.\n\t */\n\tday?: number;\n\n\t/**\n\t * The hour.\n\t */\n\thour?: number;\n\n\t/**\n\t * The minute.\n\t */\n\tminute?: number;\n\n\t/**\n\t * The second.\n\t */\n\tsecond?: number;\n\n\t/**\n\t * The millisecond.\n\t */\n\tmillisecond?: number;\n}\n\nexport interface BrnDuration {\n\t/**\n\t * The years.\n\t */\n\tyears?: number;\n\n\t/**\n\t * The months.\n\t */\n\tmonths?: number;\n\n\t/**\n\t * The days.\n\t */\n\tdays?: number;\n\n\t/**\n\t * The hours.\n\t */\n\thours?: number;\n\n\t/**\n\t * The minutes.\n\t */\n\tminutes?: number;\n\n\t/**\n\t * The seconds.\n\t */\n\tseconds?: number;\n\n\t/**\n\t * The milliseconds.\n\t */\n\tmilliseconds?: number;\n}\n\nexport const BrnDateAdapterToken = new InjectionToken<BrnDateAdapter<unknown>>('BrnDateAdapterToken');\n\n/**\n * Inject the DateAdapter instance\n */\nexport function injectDateAdapter<T>(): BrnDateAdapter<T> {\n\treturn (inject(BrnDateAdapterToken, { optional: true }) as BrnDateAdapter<T>) ?? new BrnNativeDateAdapter();\n}\n\n/**\n * Provide the DateAdapter instance\n */\nexport function provideDateAdapter<T>(adapter: Type<BrnDateAdapter<T>>): ClassProvider {\n\treturn { provide: BrnDateAdapterToken, useClass: adapter };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;MAEa,oBAAoB,CAAA;AAChC;;AAEG;AACH,IAAA,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAgB,EAAA;AAC3E,QAAA,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE;QAEtB,OAAO,IAAI,IAAI,CACd,IAAI,IAAI,GAAG,CAAC,WAAW,EAAE,EACzB,KAAK,IAAI,GAAG,CAAC,QAAQ,EAAE,EACvB,GAAG,IAAI,GAAG,CAAC,OAAO,EAAE,EACpB,IAAI,IAAI,GAAG,CAAC,QAAQ,EAAE,EACtB,MAAM,IAAI,GAAG,CAAC,UAAU,EAAE,EAC1B,MAAM,IAAI,GAAG,CAAC,UAAU,EAAE,EAC1B,WAAW,IAAI,GAAG,CAAC,eAAe,EAAE,CACpC;;AAGF;;AAEG;IACH,GAAG,GAAA;QACF,OAAO,IAAI,IAAI,EAAE;;AAGlB;;AAEG;IACH,GAAG,CAAC,IAAU,EAAE,MAAoB,EAAA;AACnC,QAAA,OAAO,IAAI,IAAI,CACd,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,EAAE,EACjC,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,EAC/B,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,OAAO,EAAE,EA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AU,EAAA;AACpB,QAAA,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;;AAGrE;;AAEG;AACH,IAAA,QAAQ,CAAC,IAAU,EAAA;QAClB,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;;AAGtF;;AAEG;AACH,IAAA,OAAO,CAAC,IAAU,EAAA;AACjB,QAAA,OAAO,IAAI,CAAC,OAAO,EAAE;;AAEtB;;MCJY,mBAAmB,GAAG,IAAI,cAAc,CAA0B,qBAAqB;AAEpG;;AAEG;SACa,iBAAiB,GAAA;AAChC,IAAA,OAAQ,MAAM,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAuB,IAAI,IAAI,oBAAoB,EAAE;AAC5G;AAEA;;AAEG;AACG,SAAU,kBAAkB,CAAI,OAAgC,EAAA;IACrE,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,OAAO,EAAE;AAC3D;;AC9NA;;AAEG;;;;"}
1
+ {"version":3,"file":"spartan-ng-brain-date-time.mjs","sources":["../../../../libs/brain/date-time/src/lib/native-date-adapter.ts","../../../../libs/brain/date-time/src/lib/date-adapter.ts","../../../../libs/brain/date-time/src/spartan-ng-brain-date-time.ts"],"sourcesContent":["import type { BrnDateAdapter, BrnDateUnits, BrnDuration } from './date-adapter';\n\nexport class BrnNativeDateAdapter implements BrnDateAdapter<Date> {\n\t/**\n\t * Create a new date time object.\n\t */\n\tcreate({ day, hour, minute, month, second, year, millisecond }: BrnDateUnits): Date {\n\t\tconst now = new Date();\n\n\t\treturn new Date(\n\t\t\tyear ?? now.getFullYear(),\n\t\t\tmonth ?? now.getMonth(),\n\t\t\tday ?? now.getDate(),\n\t\t\thour ?? now.getHours(),\n\t\t\tminute ?? now.getMinutes(),\n\t\t\tsecond ?? now.getSeconds(),\n\t\t\tmillisecond ?? now.getMilliseconds(),\n\t\t);\n\t}\n\n\t/**\n\t * Create a new date with the current date and time.\n\t */\n\tnow(): Date {\n\t\treturn new Date();\n\t}\n\n\t/**\n\t * Set the year of the date time object based on a duration.\n\t */\n\tset(date: Date, values: BrnDateUnits): Date {\n\t\treturn new Date(\n\t\t\tvalues.year ?? date.getFullYear(),\n\t\t\tvalues.month ?? date.getMonth(),\n\t\t\tvalues.day ?? date.getDate(),\n\t\t\tvalues.hour ?? date.getHours(),\n\t\t\tvalues.minute ?? date.getMinutes(),\n\t\t\tvalues.second ?? date.getSeconds(),\n\t\t\tvalues.millisecond ?? date.getMilliseconds(),\n\t\t);\n\t}\n\n\t/**\n\t * Add a duration to the date time object.\n\t */\n\tadd(date: Date, duration: BrnDuration): Date {\n\t\treturn new Date(\n\t\t\tdate.getFullYear() + (duration.years ?? 0),\n\t\t\tdate.getMonth() + (duration.months ?? 0),\n\t\t\tdate.getDate() + (duration.days ?? 0),\n\t\t\tdate.getHours() + (duration.hours ?? 0),\n\t\t\tdate.getMinutes() + (duration.minutes ?? 0),\n\t\t\tdate.getSeconds() + (duration.seconds ?? 0),\n\t\t\tdate.getMilliseconds() + (duration.milliseconds ?? 0),\n\t\t);\n\t}\n\n\t/**\n\t * Subtract a duration from the date time object\n\t */\n\tsubtract(date: Date, duration: BrnDuration): Date {\n\t\treturn new Date(\n\t\t\tdate.getFullYear() - (duration.years ?? 0),\n\t\t\tdate.getMonth() - (duration.months ?? 0),\n\t\t\tdate.getDate() - (duration.days ?? 0),\n\t\t\tdate.getHours() - (duration.hours ?? 0),\n\t\t\tdate.getMinutes() - (duration.minutes ?? 0),\n\t\t\tdate.getSeconds() - (duration.seconds ?? 0),\n\t\t\tdate.getMilliseconds() - (duration.milliseconds ?? 0),\n\t\t);\n\t}\n\n\t/**\n\t * Compare two date time objects\n\t */\n\tcompare(a: Date, b: Date): number {\n\t\tconst diff = a.getTime() - b.getTime();\n\t\treturn diff === 0 ? 0 : diff > 0 ? 1 : -1;\n\t}\n\n\t/**\n\t * Determine if two date time objects are equal.\n\t */\n\tisEqual(a: Date, b: Date): boolean {\n\t\treturn a.getTime() === b.getTime();\n\t}\n\n\t/**\n\t * Determine if a date time object is before another.\n\t */\n\tisBefore(a: Date, b: Date): boolean {\n\t\treturn a.getTime() < b.getTime();\n\t}\n\n\t/**\n\t * Determine if a date time object is after another.\n\t */\n\tisAfter(a: Date, b: Date): boolean {\n\t\treturn a.getTime() > b.getTime();\n\t}\n\n\t/**\n\t * Determine if two date objects are on the same day.\n\t */\n\tisSameDay(a: Date, b: Date): boolean {\n\t\treturn this.isSameYear(a, b) && this.isSameMonth(a, b) && a.getDate() === b.getDate();\n\t}\n\n\t/**\n\t * Determine if two date objects are on the same month.\n\t */\n\tisSameMonth(a: Date, b: Date): boolean {\n\t\treturn this.isSameYear(a, b) && a.getMonth() === b.getMonth();\n\t}\n\n\t/**\n\t * Determine if two date objects are on the same year.\n\t */\n\tisSameYear(a: Date, b: Date): boolean {\n\t\treturn a.getFullYear() === b.getFullYear();\n\t}\n\n\t/**\n\t * Get the year.\n\t */\n\tgetYear(date: Date): number {\n\t\treturn date.getFullYear();\n\t}\n\n\t/**\n\t * Get the month.\n\t */\n\tgetMonth(date: Date): number {\n\t\treturn date.getMonth();\n\t}\n\n\t/**\n\t * Get the day.\n\t */\n\tgetDay(date: Date): number {\n\t\treturn date.getDay();\n\t}\n\n\t/**\n\t * Get the date.\n\t */\n\tgetDate(date: Date): number {\n\t\treturn date.getDate();\n\t}\n\n\t/**\n\t * Get the hours.\n\t */\n\tgetHours(date: Date): number {\n\t\treturn date.getHours();\n\t}\n\n\t/**\n\t * Get the minutes.\n\t */\n\tgetMinutes(date: Date): number {\n\t\treturn date.getMinutes();\n\t}\n\n\t/**\n\t * Get the seconds.\n\t */\n\tgetSeconds(date: Date): number {\n\t\treturn date.getSeconds();\n\t}\n\n\t/**\n\t * Get the milliseconds.\n\t */\n\tgetMilliseconds(date: Date): number {\n\t\treturn date.getMilliseconds();\n\t}\n\n\t/**\n\t * Get the first day of the month.\n\t */\n\tstartOfMonth(date: Date): Date {\n\t\treturn new Date(date.getFullYear(), date.getMonth(), 1);\n\t}\n\n\t/**\n\t * Get the last day of the month.\n\t */\n\tendOfMonth(date: Date): Date {\n\t\treturn new Date(date.getFullYear(), date.getMonth() + 1, 0);\n\t}\n\n\t/**\n\t * Get the start of the day.\n\t */\n\tstartOfDay(date: Date): Date {\n\t\treturn new Date(date.getFullYear(), date.getMonth(), date.getDate());\n\t}\n\n\t/**\n\t * Get the end of the day.\n\t */\n\tendOfDay(date: Date): Date {\n\t\treturn new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59, 999);\n\t}\n\n\t/**\n\t * Get the time.\n\t */\n\tgetTime(date: Date): number {\n\t\treturn date.getTime();\n\t}\n}\n","import { ClassProvider, InjectionToken, Type, inject } from '@angular/core';\nimport { BrnNativeDateAdapter } from './native-date-adapter';\n\n/**\n * An abstraction that can be used to create and modify date time objects\n * immutably regardless of the underlying implementation.\n */\nexport interface BrnDateAdapter<T> {\n\t/**\n\t * Create a new date time object.\n\t */\n\tcreate(values: BrnDateUnits): T;\n\n\t/**\n\t * Create a new date with the current date and time.\n\t */\n\tnow(): T;\n\n\t/**\n\t * Set the year of the date time object based on a duration.\n\t */\n\tset(date: T, values: BrnDateUnits): T;\n\n\t/**\n\t * Add a duration to the date time object.\n\t */\n\tadd(date: T, duration: BrnDuration): T;\n\n\t/**\n\t * Subtract a duration from the date time object.\n\t */\n\tsubtract(date: T, duration: BrnDuration): T;\n\n\t/**\n\t * Compare two date time objects.\n\t */\n\tcompare(a: T, b: T): number;\n\n\t/**\n\t * Determine if two date time objects are equal.\n\t */\n\tisEqual(a: T, b: T): boolean;\n\n\t/**\n\t * Determine if a date time object is before another.\n\t */\n\tisBefore(a: T, b: T): boolean;\n\n\t/**\n\t * Determine if a date time object is after another.\n\t */\n\tisAfter(a: T, b: T): boolean;\n\n\t/**\n\t * Determine if two date objects are on the same day.\n\t */\n\tisSameDay(a: T, b: T): boolean;\n\n\t/**\n\t * Determine if two date objects are on the same month.\n\t */\n\tisSameMonth(a: T, b: T): boolean;\n\n\t/**\n\t * Determine if two date objects are on the same year.\n\t */\n\tisSameYear(a: T, b: T): boolean;\n\n\t/**\n\t * Get the year.\n\t */\n\tgetYear(date: T): number;\n\n\t/**\n\t * Get the month.\n\t */\n\tgetMonth(date: T): number;\n\n\t/**\n\t * Get the date.\n\t */\n\tgetDate(date: T): number;\n\n\t/**\n\t * Get the day of the week.\n\t *\n\t * Returns a value between 0 and 6 where 0 is Sunday\n\t */\n\tgetDay(date: T): number;\n\n\t/**\n\t * Get the hours.\n\t */\n\tgetHours(date: T): number;\n\n\t/**\n\t * Get the minutes.\n\t */\n\tgetMinutes(date: T): number;\n\n\t/**\n\t * Get the seconds.\n\t */\n\tgetSeconds(date: T): number;\n\n\t/**\n\t * Get the milliseconds.\n\t */\n\tgetMilliseconds(date: T): number;\n\n\t/**\n\t * Get the time.\n\t */\n\tgetTime(date: T): number;\n\n\t/**\n\t * Get the first day of the month.\n\t */\n\tstartOfMonth(date: T): T;\n\n\t/**\n\t * Get the last day of the month.\n\t */\n\tendOfMonth(date: T): T;\n\n\t/**\n\t * Get the start of the day.\n\t */\n\tstartOfDay(date: T): T;\n\n\t/**\n\t * Get the end of the day.\n\t */\n\tendOfDay(date: T): T;\n}\n\nexport interface BrnDateUnits {\n\t/**\n\t * The year.\n\t */\n\tyear?: number;\n\n\t/**\n\t * The month.\n\t */\n\tmonth?: number;\n\n\t/**\n\t * The day.\n\t */\n\tday?: number;\n\n\t/**\n\t * The hour.\n\t */\n\thour?: number;\n\n\t/**\n\t * The minute.\n\t */\n\tminute?: number;\n\n\t/**\n\t * The second.\n\t */\n\tsecond?: number;\n\n\t/**\n\t * The millisecond.\n\t */\n\tmillisecond?: number;\n}\n\nexport interface BrnDuration {\n\t/**\n\t * The years.\n\t */\n\tyears?: number;\n\n\t/**\n\t * The months.\n\t */\n\tmonths?: number;\n\n\t/**\n\t * The days.\n\t */\n\tdays?: number;\n\n\t/**\n\t * The hours.\n\t */\n\thours?: number;\n\n\t/**\n\t * The minutes.\n\t */\n\tminutes?: number;\n\n\t/**\n\t * The seconds.\n\t */\n\tseconds?: number;\n\n\t/**\n\t * The milliseconds.\n\t */\n\tmilliseconds?: number;\n}\n\nexport const BrnDateAdapterToken = new InjectionToken<BrnDateAdapter<unknown>>('BrnDateAdapterToken');\n\n/**\n * Inject the DateAdapter instance\n */\nexport function injectDateAdapter<T>(): BrnDateAdapter<T> {\n\treturn (inject(BrnDateAdapterToken, { optional: true }) as BrnDateAdapter<T>) ?? new BrnNativeDateAdapter();\n}\n\n/**\n * Provide the DateAdapter instance\n */\nexport function provideDateAdapter<T>(adapter: Type<BrnDateAdapter<T>>): ClassProvider {\n\treturn { provide: BrnDateAdapterToken, useClass: adapter };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;MAEa,oBAAoB,CAAA;AAChC;;AAEG;AACH,IAAA,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAgB,EAAA;AAC3E,QAAA,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE;QAEtB,OAAO,IAAI,IAAI,CACd,IAAI,IAAI,GAAG,CAAC,WAAW,EAAE,EACzB,KAAK,IAAI,GAAG,CAAC,QAAQ,EAAE,EACvB,GAAG,IAAI,GAAG,CAAC,OAAO,EAAE,EACpB,IAAI,IAAI,GAAG,CAAC,QAAQ,EAAE,EACtB,MAAM,IAAI,GAAG,CAAC,UAAU,EAAE,EAC1B,MAAM,IAAI,GAAG,CAAC,UAAU,EAAE,EAC1B,WAAW,IAAI,GAAG,CAAC,eAA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${++BrnRadioComponent._nextUniqueId}`);
71
- inputId = computed(() => `${this.hostId()}-input`);
72
71
  inputElement = viewChild.required('input');
73
72
  constructor() {
74
73
  this._focusMonitor.monitor(this._elementRef, true);
@@ -122,22 +121,22 @@ class BrnRadioComponent {
122
121
  #input
123
122
  style="position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;"
124
123
  type="radio"
125
- [id]="inputId()"
124
+ [id]="id()"
126
125
  [checked]="checked()"
127
126
  [disabled]="disabledState()"
128
127
  [tabIndex]="tabIndex()"
129
128
  [attr.name]="radioGroup.name()"
130
129
  [attr.value]="value()"
131
130
  [required]="required()"
131
+ [attr.aria-checked]="checked()"
132
132
  [attr.aria-label]="ariaLabel()"
133
133
  [attr.aria-labelledby]="ariaLabelledby()"
134
134
  [attr.aria-describedby]="ariaDescribedby()"
135
+ [attr.aria-disabled]="disabledState()"
135
136
  (change)="onInputInteraction($event)"
136
137
  (click)="onInputClick($event)"
137
138
  />
138
- <label [for]="inputId()" data-slot="label">
139
- <ng-content />
140
- </label>
139
+ <ng-content />
141
140
  `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
142
141
  }
143
142
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnRadioComponent, decorators: [{
@@ -178,22 +177,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
178
177
  #input
179
178
  style="position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;"
180
179
  type="radio"
181
- [id]="inputId()"
180
+ [id]="id()"
182
181
  [checked]="checked()"
183
182
  [disabled]="disabledState()"
184
183
  [tabIndex]="tabIndex()"
185
184
  [attr.name]="radioGroup.name()"
186
185
  [attr.value]="value()"
187
186
  [required]="required()"
187
+ [attr.aria-checked]="checked()"
188
188
  [attr.aria-label]="ariaLabel()"
189
189
  [attr.aria-labelledby]="ariaLabelledby()"
190
190
  [attr.aria-describedby]="ariaDescribedby()"
191
+ [attr.aria-disabled]="disabledState()"
191
192
  (change)="onInputInteraction($event)"
192
193
  (click)="onInputClick($event)"
193
194
  />
194
- <label [for]="inputId()" data-slot="label">
195
- <ng-content />
196
- </label>
195
+ <ng-content />
197
196
  `,
198
197
  }]
199
198
  }], ctorParameters: () => [] });
@@ -1 +1 @@
1
- {"version":3,"file":"spartan-ng-brain-radio-group.mjs","sources":["../../../../libs/brain/radio-group/src/lib/brn-radio-group.token.ts","../../../../libs/brain/radio-group/src/lib/brn-radio.component.ts","../../../../libs/brain/radio-group/src/lib/brn-radio-group.directive.ts","../../../../libs/brain/radio-group/src/index.ts","../../../../libs/brain/radio-group/src/spartan-ng-brain-radio-group.ts"],"sourcesContent":["import { ExistingProvider, inject, InjectionToken, Type } from '@angular/core';\nimport type { BrnRadioGroupDirective } from './brn-radio-group.directive';\n\nconst BrnRadioGroupToken = new InjectionToken<BrnRadioGroupDirective<unknown>>('BrnRadioGroupToken');\n\nexport function provideBrnRadioGroupToken<T>(directive: Type<BrnRadioGroupDirective<T>>): ExistingProvider {\n\treturn { provide: BrnRadioGroupToken, useExisting: directive };\n}\n\nexport function injectBrnRadioGroup<T = unknown>(): BrnRadioGroupDirective<T> {\n\treturn inject(BrnRadioGroupToken) as BrnRadioGroupDirective<T>;\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport {\n\tChangeDetectionStrategy,\n\tComponent,\n\tElementRef,\n\ttype OnDestroy,\n\tViewEncapsulation,\n\tbooleanAttribute,\n\tcomputed,\n\tinject,\n\tinput,\n\toutput,\n\tviewChild,\n} from '@angular/core';\nimport { injectBrnRadioGroup } from './brn-radio-group.token';\n\nexport class BrnRadioChange<T> {\n\tconstructor(\n\t\tpublic source: BrnRadioComponent<T>,\n\t\tpublic value: T,\n\t) {}\n}\n\n@Component({\n\tselector: 'brn-radio',\n\tstandalone: true,\n\thost: {\n\t\tclass: 'brn-radio',\n\t\t'[attr.id]': 'hostId()',\n\t\t'[class.brn-radio-checked]': 'checked()',\n\t\t'[class.brn-radio-disabled]': 'disabledState()',\n\t\t'[attr.data-checked]': 'checked()',\n\t\t'[attr.data-disabled]': 'disabledState()',\n\t\t'[attr.data-value]': 'value()',\n\t\t// Needs to be removed since it causes some a11y issues (see #21266).\n\t\t'[attr.tabindex]': 'null',\n\t\t'[attr.aria-label]': 'null',\n\t\t'[attr.aria-labelledby]': 'null',\n\t\t'[attr.aria-describedby]': 'null',\n\t\t// Note: under normal conditions focus shouldn't land on this element, however it may be\n\t\t// programmatically set, for example inside of a focus trap, in this case we want to forward\n\t\t// the focus to the native element.\n\t\t'(focus)': 'inputElement().nativeElement.focus()',\n\t},\n\texportAs: 'brnRadio',\n\tencapsulation: ViewEncapsulation.None,\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\ttemplate: `\n\t\t<div\n\t\t\tdata-slot=\"indicator\"\n\t\t\tstyle=\"display: flex; height: fit-content; width: fit-content\"\n\t\t\t(click)=\"onTouchTargetClick($event)\"\n\t\t>\n\t\t\t<ng-content select=\"[target],[indicator]\" />\n\t\t</div>\n\t\t<input\n\t\t\t#input\n\t\t\tstyle=\"position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;\"\n\t\t\ttype=\"radio\"\n\t\t\t[id]=\"inputId()\"\n\t\t\t[checked]=\"checked()\"\n\t\t\t[disabled]=\"disabledState()\"\n\t\t\t[tabIndex]=\"tabIndex()\"\n\t\t\t[attr.name]=\"radioGroup.name()\"\n\t\t\t[attr.value]=\"value()\"\n\t\t\t[required]=\"required()\"\n\t\t\t[attr.aria-label]=\"ariaLabel()\"\n\t\t\t[attr.aria-labelledby]=\"ariaLabelledby()\"\n\t\t\t[attr.aria-describedby]=\"ariaDescribedby()\"\n\t\t\t(change)=\"onInputInteraction($event)\"\n\t\t\t(click)=\"onInputClick($event)\"\n\t\t/>\n\t\t<label [for]=\"inputId()\" data-slot=\"label\">\n\t\t\t<ng-content />\n\t\t</label>\n\t`,\n})\nexport class BrnRadioComponent<T = unknown> implements OnDestroy {\n\tprivate static _nextUniqueId = 0;\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\tprivate readonly _elementRef = inject(ElementRef);\n\tprotected readonly radioGroup = injectBrnRadioGroup<T>();\n\n\t/**\n\t * Whether the radio button is disabled.\n\t */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Whether the radio button is disabled or the radio group is disabled.\n\t */\n\tprotected readonly disabledState = computed(() => this.disabled() || this.radioGroup.disabledState());\n\n\t/**\n\t * Whether the radio button is checked.\n\t */\n\tprotected readonly checked = computed(() => this.radioGroup.value() === this.value());\n\n\tprotected readonly tabIndex = computed(() => {\n\t\tconst disabled = this.disabledState();\n\t\tconst checked = this.checked();\n\t\tconst hasSelectedRadio = this.radioGroup.value() !== undefined;\n\t\tconst isFirstRadio = this.radioGroup.radioButtons()[0] === this;\n\n\t\tif (disabled || (!checked && (hasSelectedRadio || !isFirstRadio))) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn 0;\n\t});\n\n\t/**\n\t * The unique ID for the radio button input. If none is supplied, it will be auto-generated.\n\t */\n\tpublic readonly id = input<string | undefined>(undefined);\n\n\tpublic readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' });\n\n\tpublic readonly ariaLabelledby = input<string | undefined>(undefined, { alias: 'aria-labelledby' });\n\n\tpublic readonly ariaDescribedby = input<string | undefined>(undefined, { alias: 'aria-describedby' });\n\n\t/**\n\t * The value this radio button represents.\n\t */\n\tpublic readonly value = input.required<T>();\n\n\t/**\n\t * Whether the radio button is required.\n\t */\n\tpublic readonly required = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * Event emitted when the checked state of this radio button changes.\n\t */\n\tpublic readonly change = output<BrnRadioChange<T>>();\n\n\tprotected readonly hostId = computed(() =>\n\t\tthis.id() ? this.id() : `brn-radio-${++BrnRadioComponent._nextUniqueId}`,\n\t);\n\n\tprotected readonly inputId = computed(() => `${this.hostId()}-input`);\n\n\tprotected readonly inputElement = viewChild.required<ElementRef<HTMLInputElement>>('input');\n\n\tconstructor() {\n\t\tthis._focusMonitor.monitor(this._elementRef, true);\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._focusMonitor.stopMonitoring(this._elementRef);\n\t}\n\n\t/** Dispatch change event with current value. */\n\tprivate emitChangeEvent(): void {\n\t\tthis.change.emit(new BrnRadioChange(this, this.value()));\n\t}\n\n\tprotected onInputClick(event: Event): void {\n\t\t// We have to stop propagation for click events on the visual hidden input element.\n\t\t// By default, when a user clicks on a label element, a generated click event will be\n\t\t// dispatched on the associated input element. Since we are using a label element as our\n\t\t// root container, the click event on the `radio-button` will be executed twice.\n\t\t// The real click event will bubble up, and the generated click event also tries to bubble up.\n\t\t// This will lead to multiple click events.\n\t\t// Preventing bubbling for the second event will solve that issue.\n\t\tevent.stopPropagation();\n\t}\n\n\tprotected onInputInteraction(event: Event): void {\n\t\t// We always have to stop propagation on the change event.\n\t\t// Otherwise the change event, from the input element, will bubble up and\n\t\t// emit its event object to the `change` output.\n\t\tevent.stopPropagation();\n\n\t\tif (!this.checked() && !this.disabledState()) {\n\t\t\tthis.emitChangeEvent();\n\t\t\tthis.radioGroup.select(this, this.value());\n\t\t}\n\t}\n\n\t/** Triggered when the user clicks on the touch target. */\n\tprotected onTouchTargetClick(event: Event): void {\n\t\tthis.onInputInteraction(event);\n\n\t\tif (!this.disabledState()) {\n\t\t\t// Normally the input should be focused already, but if the click\n\t\t\t// comes from the touch target, then we might have to focus it ourselves.\n\t\t\tthis.inputElement().nativeElement.focus();\n\t\t}\n\t}\n}\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport {\n\tbooleanAttribute,\n\tcontentChildren,\n\tDirective,\n\tforwardRef,\n\tinput,\n\tlinkedSignal,\n\tmodel,\n\toutput,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';\nimport { provideBrnRadioGroupToken } from './brn-radio-group.token';\nimport { BrnRadioChange, BrnRadioComponent } from './brn-radio.component';\n\nexport const BRN_RADIO_GROUP_CONTROL_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnRadioGroupDirective),\n\tmulti: true,\n};\n\n@Directive({\n\tselector: '[brnRadioGroup]',\n\tstandalone: true,\n\tproviders: [BRN_RADIO_GROUP_CONTROL_VALUE_ACCESSOR, provideBrnRadioGroupToken(BrnRadioGroupDirective)],\n\thost: {\n\t\trole: 'radiogroup',\n\t\t'[dir]': 'direction()',\n\t\t'(focusout)': 'onTouched()',\n\t},\n})\nexport class BrnRadioGroupDirective<T = unknown> implements ControlValueAccessor {\n\tprivate static _nextUniqueId = 0;\n\n\tprotected onChange: ChangeFn<T> = () => {};\n\n\tprotected onTouched: TouchFn = () => {};\n\n\tpublic readonly name = input(`brn-radio-group-${BrnRadioGroupDirective._nextUniqueId++}`);\n\n\t/**\n\t * The value of the selected radio button.\n\t */\n\tpublic readonly value = model<T>();\n\n\t/**\n\t * Whether the radio group is disabled.\n\t */\n\tpublic disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * Whether the radio group should be required.\n\t */\n\tpublic readonly required = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * The direction of the radio group.\n\t */\n\tpublic readonly direction = input<'ltr' | 'rtl' | null>('ltr');\n\n\t/**\n\t * Event emitted when the group value changes.\n\t */\n\tpublic readonly change = output<BrnRadioChange<T>>();\n\n\t/**\n\t * The internal disabled state of the radio group. This could be switched to a linkedSignal when we can drop v18 support.\n\t * @internal\n\t */\n\tpublic readonly disabledState = linkedSignal(() => this.disabled());\n\n\t/**\n\t * Access the radio buttons within the group.\n\t * @internal\n\t */\n\tpublic readonly radioButtons = contentChildren(BrnRadioComponent, { descendants: true });\n\n\twriteValue(value: T): void {\n\t\tthis.value.set(value);\n\t}\n\n\tregisterOnChange(fn: ChangeFn<T>): void {\n\t\tthis.onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: TouchFn): void {\n\t\tthis.onTouched = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabledState.set(isDisabled);\n\t}\n\n\t/**\n\t * Select a radio button.\n\t * @internal\n\t */\n\tselect(radioButton: BrnRadioComponent<T>, value: T): void {\n\t\tif (this.value() === value) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.value.set(value);\n\t\tthis.onChange(value);\n\t\tthis.change.emit(new BrnRadioChange<T>(radioButton, value));\n\t}\n}\n","import { NgModule } from '@angular/core';\n\nimport { BrnRadioGroupDirective } from './lib/brn-radio-group.directive';\nimport { BrnRadioComponent } from './lib/brn-radio.component';\n\nexport * from './lib/brn-radio-group.directive';\nexport * from './lib/brn-radio.component';\n\nexport const BrnRadioGroupImports = [BrnRadioGroupDirective, BrnRadioComponent] as const;\n\n@NgModule({\n\timports: [...BrnRadioGroupImports],\n\texports: [...BrnRadioGroupImports],\n})\nexport class BrnRadioGroupModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGA,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAAkC,oBAAoB,CAAC;AAE9F,SAAU,yBAAyB,CAAI,SAA0C,EAAA;IACtF,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,SAAS,EAAE;AAC/D;SAEgB,mBAAmB,GAAA;AAClC,IAAA,OAAO,MAAM,CAAC,kBA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mBAAmB,EAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAJ/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,OAAO,EAAE,CAAC,GAAG,oBAAoB,CAAC;AAClC,oBAAA,OAAO,EAAE,CAAC,GAAG,oBAAoB,CAAC;AAClC,iBAAA;;;ACbD;;AAEG;;;;"}
1
+ {"version":3,"file":"spartan-ng-brain-radio-group.mjs","sources":["../../../../libs/brain/radio-group/src/lib/brn-radio-group.token.ts","../../../../libs/brain/radio-group/src/lib/brn-radio.component.ts","../../../../libs/brain/radio-group/src/lib/brn-radio-group.directive.ts","../../../../libs/brain/radio-group/src/index.ts","../../../../libs/brain/radio-group/src/spartan-ng-brain-radio-group.ts"],"sourcesContent":["import { ExistingProvider, inject, InjectionToken, Type } from '@angular/core';\nimport type { BrnRadioGroupDirective } from './brn-radio-group.directive';\n\nconst BrnRadioGroupToken = new InjectionToken<BrnRadioGroupDirective<unknown>>('BrnRadioGroupToken');\n\nexport function provideBrnRadioGroupToken<T>(directive: Type<BrnRadioGroupDirective<T>>): ExistingProvider {\n\treturn { provide: BrnRadioGroupToken, useExisting: directive };\n}\n\nexport function injectBrnRadioGroup<T = unknown>(): BrnRadioGroupDirective<T> {\n\treturn inject(BrnRadioGroupToken) as BrnRadioGroupDirective<T>;\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport {\n\tChangeDetectionStrategy,\n\tComponent,\n\tElementRef,\n\ttype OnDestroy,\n\tViewEncapsulation,\n\tbooleanAttribute,\n\tcomputed,\n\tinject,\n\tinput,\n\toutput,\n\tviewChild,\n} from '@angular/core';\nimport { injectBrnRadioGroup } from './brn-radio-group.token';\n\nexport class BrnRadioChange<T> {\n\tconstructor(\n\t\tpublic source: BrnRadioComponent<T>,\n\t\tpublic value: T,\n\t) {}\n}\n\n@Component({\n\tselector: 'brn-radio',\n\tstandalone: true,\n\thost: {\n\t\tclass: 'brn-radio',\n\t\t'[attr.id]': 'hostId()',\n\t\t'[class.brn-radio-checked]': 'checked()',\n\t\t'[class.brn-radio-disabled]': 'disabledState()',\n\t\t'[attr.data-checked]': 'checked()',\n\t\t'[attr.data-disabled]': 'disabledState()',\n\t\t'[attr.data-value]': 'value()',\n\t\t// Needs to be removed since it causes some a11y issues (see #21266).\n\t\t'[attr.tabindex]': 'null',\n\t\t'[attr.aria-label]': 'null',\n\t\t'[attr.aria-labelledby]': 'null',\n\t\t'[attr.aria-describedby]': 'null',\n\t\t// Note: under normal conditions focus shouldn't land on this element, however it may be\n\t\t// programmatically set, for example inside of a focus trap, in this case we want to forward\n\t\t// the focus to the native element.\n\t\t'(focus)': 'inputElement().nativeElement.focus()',\n\t},\n\texportAs: 'brnRadio',\n\tencapsulation: ViewEncapsulation.None,\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\ttemplate: `\n\t\t<div\n\t\t\tdata-slot=\"indicator\"\n\t\t\tstyle=\"display: flex; height: fit-content; width: fit-content\"\n\t\t\t(click)=\"onTouchTargetClick($event)\"\n\t\t>\n\t\t\t<ng-content select=\"[target],[indicator]\" />\n\t\t</div>\n\t\t<input\n\t\t\t#input\n\t\t\tstyle=\"position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;\"\n\t\t\ttype=\"radio\"\n\t\t\t[id]=\"id()\"\n\t\t\t[checked]=\"checked()\"\n\t\t\t[disabled]=\"disabledState()\"\n\t\t\t[tabIndex]=\"tabIndex()\"\n\t\t\t[attr.name]=\"radioGroup.name()\"\n\t\t\t[attr.value]=\"value()\"\n\t\t\t[required]=\"required()\"\n\t\t\t[attr.aria-checked]=\"checked()\"\n\t\t\t[attr.aria-label]=\"ariaLabel()\"\n\t\t\t[attr.aria-labelledby]=\"ariaLabelledby()\"\n\t\t\t[attr.aria-describedby]=\"ariaDescribedby()\"\n\t\t\t[attr.aria-disabled]=\"disabledState()\"\n\t\t\t(change)=\"onInputInteraction($event)\"\n\t\t\t(click)=\"onInputClick($event)\"\n\t\t/>\n\t\t<ng-content />\n\t`,\n})\nexport class BrnRadioComponent<T = unknown> implements OnDestroy {\n\tprivate static _nextUniqueId = 0;\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\tprivate readonly _elementRef = inject(ElementRef);\n\tprotected readonly radioGroup = injectBrnRadioGroup<T>();\n\n\t/**\n\t * Whether the radio button is disabled.\n\t */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Whether the radio button is disabled or the radio group is disabled.\n\t */\n\tprotected readonly disabledState = computed(() => this.disabled() || this.radioGroup.disabledState());\n\n\t/**\n\t * Whether the radio button is checked.\n\t */\n\tprotected readonly checked = computed(() => this.radioGroup.value() === this.value());\n\n\tprotected readonly tabIndex = computed(() => {\n\t\tconst disabled = this.disabledState();\n\t\tconst checked = this.checked();\n\t\tconst hasSelectedRadio = this.radioGroup.value() !== undefined;\n\t\tconst isFirstRadio = this.radioGroup.radioButtons()[0] === this;\n\n\t\tif (disabled || (!checked && (hasSelectedRadio || !isFirstRadio))) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn 0;\n\t});\n\n\t/**\n\t * The unique ID for the radio button input. If none is supplied, it will be auto-generated.\n\t */\n\tpublic readonly id = input<string | undefined>(undefined);\n\n\tpublic readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' });\n\n\tpublic readonly ariaLabelledby = input<string | undefined>(undefined, { alias: 'aria-labelledby' });\n\n\tpublic readonly ariaDescribedby = input<string | undefined>(undefined, { alias: 'aria-describedby' });\n\n\t/**\n\t * The value this radio button represents.\n\t */\n\tpublic readonly value = input.required<T>();\n\n\t/**\n\t * Whether the radio button is required.\n\t */\n\tpublic readonly required = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * Event emitted when the checked state of this radio button changes.\n\t */\n\tpublic readonly change = output<BrnRadioChange<T>>();\n\n\tprotected readonly hostId = computed(() =>\n\t\tthis.id() ? this.id() : `brn-radio-${++BrnRadioComponent._nextUniqueId}`,\n\t);\n\n\tprotected readonly inputElement = viewChild.required<ElementRef<HTMLInputElement>>('input');\n\n\tconstructor() {\n\t\tthis._focusMonitor.monitor(this._elementRef, true);\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._focusMonitor.stopMonitoring(this._elementRef);\n\t}\n\n\t/** Dispatch change event with current value. */\n\tprivate emitChangeEvent(): void {\n\t\tthis.change.emit(new BrnRadioChange(this, this.value()));\n\t}\n\n\tprotected onInputClick(event: Event): void {\n\t\t// We have to stop propagation for click events on the visual hidden input element.\n\t\t// By default, when a user clicks on a label element, a generated click event will be\n\t\t// dispatched on the associated input element. Since we are using a label element as our\n\t\t// root container, the click event on the `radio-button` will be executed twice.\n\t\t// The real click event will bubble up, and the generated click event also tries to bubble up.\n\t\t// This will lead to multiple click events.\n\t\t// Preventing bubbling for the second event will solve that issue.\n\t\tevent.stopPropagation();\n\t}\n\n\tprotected onInputInteraction(event: Event): void {\n\t\t// We always have to stop propagation on the change event.\n\t\t// Otherwise the change event, from the input element, will bubble up and\n\t\t// emit its event object to the `change` output.\n\t\tevent.stopPropagation();\n\n\t\tif (!this.checked() && !this.disabledState()) {\n\t\t\tthis.emitChangeEvent();\n\t\t\tthis.radioGroup.select(this, this.value());\n\t\t}\n\t}\n\n\t/** Triggered when the user clicks on the touch target. */\n\tprotected onTouchTargetClick(event: Event): void {\n\t\tthis.onInputInteraction(event);\n\n\t\tif (!this.disabledState()) {\n\t\t\t// Normally the input should be focused already, but if the click\n\t\t\t// comes from the touch target, then we might have to focus it ourselves.\n\t\t\tthis.inputElement().nativeElement.focus();\n\t\t}\n\t}\n}\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport {\n\tbooleanAttribute,\n\tcontentChildren,\n\tDirective,\n\tforwardRef,\n\tinput,\n\tlinkedSignal,\n\tmodel,\n\toutput,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';\nimport { provideBrnRadioGroupToken } from './brn-radio-group.token';\nimport { BrnRadioChange, BrnRadioComponent } from './brn-radio.component';\n\nexport const BRN_RADIO_GROUP_CONTROL_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnRadioGroupDirective),\n\tmulti: true,\n};\n\n@Directive({\n\tselector: '[brnRadioGroup]',\n\tstandalone: true,\n\tproviders: [BRN_RADIO_GROUP_CONTROL_VALUE_ACCESSOR, provideBrnRadioGroupToken(BrnRadioGroupDirective)],\n\thost: {\n\t\trole: 'radiogroup',\n\t\t'[dir]': 'direction()',\n\t\t'(focusout)': 'onTouched()',\n\t},\n})\nexport class BrnRadioGroupDirective<T = unknown> implements ControlValueAccessor {\n\tprivate static _nextUniqueId = 0;\n\n\tprotected onChange: ChangeFn<T> = () => {};\n\n\tprotected onTouched: TouchFn = () => {};\n\n\tpublic readonly name = input(`brn-radio-group-${BrnRadioGroupDirective._nextUniqueId++}`);\n\n\t/**\n\t * The value of the selected radio button.\n\t */\n\tpublic readonly value = model<T>();\n\n\t/**\n\t * Whether the radio group is disabled.\n\t */\n\tpublic disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * Whether the radio group should be required.\n\t */\n\tpublic readonly required = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * The direction of the radio group.\n\t */\n\tpublic readonly direction = input<'ltr' | 'rtl' | null>('ltr');\n\n\t/**\n\t * Event emitted when the group value changes.\n\t */\n\tpublic readonly change = output<BrnRadioChange<T>>();\n\n\t/**\n\t * The internal disabled state of the radio group. This could be switched to a linkedSignal when we can drop v18 support.\n\t * @internal\n\t */\n\tpublic readonly disabledState = linkedSignal(() => this.disabled());\n\n\t/**\n\t * Access the radio buttons within the group.\n\t * @internal\n\t */\n\tpublic readonly radioButtons = contentChildren(BrnRadioComponent, { descendants: true });\n\n\twriteValue(value: T): void {\n\t\tthis.value.set(value);\n\t}\n\n\tregisterOnChange(fn: ChangeFn<T>): void {\n\t\tthis.onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: TouchFn): void {\n\t\tthis.onTouched = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabledState.set(isDisabled);\n\t}\n\n\t/**\n\t * Select a radio button.\n\t * @internal\n\t */\n\tselect(radioButton: BrnRadioComponent<T>, value: T): void {\n\t\tif (this.value() === value) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.value.set(value);\n\t\tthis.onChange(value);\n\t\tthis.change.emit(new BrnRadioChange<T>(radioButton, value));\n\t}\n}\n","import { NgModule } from '@angular/core';\n\nimport { BrnRadioGroupDirective } from './lib/brn-radio-group.directive';\nimport { BrnRadioComponent } from './lib/brn-radio.component';\n\nexport * from './lib/brn-radio-group.directive';\nexport * from './lib/brn-radio.component';\n\nexport const BrnRadioGroupImports = [BrnRadioGroupDirective, BrnRadioComponent] as const;\n\n@NgModule({\n\timports: [...BrnRadioGroupImports],\n\texports: [...BrnRadioGroupImports],\n})\nexport class BrnRadioGroupModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGA,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAAkC,oBAAoB,CAAC;AAE9F,SAAU,yBAAyB,CAAI,SAA0C,EAAA;IACtF,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,SAAS,EAAE;AAC/D;SAEgB,mBAAmB,GAAA;AAClC,IAAA,OAAO,MAAM,CAAC,kBAAkB,CAA8B;AAC/D;;MCMa,cAAc,CAAA;AAElB,IAAA,MAAA;AACA,IAAA,KAAA;IAFR,WACQ,CAAA,MAA4B,EA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CAAC;AAClC,iBAAA;;;ACbD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spartan-ng/brain",
3
- "version": "0.0.1-alpha.452",
3
+ "version": "0.0.1-alpha.454",
4
4
  "sideEffects": false,
5
5
  "exports": {
6
6
  "./hlm-tailwind-preset": {
@@ -44,7 +44,6 @@ export declare class BrnRadioComponent<T = unknown> implements OnDestroy {
44
44
  */
45
45
  readonly change: import("@angular/core").OutputEmitterRef<BrnRadioChange<T>>;
46
46
  protected readonly hostId: import("@angular/core").Signal<string | undefined>;
47
- protected readonly inputId: import("@angular/core").Signal<string>;
48
47
  protected readonly inputElement: import("@angular/core").Signal<ElementRef<HTMLInputElement>>;
49
48
  constructor();
50
49
  ngOnDestroy(): void;