@govtechsg/sgds-web-component 3.10.0-rc.4 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/base/select-element.d.ts +0 -1
  2. package/base/select-element.js +0 -1
  3. package/base/select-element.js.map +1 -1
  4. package/components/Checkbox/index.umd.min.js +3 -3
  5. package/components/Checkbox/index.umd.min.js.map +1 -1
  6. package/components/Checkbox/sgds-checkbox-group.d.ts +0 -1
  7. package/components/Checkbox/sgds-checkbox-group.js +0 -1
  8. package/components/Checkbox/sgds-checkbox-group.js.map +1 -1
  9. package/components/Checkbox/sgds-checkbox.d.ts +0 -1
  10. package/components/Checkbox/sgds-checkbox.js +0 -1
  11. package/components/Checkbox/sgds-checkbox.js.map +1 -1
  12. package/components/ComboBox/index.umd.min.js +225 -225
  13. package/components/ComboBox/index.umd.min.js.map +1 -1
  14. package/components/Datepicker/index.umd.min.js +3 -3
  15. package/components/Datepicker/index.umd.min.js.map +1 -1
  16. package/components/Datepicker/sgds-datepicker.d.ts +0 -1
  17. package/components/Datepicker/sgds-datepicker.js +0 -1
  18. package/components/Datepicker/sgds-datepicker.js.map +1 -1
  19. package/components/FileUpload/index.umd.min.js +2 -2
  20. package/components/FileUpload/index.umd.min.js.map +1 -1
  21. package/components/FileUpload/sgds-file-upload.d.ts +0 -1
  22. package/components/FileUpload/sgds-file-upload.js +0 -1
  23. package/components/FileUpload/sgds-file-upload.js.map +1 -1
  24. package/components/Input/index.umd.min.js +2 -2
  25. package/components/Input/index.umd.min.js.map +1 -1
  26. package/components/Input/sgds-input.d.ts +0 -1
  27. package/components/Input/sgds-input.js +0 -1
  28. package/components/Input/sgds-input.js.map +1 -1
  29. package/components/QuantityToggle/index.umd.min.js +3 -3
  30. package/components/QuantityToggle/index.umd.min.js.map +1 -1
  31. package/components/QuantityToggle/sgds-quantity-toggle.d.ts +0 -1
  32. package/components/QuantityToggle/sgds-quantity-toggle.js +0 -1
  33. package/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
  34. package/components/Radio/index.umd.min.js +6 -6
  35. package/components/Radio/index.umd.min.js.map +1 -1
  36. package/components/Radio/sgds-radio-group.d.ts +0 -1
  37. package/components/Radio/sgds-radio-group.js +0 -1
  38. package/components/Radio/sgds-radio-group.js.map +1 -1
  39. package/components/Select/index.umd.min.js +2 -2
  40. package/components/Select/index.umd.min.js.map +1 -1
  41. package/components/SystemBanner/index.umd.min.js +2 -2
  42. package/components/SystemBanner/index.umd.min.js.map +1 -1
  43. package/components/SystemBanner/sgds-system-banner.d.ts +2 -2
  44. package/components/SystemBanner/sgds-system-banner.js +5 -5
  45. package/components/SystemBanner/sgds-system-banner.js.map +1 -1
  46. package/components/Table/index.umd.min.js +62 -17
  47. package/components/Table/index.umd.min.js.map +1 -1
  48. package/components/Table/sgds-table-cell.js +1 -1
  49. package/components/Table/sgds-table-cell.js.map +1 -1
  50. package/components/Table/sgds-table-head.d.ts +2 -5
  51. package/components/Table/sgds-table-head.js +24 -15
  52. package/components/Table/sgds-table-head.js.map +1 -1
  53. package/components/Table/sgds-table.d.ts +41 -6
  54. package/components/Table/sgds-table.js +57 -15
  55. package/components/Table/sgds-table.js.map +1 -1
  56. package/components/Table/table-cell.js +1 -1
  57. package/components/Table/table-context.d.ts +3 -0
  58. package/components/Table/table-context.js +6 -0
  59. package/components/Table/table-context.js.map +1 -0
  60. package/components/Table/table-head.js +1 -1
  61. package/components/Table/table.js +1 -1
  62. package/components/Textarea/index.umd.min.js +6 -6
  63. package/components/Textarea/index.umd.min.js.map +1 -1
  64. package/components/Textarea/sgds-textarea.d.ts +0 -1
  65. package/components/Textarea/sgds-textarea.js +0 -1
  66. package/components/Textarea/sgds-textarea.js.map +1 -1
  67. package/components/index.umd.min.js +31 -27
  68. package/components/index.umd.min.js.map +1 -1
  69. package/index.umd.min.js +616 -612
  70. package/index.umd.min.js.map +1 -1
  71. package/package.json +1 -1
  72. package/react/base/select-element.cjs.js +0 -1
  73. package/react/base/select-element.cjs.js.map +1 -1
  74. package/react/base/select-element.js +0 -1
  75. package/react/base/select-element.js.map +1 -1
  76. package/react/components/Checkbox/sgds-checkbox-group.cjs.js +0 -1
  77. package/react/components/Checkbox/sgds-checkbox-group.cjs.js.map +1 -1
  78. package/react/components/Checkbox/sgds-checkbox-group.js +0 -1
  79. package/react/components/Checkbox/sgds-checkbox-group.js.map +1 -1
  80. package/react/components/Checkbox/sgds-checkbox.cjs.js +0 -1
  81. package/react/components/Checkbox/sgds-checkbox.cjs.js.map +1 -1
  82. package/react/components/Checkbox/sgds-checkbox.js +0 -1
  83. package/react/components/Checkbox/sgds-checkbox.js.map +1 -1
  84. package/react/components/Datepicker/sgds-datepicker.cjs.js +0 -1
  85. package/react/components/Datepicker/sgds-datepicker.cjs.js.map +1 -1
  86. package/react/components/Datepicker/sgds-datepicker.js +0 -1
  87. package/react/components/Datepicker/sgds-datepicker.js.map +1 -1
  88. package/react/components/FileUpload/sgds-file-upload.cjs.js +0 -1
  89. package/react/components/FileUpload/sgds-file-upload.cjs.js.map +1 -1
  90. package/react/components/FileUpload/sgds-file-upload.js +0 -1
  91. package/react/components/FileUpload/sgds-file-upload.js.map +1 -1
  92. package/react/components/Input/sgds-input.cjs.js +0 -1
  93. package/react/components/Input/sgds-input.cjs.js.map +1 -1
  94. package/react/components/Input/sgds-input.js +0 -1
  95. package/react/components/Input/sgds-input.js.map +1 -1
  96. package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js +0 -1
  97. package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js.map +1 -1
  98. package/react/components/QuantityToggle/sgds-quantity-toggle.js +0 -1
  99. package/react/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
  100. package/react/components/Radio/sgds-radio-group.cjs.js +0 -1
  101. package/react/components/Radio/sgds-radio-group.cjs.js.map +1 -1
  102. package/react/components/Radio/sgds-radio-group.js +0 -1
  103. package/react/components/Radio/sgds-radio-group.js.map +1 -1
  104. package/react/components/SystemBanner/sgds-system-banner.cjs.js +5 -5
  105. package/react/components/SystemBanner/sgds-system-banner.cjs.js.map +1 -1
  106. package/react/components/SystemBanner/sgds-system-banner.js +5 -5
  107. package/react/components/SystemBanner/sgds-system-banner.js.map +1 -1
  108. package/react/components/Table/sgds-table-cell.cjs.js +1 -1
  109. package/react/components/Table/sgds-table-cell.cjs.js.map +1 -1
  110. package/react/components/Table/sgds-table-cell.js +1 -1
  111. package/react/components/Table/sgds-table-cell.js.map +1 -1
  112. package/react/components/Table/sgds-table-head.cjs.js +24 -15
  113. package/react/components/Table/sgds-table-head.cjs.js.map +1 -1
  114. package/react/components/Table/sgds-table-head.js +24 -15
  115. package/react/components/Table/sgds-table-head.js.map +1 -1
  116. package/react/components/Table/sgds-table.cjs.js +56 -14
  117. package/react/components/Table/sgds-table.cjs.js.map +1 -1
  118. package/react/components/Table/sgds-table.js +57 -15
  119. package/react/components/Table/sgds-table.js.map +1 -1
  120. package/react/components/Table/table-cell.cjs.js +1 -1
  121. package/react/components/Table/table-cell.js +1 -1
  122. package/react/components/Table/table-context.cjs.js +11 -0
  123. package/react/components/Table/table-context.cjs.js.map +1 -0
  124. package/react/components/Table/table-context.js +7 -0
  125. package/react/components/Table/table-context.js.map +1 -0
  126. package/react/components/Table/table-head.cjs.js +1 -1
  127. package/react/components/Table/table-head.js +1 -1
  128. package/react/components/Table/table.cjs.js +1 -1
  129. package/react/components/Table/table.js +1 -1
  130. package/react/components/Textarea/sgds-textarea.cjs.js +0 -1
  131. package/react/components/Textarea/sgds-textarea.cjs.js.map +1 -1
  132. package/react/components/Textarea/sgds-textarea.js +0 -1
  133. package/react/components/Textarea/sgds-textarea.js.map +1 -1
  134. package/react/utils/inputValidationController.cjs.js +2 -2
  135. package/react/utils/inputValidationController.cjs.js.map +1 -1
  136. package/react/utils/inputValidationController.js +2 -2
  137. package/react/utils/inputValidationController.js.map +1 -1
  138. package/react/utils/validatorMixin.cjs.js +10 -13
  139. package/react/utils/validatorMixin.cjs.js.map +1 -1
  140. package/react/utils/validatorMixin.js +10 -13
  141. package/react/utils/validatorMixin.js.map +1 -1
  142. package/utils/inputValidationController.d.ts +1 -1
  143. package/utils/inputValidationController.js +2 -2
  144. package/utils/inputValidationController.js.map +1 -1
  145. package/utils/validatorMixin.js +10 -13
  146. package/utils/validatorMixin.js.map +1 -1
@@ -10,6 +10,8 @@ var classMap_js = require('lit/directives/class-map.js');
10
10
  var sgdsElement = require('../../base/sgds-element.cjs.js');
11
11
  var table = require('./table.cjs.js');
12
12
  var slot = require('../../utils/slot.cjs.js');
13
+ var context = require('@lit/context');
14
+ var tableContext = require('./table-context.cjs.js');
13
15
 
14
16
  /**
15
17
  * @summary Table is used for displaying collections of data in organized rows and columns.
@@ -21,23 +23,52 @@ class SgdsTable extends sgdsElement["default"] {
21
23
  constructor() {
22
24
  super(...arguments);
23
25
  /**
24
- * Populate row header cells using Arrays
26
+ * Array of strings to populate row header cells.
27
+ * @type {string[]}
25
28
  */
26
29
  this.rowHeader = [];
27
30
  /**
28
- * Populate column header cells using Arrays only when <code>headerPosition="vertical"</code> or <code>headerPosition="both"</code>
31
+ * Array of strings to populate column header cells.
32
+ * Only used when `headerPosition` is set to "vertical" or "both".
33
+ * @type {string[]}
29
34
  */
30
35
  this.columnHeader = [];
31
36
  /**
32
- * Populate data cells using Arrays
37
+ * Two-dimensional array of strings or numbers to populate table data cells.
38
+ * @type {Array<(string | number)[]>}
33
39
  */
34
40
  this.tableData = [];
35
41
  /**
36
- * Defines the placement of headers in the table (horizontal, vertical, or both)
42
+ * Defines the placement of headers in the table.
43
+ * Use "horizontal" for top headers only, "vertical" for left headers only,
44
+ * or "both" for both row and column headers.
45
+ * @type {"horizontal" | "vertical" | "both"}
46
+ * @default "horizontal"
37
47
  */
38
48
  this.headerPosition = "horizontal";
39
- /** Used only for SSR to indicate the presence of the `default` slot. */
49
+ /**
50
+ * Enables background styling on horizontal header rows.
51
+ * When true, applies background color to header cells for better visual distinction.
52
+ * @type {boolean}
53
+ * @default false
54
+ */
55
+ this.headerBackground = false;
56
+ /**
57
+ * Enables borders around table cells.
58
+ * When true, displays visible borders between all table cells.
59
+ * @type {boolean}
60
+ * @default false
61
+ */
62
+ this.tableBorder = false;
63
+ /**
64
+ * Indicates the presence of the default slot.
65
+ * Used for server-side rendering to determine table structure.
66
+ * @type {boolean}
67
+ * @internal
68
+ * @default false
69
+ */
40
70
  this.hasDefaultSlot = false;
71
+ this._headerBackground = false;
41
72
  /** @internal */
42
73
  this.hasSlotController = new slot.HasSlotController(this, "[default]");
43
74
  }
@@ -47,19 +78,20 @@ class SgdsTable extends sgdsElement["default"] {
47
78
  updated() {
48
79
  if (!this.hasDefaultSlot)
49
80
  this.hasDefaultSlot = this.hasSlotController.test("[default]");
81
+ this._headerBackground = this.headerBackground;
50
82
  }
51
83
  _renderTable() {
52
84
  if (this.headerPosition === "horizontal") {
53
85
  return lit.html `
54
86
  <thead>
55
87
  <tr>
56
- ${this.rowHeader.map((header) => lit.html ` <th>${header}</th> `)}
88
+ ${this.rowHeader.map((header) => lit.html ` <th><div>${header}</div></th> `)}
57
89
  </tr>
58
90
  </thead>
59
91
  <tbody>
60
92
  ${this.tableData.map(row => lit.html `
61
93
  <tr>
62
- ${row.map((cell) => lit.html `<td>${cell}</td>`)}
94
+ ${row.map((cell) => lit.html `<td><div>${cell}</div></td>`)}
63
95
  </tr>
64
96
  `)}
65
97
  </tbody>
@@ -69,15 +101,15 @@ class SgdsTable extends sgdsElement["default"] {
69
101
  return lit.html `
70
102
  <thead>
71
103
  <tr>
72
- <th></th>
73
- ${this.rowHeader.map((header) => lit.html ` <th>${header}</th> `)}
104
+ <th><div></div></th>
105
+ ${this.rowHeader.map((header) => lit.html ` <th><div>${header}</div></th> `)}
74
106
  </tr>
75
107
  </thead>
76
108
  <tbody>
77
109
  ${this.tableData.map((row, index) => lit.html `
78
110
  <tr>
79
- <th>${this.columnHeader[index]}</th>
80
- ${row.map((cell) => lit.html `<td>${cell}</td>`)}
111
+ <th><div>${this.columnHeader[index]}</div></th>
112
+ ${row.map((cell) => lit.html `<td><div>${cell}</div></td>`)}
81
113
  </tr>
82
114
  `)}
83
115
  </tbody>
@@ -88,8 +120,8 @@ class SgdsTable extends sgdsElement["default"] {
88
120
  return lit.html `
89
121
  ${flippedTableData.map((row, index) => lit.html `
90
122
  <tr>
91
- <th>${this.columnHeader[index]}</th>
92
- ${row.map((cell) => lit.html `<td>${cell}</td>`)}
123
+ <th><div>${this.columnHeader[index]}</div></th>
124
+ ${row.map((cell) => lit.html `<td><div>${cell}</div></td>`)}
93
125
  </tr>
94
126
  `)}
95
127
  `;
@@ -107,7 +139,7 @@ class SgdsTable extends sgdsElement["default"] {
107
139
  })}
108
140
  tabindex="0"
109
141
  >
110
- <slot id="table-slot" class="table"></slot>
142
+ <slot id="table-slot" class=${classMap_js.classMap({ table: true, "no-border": !this.hasDefaultSlot })}></slot>
111
143
 
112
144
  ${!this.hasDefaultSlot
113
145
  ? lit.html `<table class="table">
@@ -134,9 +166,19 @@ tslib.__decorate([
134
166
  tslib.__decorate([
135
167
  decorators_js.property({ type: String })
136
168
  ], SgdsTable.prototype, "headerPosition", void 0);
169
+ tslib.__decorate([
170
+ decorators_js.property({ type: Boolean })
171
+ ], SgdsTable.prototype, "headerBackground", void 0);
172
+ tslib.__decorate([
173
+ decorators_js.property({ type: Boolean })
174
+ ], SgdsTable.prototype, "tableBorder", void 0);
137
175
  tslib.__decorate([
138
176
  decorators_js.property({ type: Boolean })
139
177
  ], SgdsTable.prototype, "hasDefaultSlot", void 0);
178
+ tslib.__decorate([
179
+ context.provide({ context: tableContext.TableHeaderBackgroundContext }),
180
+ decorators_js.state()
181
+ ], SgdsTable.prototype, "_headerBackground", void 0);
140
182
 
141
183
  exports.SgdsTable = SgdsTable;
142
184
  exports["default"] = SgdsTable;
@@ -1 +1 @@
1
- {"version":3,"file":"sgds-table.cjs.js","sources":["../../../../src/components/Table/sgds-table.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\n\nimport tableStyle from \"./table.css\";\nimport { HasSlotController } from \"../../utils/slot\";\n\nexport type HeaderPosition = \"horizontal\" | \"vertical\" | \"both\";\n\n/**\n * @summary Table is used for displaying collections of data in organized rows and columns.\n * It supports two rendering methods: supply an array of data for automatic table generation, or use the slot to insert custom table elements for full structural control.\n *\n * @slot - Insert custom table elements (such as rows, headers, or cells) to define the table structure manually.\n */\n\nexport class SgdsTable extends SgdsElement {\n static styles = [...SgdsElement.styles, tableStyle];\n\n /**\n * Use responsive=\"sm\", responsive=\"md\" , responsive=\"lg\", or responsive=\"xl\" as needed to create responsive tables up to a particular breakpoint. From that breakpoint and up, the table will behave normally and not scroll horizontally. Use reponsive=\"always\" to let table be always responsive\n */\n @property({ type: String, reflect: true }) responsive: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"always\";\n\n /**\n * Populate row header cells using Arrays\n */\n @property({ type: Array }) rowHeader: string[] = [];\n\n /**\n * Populate column header cells using Arrays only when <code>headerPosition=\"vertical\"</code> or <code>headerPosition=\"both\"</code>\n */\n @property({ type: Array }) columnHeader: string[] = [];\n\n /**\n * Populate data cells using Arrays\n */\n @property({ type: Array }) tableData: Array<(string | number)[]> = [];\n\n /**\n * Defines the placement of headers in the table (horizontal, vertical, or both)\n */\n @property({ type: String }) headerPosition: HeaderPosition = \"horizontal\";\n\n /** Used only for SSR to indicate the presence of the `default` slot. */\n @property({ type: Boolean }) hasDefaultSlot = false;\n\n /** @internal */\n private readonly hasSlotController = new HasSlotController(this, \"[default]\");\n\n connectedCallback() {\n super.connectedCallback();\n }\n\n updated() {\n if (!this.hasDefaultSlot) this.hasDefaultSlot = this.hasSlotController.test(\"[default]\");\n }\n\n private _renderTable() {\n if (this.headerPosition === \"horizontal\") {\n return html`\n <thead>\n <tr>\n ${this.rowHeader.map((header: string) => html` <th>${header}</th> `)}\n </tr>\n </thead>\n <tbody>\n ${this.tableData.map(\n row => html`\n <tr>\n ${row.map((cell: string) => html`<td>${cell}</td>`)}\n </tr>\n `\n )}\n </tbody>\n `;\n }\n\n if (this.headerPosition === \"both\") {\n return html`\n <thead>\n <tr>\n <th></th>\n ${this.rowHeader.map((header: string) => html` <th>${header}</th> `)}\n </tr>\n </thead>\n <tbody>\n ${this.tableData.map(\n (row, index) => html`\n <tr>\n <th>${this.columnHeader[index]}</th>\n ${row.map((cell: string) => html`<td>${cell}</td>`)}\n </tr>\n `\n )}\n </tbody>\n `;\n }\n\n if (this.headerPosition === \"vertical\") {\n const flippedTableData = this.tableData[0].map((_, colIndex) => this.tableData.map(row => row[colIndex]));\n\n return html`\n ${flippedTableData.map(\n (row, index) => html`\n <tr>\n <th>${this.columnHeader[index]}</th>\n ${row.map((cell: string) => html`<td>${cell}</td>`)}\n </tr>\n `\n )}\n `;\n }\n }\n\n render() {\n return html`\n <div\n class=${classMap({\n \"table-responsive\": this.responsive === \"always\",\n \"table-responsive-sm\": this.responsive === \"sm\",\n \"table-responsive-md\": this.responsive === \"md\",\n \"table-responsive-lg\": this.responsive === \"lg\",\n \"table-responsive-xl\": this.responsive === \"xl\"\n })}\n tabindex=\"0\"\n >\n <slot id=\"table-slot\" class=\"table\"></slot>\n\n ${!this.hasDefaultSlot\n ? html`<table class=\"table\">\n ${this._renderTable()}\n </table>`\n : \"\"}\n </div>\n `;\n }\n}\n\nexport default SgdsTable;\n"],"names":["SgdsElement","HasSlotController","html","classMap","tableStyle","__decorate","property"],"mappings":";;;;;;;;;;;;;AAUA;;;;;AAKG;AAEG,MAAO,SAAU,SAAQA,sBAAW,CAAA;AAA1C,IAAA,WAAA,GAAA;;AAQE;;AAEG;QACwB,IAAS,CAAA,SAAA,GAAa,EAAE,CAAC;AAEpD;;AAEG;QACwB,IAAY,CAAA,YAAA,GAAa,EAAE,CAAC;AAEvD;;AAEG;QACwB,IAAS,CAAA,SAAA,GAA+B,EAAE,CAAC;AAEtE;;A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"file":"sgds-table.cjs.js","sources":["../../../../src/components/Table/sgds-table.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\n\nimport tableStyle from \"./table.css\";\nimport { HasSlotController } from \"../../utils/slot\";\nimport { provide } from \"@lit/context\";\nimport { TableHeaderBackgroundContext } from \"./table-context\";\n\nexport type HeaderPosition = \"horizontal\" | \"vertical\" | \"both\";\n\n/**\n * @summary Table is used for displaying collections of data in organized rows and columns.\n * It supports two rendering methods: supply an array of data for automatic table generation, or use the slot to insert custom table elements for full structural control.\n *\n * @slot - Insert custom table elements (such as rows, headers, or cells) to define the table structure manually.\n */\n\nexport class SgdsTable extends SgdsElement {\n static styles = [...SgdsElement.styles, tableStyle];\n\n /**\n * Specifies the responsive breakpoint for the table.\n * Use \"sm\", \"md\", \"lg\", or \"xl\" to create responsive tables up to a particular breakpoint.\n * From that breakpoint and up, the table will behave normally and not scroll horizontally.\n * Use \"always\" to make the table always responsive.\n *\n * (@deprecated) Deprecated since 3.9.0 legacy from v2\n * @type {\"sm\" | \"md\" | \"lg\" | \"xl\" | \"always\"}\n */\n @property({ type: String, reflect: true }) responsive: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"always\";\n\n /**\n * Array of strings to populate row header cells.\n * @type {string[]}\n */\n @property({ type: Array }) rowHeader: string[] = [];\n\n /**\n * Array of strings to populate column header cells.\n * Only used when `headerPosition` is set to \"vertical\" or \"both\".\n * @type {string[]}\n */\n @property({ type: Array }) columnHeader: string[] = [];\n\n /**\n * Two-dimensional array of strings or numbers to populate table data cells.\n * @type {Array<(string | number)[]>}\n */\n @property({ type: Array }) tableData: Array<(string | number)[]> = [];\n\n /**\n * Defines the placement of headers in the table.\n * Use \"horizontal\" for top headers only, \"vertical\" for left headers only,\n * or \"both\" for both row and column headers.\n * @type {\"horizontal\" | \"vertical\" | \"both\"}\n * @default \"horizontal\"\n */\n @property({ type: String }) headerPosition: HeaderPosition = \"horizontal\";\n\n /**\n * Enables background styling on horizontal header rows.\n * When true, applies background color to header cells for better visual distinction.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean }) headerBackground = false;\n\n /**\n * Enables borders around table cells.\n * When true, displays visible borders between all table cells.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean }) tableBorder = false;\n\n /**\n * Indicates the presence of the default slot.\n * Used for server-side rendering to determine table structure.\n * @type {boolean}\n * @internal\n * @default false\n */\n @property({ type: Boolean }) hasDefaultSlot = false;\n\n @provide({ context: TableHeaderBackgroundContext })\n @state()\n private _headerBackground = false;\n\n /** @internal */\n private readonly hasSlotController = new HasSlotController(this, \"[default]\");\n\n connectedCallback() {\n super.connectedCallback();\n }\n\n updated() {\n if (!this.hasDefaultSlot) this.hasDefaultSlot = this.hasSlotController.test(\"[default]\");\n this._headerBackground = this.headerBackground;\n }\n\n private _renderTable() {\n if (this.headerPosition === \"horizontal\") {\n return html`\n <thead>\n <tr>\n ${this.rowHeader.map((header: string) => html` <th><div>${header}</div></th> `)}\n </tr>\n </thead>\n <tbody>\n ${this.tableData.map(\n row => html`\n <tr>\n ${row.map((cell: string) => html`<td><div>${cell}</div></td>`)}\n </tr>\n `\n )}\n </tbody>\n `;\n }\n\n if (this.headerPosition === \"both\") {\n return html`\n <thead>\n <tr>\n <th><div></div></th>\n ${this.rowHeader.map((header: string) => html` <th><div>${header}</div></th> `)}\n </tr>\n </thead>\n <tbody>\n ${this.tableData.map(\n (row, index) => html`\n <tr>\n <th><div>${this.columnHeader[index]}</div></th>\n ${row.map((cell: string) => html`<td><div>${cell}</div></td>`)}\n </tr>\n `\n )}\n </tbody>\n `;\n }\n\n if (this.headerPosition === \"vertical\") {\n const flippedTableData = this.tableData[0].map((_, colIndex) => this.tableData.map(row => row[colIndex]));\n\n return html`\n ${flippedTableData.map(\n (row, index) => html`\n <tr>\n <th><div>${this.columnHeader[index]}</div></th>\n ${row.map((cell: string) => html`<td><div>${cell}</div></td>`)}\n </tr>\n `\n )}\n `;\n }\n }\n\n render() {\n return html`\n <div\n class=${classMap({\n \"table-responsive\": this.responsive === \"always\",\n \"table-responsive-sm\": this.responsive === \"sm\",\n \"table-responsive-md\": this.responsive === \"md\",\n \"table-responsive-lg\": this.responsive === \"lg\",\n \"table-responsive-xl\": this.responsive === \"xl\"\n })}\n tabindex=\"0\"\n >\n <slot id=\"table-slot\" class=${classMap({ table: true, \"no-border\": !this.hasDefaultSlot })}></slot>\n\n ${!this.hasDefaultSlot\n ? html`<table class=\"table\">\n ${this._renderTable()}\n </table>`\n : \"\"}\n </div>\n `;\n }\n}\n\nexport default SgdsTable;\n"],"names":["SgdsElement","HasSlotController","html","classMap","tableStyle","__decorate","property","provide","TableHeaderBackgroundContext","state"],"mappings":";;;;;;;;;;;;;;;AAYA;;;;;AAKG;AAEG,MAAO,SAAU,SAAQA,sBAAW,CAAA;AAA1C,IAAA,WAAA,GAAA;;AAcE;;;AAGG;QACwB,IAAS,CAAA,SAAA,GAAa,EAAE,CAAC;AAEpD;;;;AAIG;QACwB,IAAY,CAAA,YAAA,GAAa,EAAE,CAAC;AAEvD;;;AAGG;QACwB,IAAS,CAAA,SAAA,GAA+B,EAAE,CAAC;AAEtE;;;;;;AAMG;QACyB,IAAc,CAAA,cAAA,GAAmB,YAAY,CAAC;AAE1E;;;;;AAKG;QAC0B,IAAgB,CAAA,gBAAA,GAAG,KAAK,CAAC;AAEtD;;;;;AAKG;QAC0B,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;AAEjD;;;;;;AAMG;QAC0B,IAAc,CAAA,cAAA,GAAG,KAAK,CAAC;QAI5C,IAAiB,CAAA,iBAAA,GAAG,KAAK,CAAC;;QAGjB,IAAiB,CAAA,iBAAA,GAAG,IAAIC,sBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;KA0F/E;IAxFC,iBAAiB,GAAA;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;KAC3B;IAED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AAA,EAAA,SAAA,CAAA,SAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AASpBD,gBAAA,CAAA;AAA5B,IAAAC,sBAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAAwB,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAI5CD,gBAAA,CAAA;AAFP,IAAAE,eAAO,CAAC,EAAE,OAAO,EAAEC,yCAA4B,EAAE,CAAC;AAClD,IAAAC,mBAAK,EAAE;AAC0B,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,mBAAA,EAAA,KAAA,CAAA,CAAA;;;;;"}
@@ -1,11 +1,13 @@
1
1
  'use client';
2
2
  import { __decorate } from 'tslib';
3
3
  import { html } from 'lit';
4
- import { property } from 'lit/decorators.js';
4
+ import { property, state } from 'lit/decorators.js';
5
5
  import { classMap } from 'lit/directives/class-map.js';
6
6
  import SgdsElement from '../../base/sgds-element.js';
7
7
  import css_248z from './table.js';
8
8
  import { HasSlotController } from '../../utils/slot.js';
9
+ import { provide } from '@lit/context';
10
+ import { TableHeaderBackgroundContext } from './table-context.js';
9
11
 
10
12
  /**
11
13
  * @summary Table is used for displaying collections of data in organized rows and columns.
@@ -17,23 +19,52 @@ class SgdsTable extends SgdsElement {
17
19
  constructor() {
18
20
  super(...arguments);
19
21
  /**
20
- * Populate row header cells using Arrays
22
+ * Array of strings to populate row header cells.
23
+ * @type {string[]}
21
24
  */
22
25
  this.rowHeader = [];
23
26
  /**
24
- * Populate column header cells using Arrays only when <code>headerPosition="vertical"</code> or <code>headerPosition="both"</code>
27
+ * Array of strings to populate column header cells.
28
+ * Only used when `headerPosition` is set to "vertical" or "both".
29
+ * @type {string[]}
25
30
  */
26
31
  this.columnHeader = [];
27
32
  /**
28
- * Populate data cells using Arrays
33
+ * Two-dimensional array of strings or numbers to populate table data cells.
34
+ * @type {Array<(string | number)[]>}
29
35
  */
30
36
  this.tableData = [];
31
37
  /**
32
- * Defines the placement of headers in the table (horizontal, vertical, or both)
38
+ * Defines the placement of headers in the table.
39
+ * Use "horizontal" for top headers only, "vertical" for left headers only,
40
+ * or "both" for both row and column headers.
41
+ * @type {"horizontal" | "vertical" | "both"}
42
+ * @default "horizontal"
33
43
  */
34
44
  this.headerPosition = "horizontal";
35
- /** Used only for SSR to indicate the presence of the `default` slot. */
45
+ /**
46
+ * Enables background styling on horizontal header rows.
47
+ * When true, applies background color to header cells for better visual distinction.
48
+ * @type {boolean}
49
+ * @default false
50
+ */
51
+ this.headerBackground = false;
52
+ /**
53
+ * Enables borders around table cells.
54
+ * When true, displays visible borders between all table cells.
55
+ * @type {boolean}
56
+ * @default false
57
+ */
58
+ this.tableBorder = false;
59
+ /**
60
+ * Indicates the presence of the default slot.
61
+ * Used for server-side rendering to determine table structure.
62
+ * @type {boolean}
63
+ * @internal
64
+ * @default false
65
+ */
36
66
  this.hasDefaultSlot = false;
67
+ this._headerBackground = false;
37
68
  /** @internal */
38
69
  this.hasSlotController = new HasSlotController(this, "[default]");
39
70
  }
@@ -43,19 +74,20 @@ class SgdsTable extends SgdsElement {
43
74
  updated() {
44
75
  if (!this.hasDefaultSlot)
45
76
  this.hasDefaultSlot = this.hasSlotController.test("[default]");
77
+ this._headerBackground = this.headerBackground;
46
78
  }
47
79
  _renderTable() {
48
80
  if (this.headerPosition === "horizontal") {
49
81
  return html `
50
82
  <thead>
51
83
  <tr>
52
- ${this.rowHeader.map((header) => html ` <th>${header}</th> `)}
84
+ ${this.rowHeader.map((header) => html ` <th><div>${header}</div></th> `)}
53
85
  </tr>
54
86
  </thead>
55
87
  <tbody>
56
88
  ${this.tableData.map(row => html `
57
89
  <tr>
58
- ${row.map((cell) => html `<td>${cell}</td>`)}
90
+ ${row.map((cell) => html `<td><div>${cell}</div></td>`)}
59
91
  </tr>
60
92
  `)}
61
93
  </tbody>
@@ -65,15 +97,15 @@ class SgdsTable extends SgdsElement {
65
97
  return html `
66
98
  <thead>
67
99
  <tr>
68
- <th></th>
69
- ${this.rowHeader.map((header) => html ` <th>${header}</th> `)}
100
+ <th><div></div></th>
101
+ ${this.rowHeader.map((header) => html ` <th><div>${header}</div></th> `)}
70
102
  </tr>
71
103
  </thead>
72
104
  <tbody>
73
105
  ${this.tableData.map((row, index) => html `
74
106
  <tr>
75
- <th>${this.columnHeader[index]}</th>
76
- ${row.map((cell) => html `<td>${cell}</td>`)}
107
+ <th><div>${this.columnHeader[index]}</div></th>
108
+ ${row.map((cell) => html `<td><div>${cell}</div></td>`)}
77
109
  </tr>
78
110
  `)}
79
111
  </tbody>
@@ -84,8 +116,8 @@ class SgdsTable extends SgdsElement {
84
116
  return html `
85
117
  ${flippedTableData.map((row, index) => html `
86
118
  <tr>
87
- <th>${this.columnHeader[index]}</th>
88
- ${row.map((cell) => html `<td>${cell}</td>`)}
119
+ <th><div>${this.columnHeader[index]}</div></th>
120
+ ${row.map((cell) => html `<td><div>${cell}</div></td>`)}
89
121
  </tr>
90
122
  `)}
91
123
  `;
@@ -103,7 +135,7 @@ class SgdsTable extends SgdsElement {
103
135
  })}
104
136
  tabindex="0"
105
137
  >
106
- <slot id="table-slot" class="table"></slot>
138
+ <slot id="table-slot" class=${classMap({ table: true, "no-border": !this.hasDefaultSlot })}></slot>
107
139
 
108
140
  ${!this.hasDefaultSlot
109
141
  ? html `<table class="table">
@@ -130,9 +162,19 @@ __decorate([
130
162
  __decorate([
131
163
  property({ type: String })
132
164
  ], SgdsTable.prototype, "headerPosition", void 0);
165
+ __decorate([
166
+ property({ type: Boolean })
167
+ ], SgdsTable.prototype, "headerBackground", void 0);
168
+ __decorate([
169
+ property({ type: Boolean })
170
+ ], SgdsTable.prototype, "tableBorder", void 0);
133
171
  __decorate([
134
172
  property({ type: Boolean })
135
173
  ], SgdsTable.prototype, "hasDefaultSlot", void 0);
174
+ __decorate([
175
+ provide({ context: TableHeaderBackgroundContext }),
176
+ state()
177
+ ], SgdsTable.prototype, "_headerBackground", void 0);
136
178
 
137
179
  export { SgdsTable, SgdsTable as default };
138
180
  //# sourceMappingURL=sgds-table.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sgds-table.js","sources":["../../../../src/components/Table/sgds-table.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\n\nimport tableStyle from \"./table.css\";\nimport { HasSlotController } from \"../../utils/slot\";\n\nexport type HeaderPosition = \"horizontal\" | \"vertical\" | \"both\";\n\n/**\n * @summary Table is used for displaying collections of data in organized rows and columns.\n * It supports two rendering methods: supply an array of data for automatic table generation, or use the slot to insert custom table elements for full structural control.\n *\n * @slot - Insert custom table elements (such as rows, headers, or cells) to define the table structure manually.\n */\n\nexport class SgdsTable extends SgdsElement {\n static styles = [...SgdsElement.styles, tableStyle];\n\n /**\n * Use responsive=\"sm\", responsive=\"md\" , responsive=\"lg\", or responsive=\"xl\" as needed to create responsive tables up to a particular breakpoint. From that breakpoint and up, the table will behave normally and not scroll horizontally. Use reponsive=\"always\" to let table be always responsive\n */\n @property({ type: String, reflect: true }) responsive: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"always\";\n\n /**\n * Populate row header cells using Arrays\n */\n @property({ type: Array }) rowHeader: string[] = [];\n\n /**\n * Populate column header cells using Arrays only when <code>headerPosition=\"vertical\"</code> or <code>headerPosition=\"both\"</code>\n */\n @property({ type: Array }) columnHeader: string[] = [];\n\n /**\n * Populate data cells using Arrays\n */\n @property({ type: Array }) tableData: Array<(string | number)[]> = [];\n\n /**\n * Defines the placement of headers in the table (horizontal, vertical, or both)\n */\n @property({ type: String }) headerPosition: HeaderPosition = \"horizontal\";\n\n /** Used only for SSR to indicate the presence of the `default` slot. */\n @property({ type: Boolean }) hasDefaultSlot = false;\n\n /** @internal */\n private readonly hasSlotController = new HasSlotController(this, \"[default]\");\n\n connectedCallback() {\n super.connectedCallback();\n }\n\n updated() {\n if (!this.hasDefaultSlot) this.hasDefaultSlot = this.hasSlotController.test(\"[default]\");\n }\n\n private _renderTable() {\n if (this.headerPosition === \"horizontal\") {\n return html`\n <thead>\n <tr>\n ${this.rowHeader.map((header: string) => html` <th>${header}</th> `)}\n </tr>\n </thead>\n <tbody>\n ${this.tableData.map(\n row => html`\n <tr>\n ${row.map((cell: string) => html`<td>${cell}</td>`)}\n </tr>\n `\n )}\n </tbody>\n `;\n }\n\n if (this.headerPosition === \"both\") {\n return html`\n <thead>\n <tr>\n <th></th>\n ${this.rowHeader.map((header: string) => html` <th>${header}</th> `)}\n </tr>\n </thead>\n <tbody>\n ${this.tableData.map(\n (row, index) => html`\n <tr>\n <th>${this.columnHeader[index]}</th>\n ${row.map((cell: string) => html`<td>${cell}</td>`)}\n </tr>\n `\n )}\n </tbody>\n `;\n }\n\n if (this.headerPosition === \"vertical\") {\n const flippedTableData = this.tableData[0].map((_, colIndex) => this.tableData.map(row => row[colIndex]));\n\n return html`\n ${flippedTableData.map(\n (row, index) => html`\n <tr>\n <th>${this.columnHeader[index]}</th>\n ${row.map((cell: string) => html`<td>${cell}</td>`)}\n </tr>\n `\n )}\n `;\n }\n }\n\n render() {\n return html`\n <div\n class=${classMap({\n \"table-responsive\": this.responsive === \"always\",\n \"table-responsive-sm\": this.responsive === \"sm\",\n \"table-responsive-md\": this.responsive === \"md\",\n \"table-responsive-lg\": this.responsive === \"lg\",\n \"table-responsive-xl\": this.responsive === \"xl\"\n })}\n tabindex=\"0\"\n >\n <slot id=\"table-slot\" class=\"table\"></slot>\n\n ${!this.hasDefaultSlot\n ? html`<table class=\"table\">\n ${this._renderTable()}\n </table>`\n : \"\"}\n </div>\n `;\n }\n}\n\nexport default SgdsTable;\n"],"names":["tableStyle"],"mappings":";;;;;;;;;AAUA;;;;;AAKG;AAEG,MAAO,SAAU,SAAQ,WAAW,CAAA;AAA1C,IAAA,WAAA,GAAA;;AAQE;;AAEG;QACwB,IAAS,CAAA,SAAA,GAAa,EAAE,CAAC;A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A,CAAA,SAAA,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"sgds-table.js","sources":["../../../../src/components/Table/sgds-table.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\n\nimport tableStyle from \"./table.css\";\nimport { HasSlotController } from \"../../utils/slot\";\nimport { provide } from \"@lit/context\";\nimport { TableHeaderBackgroundContext } from \"./table-context\";\n\nexport type HeaderPosition = \"horizontal\" | \"vertical\" | \"both\";\n\n/**\n * @summary Table is used for displaying collections of data in organized rows and columns.\n * It supports two rendering methods: supply an array of data for automatic table generation, or use the slot to insert custom table elements for full structural control.\n *\n * @slot - Insert custom table elements (such as rows, headers, or cells) to define the table structure manually.\n */\n\nexport class SgdsTable extends SgdsElement {\n static styles = [...SgdsElement.styles, tableStyle];\n\n /**\n * Specifies the responsive breakpoint for the table.\n * Use \"sm\", \"md\", \"lg\", or \"xl\" to create responsive tables up to a particular breakpoint.\n * From that breakpoint and up, the table will behave normally and not scroll horizontally.\n * Use \"always\" to make the table always responsive.\n *\n * (@deprecated) Deprecated since 3.9.0 legacy from v2\n * @type {\"sm\" | \"md\" | \"lg\" | \"xl\" | \"always\"}\n */\n @property({ type: String, reflect: true }) responsive: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"always\";\n\n /**\n * Array of strings to populate row header cells.\n * @type {string[]}\n */\n @property({ type: Array }) rowHeader: string[] = [];\n\n /**\n * Array of strings to populate column header cells.\n * Only used when `headerPosition` is set to \"vertical\" or \"both\".\n * @type {string[]}\n */\n @property({ type: Array }) columnHeader: string[] = [];\n\n /**\n * Two-dimensional array of strings or numbers to populate table data cells.\n * @type {Array<(string | number)[]>}\n */\n @property({ type: Array }) tableData: Array<(string | number)[]> = [];\n\n /**\n * Defines the placement of headers in the table.\n * Use \"horizontal\" for top headers only, \"vertical\" for left headers only,\n * or \"both\" for both row and column headers.\n * @type {\"horizontal\" | \"vertical\" | \"both\"}\n * @default \"horizontal\"\n */\n @property({ type: String }) headerPosition: HeaderPosition = \"horizontal\";\n\n /**\n * Enables background styling on horizontal header rows.\n * When true, applies background color to header cells for better visual distinction.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean }) headerBackground = false;\n\n /**\n * Enables borders around table cells.\n * When true, displays visible borders between all table cells.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean }) tableBorder = false;\n\n /**\n * Indicates the presence of the default slot.\n * Used for server-side rendering to determine table structure.\n * @type {boolean}\n * @internal\n * @default false\n */\n @property({ type: Boolean }) hasDefaultSlot = false;\n\n @provide({ context: TableHeaderBackgroundContext })\n @state()\n private _headerBackground = false;\n\n /** @internal */\n private readonly hasSlotController = new HasSlotController(this, \"[default]\");\n\n connectedCallback() {\n super.connectedCallback();\n }\n\n updated() {\n if (!this.hasDefaultSlot) this.hasDefaultSlot = this.hasSlotController.test(\"[default]\");\n this._headerBackground = this.headerBackground;\n }\n\n private _renderTable() {\n if (this.headerPosition === \"horizontal\") {\n return html`\n <thead>\n <tr>\n ${this.rowHeader.map((header: string) => html` <th><div>${header}</div></th> `)}\n </tr>\n </thead>\n <tbody>\n ${this.tableData.map(\n row => html`\n <tr>\n ${row.map((cell: string) => html`<td><div>${cell}</div></td>`)}\n </tr>\n `\n )}\n </tbody>\n `;\n }\n\n if (this.headerPosition === \"both\") {\n return html`\n <thead>\n <tr>\n <th><div></div></th>\n ${this.rowHeader.map((header: string) => html` <th><div>${header}</div></th> `)}\n </tr>\n </thead>\n <tbody>\n ${this.tableData.map(\n (row, index) => html`\n <tr>\n <th><div>${this.columnHeader[index]}</div></th>\n ${row.map((cell: string) => html`<td><div>${cell}</div></td>`)}\n </tr>\n `\n )}\n </tbody>\n `;\n }\n\n if (this.headerPosition === \"vertical\") {\n const flippedTableData = this.tableData[0].map((_, colIndex) => this.tableData.map(row => row[colIndex]));\n\n return html`\n ${flippedTableData.map(\n (row, index) => html`\n <tr>\n <th><div>${this.columnHeader[index]}</div></th>\n ${row.map((cell: string) => html`<td><div>${cell}</div></td>`)}\n </tr>\n `\n )}\n `;\n }\n }\n\n render() {\n return html`\n <div\n class=${classMap({\n \"table-responsive\": this.responsive === \"always\",\n \"table-responsive-sm\": this.responsive === \"sm\",\n \"table-responsive-md\": this.responsive === \"md\",\n \"table-responsive-lg\": this.responsive === \"lg\",\n \"table-responsive-xl\": this.responsive === \"xl\"\n })}\n tabindex=\"0\"\n >\n <slot id=\"table-slot\" class=${classMap({ table: true, \"no-border\": !this.hasDefaultSlot })}></slot>\n\n ${!this.hasDefaultSlot\n ? html`<table class=\"table\">\n ${this._renderTable()}\n </table>`\n : \"\"}\n </div>\n `;\n }\n}\n\nexport default SgdsTable;\n"],"names":["tableStyle"],"mappings":";;;;;;;;;;;AAYA;;;;;AAKG;AAEG,MAAO,SAAU,SAAQ,WAAW,CAAA;AAA1C,IAAA,WAAA,GAAA;;AAcE;;;AAGG;QACwB,IAAS,CAAA,SAAA,GAAa,EAAE,CAAC;AAEpD;;;;AAIG;QACwB,IAAY,CAAA,YAAA,GAAa,EAAE,CAAC;AAEvD;;;AAGG;QACwB,IAAS,CAAA,SAAA,GAA+B,EAAE,CAAC;AAEtE;;;;;;AAMG;QACyB,IAAc,CAAA,cAAA,GAAmB,YAAY,CAAC;AAE1E;;;;;AAKG;QAC0B,IAAgB,CAAA,gBAAA,GAAG,KAAK,CAAC;AAEtD;;;;;AAKG;QAC0B,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;AAEjD;;;;;;AAMG;QAC0B,IAAc,CAAA,cAAA,GAAG,KAAK,CAAC;QAI5C,IAAiB,CAAA,iBAAA,GAAG,KAAK,CAAC;;QAGjB,IAAiB,CAAA,iBAAA,GAAG,IAAI,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;KA0F/E;IAxFC,iBAAiB,GAAA;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;KAC3B;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CAAA,CAAA,CAAA;AASpB,UAAA,CAAA;AAA5B,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAAwB,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAI5C,UAAA,CAAA;AAFP,IAAA,OAAO,CAAC,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC;AAClD,IAAA,KAAK,EAAE;AAC0B,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,mBAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var lit = require('lit');
7
7
 
8
- var css_248z = lit.css`:host{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);display:table-cell;padding:var(--sgds-padding-lg)}`;
8
+ var css_248z = lit.css`:host{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);display:table-cell;vertical-align:middle}.table-cell{align-items:center;display:flex;min-height:var(--sgds-dimension-56);padding:var(--sgds-padding-sm) var(--sgds-padding-md)}`;
9
9
 
10
10
  exports["default"] = css_248z;
11
11
  //# sourceMappingURL=table-cell.cjs.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { css } from 'lit';
3
3
 
4
- var css_248z = css`:host{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);display:table-cell;padding:var(--sgds-padding-lg)}`;
4
+ var css_248z = css`:host{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);display:table-cell;vertical-align:middle}.table-cell{align-items:center;display:flex;min-height:var(--sgds-dimension-56);padding:var(--sgds-padding-sm) var(--sgds-padding-md)}`;
5
5
 
6
6
  export { css_248z as default };
7
7
  //# sourceMappingURL=table-cell.js.map
@@ -0,0 +1,11 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var context = require('@lit/context');
7
+
8
+ const TableHeaderBackgroundContext = context.createContext("table-header-background");
9
+
10
+ exports.TableHeaderBackgroundContext = TableHeaderBackgroundContext;
11
+ //# sourceMappingURL=table-context.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-context.cjs.js","sources":["../../../../src/components/Table/table-context.ts"],"sourcesContent":["import { createContext } from \"@lit/context\";\n\nexport const TableHeaderBackgroundContext = createContext<boolean>(\"table-header-background\");\n"],"names":["createContext"],"mappings":";;;;;;;MAEa,4BAA4B,GAAGA,qBAAa,CAAU,yBAAyB;;;;"}
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ import { createContext } from '@lit/context';
3
+
4
+ const TableHeaderBackgroundContext = createContext("table-header-background");
5
+
6
+ export { TableHeaderBackgroundContext };
7
+ //# sourceMappingURL=table-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-context.js","sources":["../../../../src/components/Table/table-context.ts"],"sourcesContent":["import { createContext } from \"@lit/context\";\n\nexport const TableHeaderBackgroundContext = createContext<boolean>(\"table-header-background\");\n"],"names":[],"mappings":";;;MAEa,4BAA4B,GAAG,aAAa,CAAU,yBAAyB;;;;"}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var lit = require('lit');
7
7
 
8
- var css_248z = lit.css`:host{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-emphasis);display:table-cell;font-weight:700;padding:var(--sgds-padding-lg)}:host(:not([border])){border-color:var(--sgds-border-color-muted)}`;
8
+ var css_248z = lit.css`:host{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);display:table-cell;vertical-align:middle}:host([headerBackground]){background-color:var(--sgds-surface-raised)}.table-head{align-items:center;display:flex;font-weight:700;min-height:var(--sgds-dimension-56);padding:var(--sgds-padding-sm) var(--sgds-padding-md)}`;
9
9
 
10
10
  exports["default"] = css_248z;
11
11
  //# sourceMappingURL=table-head.cjs.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { css } from 'lit';
3
3
 
4
- var css_248z = css`:host{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-emphasis);display:table-cell;font-weight:700;padding:var(--sgds-padding-lg)}:host(:not([border])){border-color:var(--sgds-border-color-muted)}`;
4
+ var css_248z = css`:host{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);display:table-cell;vertical-align:middle}:host([headerBackground]){background-color:var(--sgds-surface-raised)}.table-head{align-items:center;display:flex;font-weight:700;min-height:var(--sgds-dimension-56);padding:var(--sgds-padding-sm) var(--sgds-padding-md)}`;
5
5
 
6
6
  export { css_248z as default };
7
7
  //# sourceMappingURL=table-head.js.map
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var lit = require('lit');
7
7
 
8
- var css_248z = lit.css`tbody,td,th,thead,tr{border:var(--sgds-border-width-0) solid;border-color:inherit}th{text-align:-webkit-match-parent}table{border-collapse:collapse;caption-side:bottom}.table{border-color:var(--sgds-border-color-default);display:table;vertical-align:top;width:100%}.hidden{display:none}.table>:not(caption) td,.table>:not(caption) th{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);padding:var(--sgds-padding-lg)}.table>tbody{vertical-align:inherit}.table>thead{vertical-align:bottom}.table>thead th{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-emphasis)}.table-group-divider{border-top:calc(var(--sgds-border-width)*2) solid}.table>:not(:first-child){border-top:var(--sgds-border-width-1) solid var(--sgds-border-color-emphasis)}.table-responsive{-webkit-overflow-scrolling:touch;overflow-x:auto}@media (max-width:575.98px){.table-responsive-sm{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:767.98px){.table-responsive-md{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:991.98px){.table-responsive-lg{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:1199.98px){.table-responsive-xl{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:1399.98px){.table-responsive-xxl{-webkit-overflow-scrolling:touch;overflow-x:auto}}`;
8
+ var css_248z = lit.css`tbody,td,th,thead,tr{border:var(--sgds-border-width-0) solid;border-color:inherit}th{text-align:-webkit-match-parent}table{border-collapse:collapse;caption-side:bottom}.table{display:table;width:100%}.hidden{display:none}.table>:not(caption) td,.table>:not(caption) th{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted)}.table>:not(caption) td>div,.table>:not(caption) th>div{align-items:center;display:flex;min-height:var(--sgds-dimension-56);padding:var(--sgds-padding-sm) var(--sgds-padding-md)}.table>tbody{vertical-align:inherit}.table>thead{vertical-align:bottom}.table>:not(:first-child){border-top:var(--sgds-border-width-1) solid var(--sgds-border-color-emphasis)}.table-responsive{-webkit-overflow-scrolling:touch;overflow-x:auto}:host([tableBorder]) .table{border:var(--sgds-border-width-1) solid;border-color:var(--sgds-border-color-muted);border-bottom:0}:host([tableBorder]) .table.no-border{border:0}:host([headerBackground]) th{background-color:var(--sgds-surface-raised)}@media (max-width:575.98px){.table-responsive-sm{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:767.98px){.table-responsive-md{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:991.98px){.table-responsive-lg{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:1199.98px){.table-responsive-xl{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:1399.98px){.table-responsive-xxl{-webkit-overflow-scrolling:touch;overflow-x:auto}}`;
9
9
 
10
10
  exports["default"] = css_248z;
11
11
  //# sourceMappingURL=table.cjs.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { css } from 'lit';
3
3
 
4
- var css_248z = css`tbody,td,th,thead,tr{border:var(--sgds-border-width-0) solid;border-color:inherit}th{text-align:-webkit-match-parent}table{border-collapse:collapse;caption-side:bottom}.table{border-color:var(--sgds-border-color-default);display:table;vertical-align:top;width:100%}.hidden{display:none}.table>:not(caption) td,.table>:not(caption) th{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);padding:var(--sgds-padding-lg)}.table>tbody{vertical-align:inherit}.table>thead{vertical-align:bottom}.table>thead th{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-emphasis)}.table-group-divider{border-top:calc(var(--sgds-border-width)*2) solid}.table>:not(:first-child){border-top:var(--sgds-border-width-1) solid var(--sgds-border-color-emphasis)}.table-responsive{-webkit-overflow-scrolling:touch;overflow-x:auto}@media (max-width:575.98px){.table-responsive-sm{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:767.98px){.table-responsive-md{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:991.98px){.table-responsive-lg{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:1199.98px){.table-responsive-xl{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:1399.98px){.table-responsive-xxl{-webkit-overflow-scrolling:touch;overflow-x:auto}}`;
4
+ var css_248z = css`tbody,td,th,thead,tr{border:var(--sgds-border-width-0) solid;border-color:inherit}th{text-align:-webkit-match-parent}table{border-collapse:collapse;caption-side:bottom}.table{display:table;width:100%}.hidden{display:none}.table>:not(caption) td,.table>:not(caption) th{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted)}.table>:not(caption) td>div,.table>:not(caption) th>div{align-items:center;display:flex;min-height:var(--sgds-dimension-56);padding:var(--sgds-padding-sm) var(--sgds-padding-md)}.table>tbody{vertical-align:inherit}.table>thead{vertical-align:bottom}.table>:not(:first-child){border-top:var(--sgds-border-width-1) solid var(--sgds-border-color-emphasis)}.table-responsive{-webkit-overflow-scrolling:touch;overflow-x:auto}:host([tableBorder]) .table{border:var(--sgds-border-width-1) solid;border-color:var(--sgds-border-color-muted);border-bottom:0}:host([tableBorder]) .table.no-border{border:0}:host([headerBackground]) th{background-color:var(--sgds-surface-raised)}@media (max-width:575.98px){.table-responsive-sm{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:767.98px){.table-responsive-md{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:991.98px){.table-responsive-lg{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:1199.98px){.table-responsive-xl{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:1399.98px){.table-responsive-xxl{-webkit-overflow-scrolling:touch;overflow-x:auto}}`;
5
5
 
6
6
  export { css_248z as default };
7
7
  //# sourceMappingURL=table.js.map
@@ -215,7 +215,6 @@ class SgdsTextarea extends validatorMixin.SgdsFormValidatorMixin(formControlElem
215
215
  }
216
216
  }
217
217
  SgdsTextarea.styles = [...formControlElement["default"].styles, formTextControl["default"], textarea["default"]];
218
- SgdsTextarea.formAssociated = true;
219
218
  tslib.__decorate([
220
219
  decorators_js.query("textarea.form-control-group")
221
220
  ], SgdsTextarea.prototype, "textarea", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"sgds-textarea.cjs.js","sources":["../../../../src/components/Textarea/sgds-textarea.ts"],"sourcesContent":["import { nothing } from \"lit\";\nimport { property, query, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { html } from \"lit/static-html.js\";\nimport FormControlElement from \"../../base/form-control-element\";\nimport { defaultValue } from \"../../utils/defaultvalue\";\nimport { SgdsFormControl } from \"../../utils/formSubmitController\";\nimport { SgdsFormValidatorMixin } from \"../../utils/validatorMixin\";\nimport { watch } from \"../../utils/watch\";\nimport textareaStyle from \"./textarea.css\";\nimport formTextControlStyles from \"../../styles/form-text-control.css\";\n\n/**\n * @summary Text areas allow for the collection of input longer than a single line.\n *\n * @slot invalidIcon - The slot for invalid icon\n *\n * @event sgds-change - Emitted when an alteration to the control's value is committed by the user.\n * @event sgds-input - Emitted when the control receives input and its value changes.\n * @event sgds-focus - Emitted when textarea is in focus.\n * @event sgds-blur - Emitted when textarea loses focus.\n */\nexport class SgdsTextarea extends SgdsFormValidatorMixin(FormControlElement) implements SgdsFormControl {\n static styles = [...FormControlElement.styles, formTextControlStyles, textareaStyle];\n static formAssociated = true;\n /**@internal */\n @query(\"textarea.form-control-group\") textarea: HTMLTextAreaElement;\n /**@internal */\n private resizeObserver: ResizeObserver;\n /**The textarea's name attribute */\n @property({ type: String, reflect: true }) name: string;\n /**The textarea's value attribute. */\n @property({ type: String, reflect: true }) value = \"\";\n /**Sets the minimum length of the textarea */\n @property({ type: Number, reflect: true }) minlength: number;\n /**Sets the maximum length of the textarea. When maxlength is defined, a word count appears on bottom right of the input*/\n @property({ type: Number, reflect: true }) maxlength: number;\n /**Enables spell checking on the textarea */\n @property({ type: Boolean, reflect: true }) spellcheck = false;\n /** The number of rows to display by default. */\n @property({ type: Number }) rows = 4;\n /**The textarea's placeholder text. */\n @property({ type: String, reflect: true }) placeholder = \"Placeholder\";\n /** Custom feedback text for error state when validated */\n @property({ type: String, reflect: true }) invalidFeedback = \"\";\n /**Autofocus the textarea */\n @property({ type: Boolean, reflect: true }) autofocus = false;\n /** Makes the textarea readonly. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n /** Controls how the textarea can be resized. */\n @property({ type: String, reflect: true }) resize: \"none\" | \"vertical\" | \"auto\" = \"vertical\";\n /** The native textarea's inputmode attribute. It hints at the type of data that might be entered by the user while editing the element or its contents. This allows a browser to display an appropriate virtual keyboard. */\n @property({ type: String, reflect: true }) inputmode:\n | \"none\"\n | \"text\"\n | \"decimal\"\n | \"numeric\"\n | \"tel\"\n | \"search\"\n | \"email\"\n | \"url\";\n /** The native textarea's autocorrect attribute. */\n @property({ type: Boolean, reflect: true }) autocorrect: boolean;\n /** @internal Gets or sets the default value used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */\n @defaultValue()\n defaultValue = \"\";\n /** Allows invalidFeedback, invalid and valid styles to be visible with the input */\n @property({ type: Boolean, reflect: true }) hasFeedback = false;\n\n /** Makes the textarea as a required field. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /** The textarea's hint text */\n @property({ reflect: true }) hintText = \"\";\n\n @state() private _isTouched = false;\n\n /** Sets focus on the textarea. */\n public focus(options?: FocusOptions) {\n this.textarea.focus(options);\n }\n /** Sets blur on the textarea. */\n public blur() {\n this.textarea.blur();\n }\n\n /**\n * Checks for validity. Under the hood, HTMLFormElement's reportValidity method calls this method to check for component's validity state\n * Note that the native error popup is prevented for SGDS form components by default. Instead the validation message shows up in the feedback container of SgdsInput\n */\n public reportValidity(): boolean {\n return this._mixinReportValidity();\n }\n /**\n * Checks for validity without any native error popup message\n */\n public checkValidity(): boolean {\n return this._mixinCheckValidity();\n }\n /**\n * Returns the ValidityState object\n */\n public get validity(): ValidityState {\n return this._mixinGetValidity();\n }\n /**\n * Returns the validation message based on the ValidityState\n */\n public get validationMessage() {\n return this._mixinGetValidationMessage();\n }\n\n /** Selects all the text in the textarea. */\n public select() {\n this.textarea.select();\n }\n private _handleInvalid(e: Event) {\n e.preventDefault();\n this.invalid = true;\n }\n\n protected _handleChange(e: Event) {\n this.value = this.input.value;\n this.emit(\"sgds-change\");\n super._mixinHandleChange(e);\n }\n private _handleInputChange(e: Event) {\n this.value = this.input.value;\n this.emit(\"sgds-input\");\n super._mixinHandleInputChange(e);\n }\n\n private _handleFocus() {\n this.emit(\"sgds-focus\");\n }\n\n private _handleBlur() {\n this._isTouched = true;\n this.emit(\"sgds-blur\");\n }\n\n /** @internal */\n @watch(\"rows\", { waitUntilFirstUpdate: true })\n _handleRowsChange() {\n this._setTextareaHeight();\n }\n\n private _setTextareaHeight() {\n if (this.resize === \"auto\") {\n this.textarea.style.height = \"auto\";\n this.textarea.style.height = `${this.textarea.scrollHeight}px`;\n } else {\n (this.textarea.style.height as string | undefined) = undefined;\n }\n }\n /** @internal */\n @watch(\"_isTouched\", { waitUntilFirstUpdate: true })\n _handleIsTouched() {\n if (this._isTouched) {\n this.invalid = !this.textarea.checkValidity();\n }\n }\n\n /** @internal */\n @watch(\"disabled\", { waitUntilFirstUpdate: true })\n _handleDisabledChange() {\n // Disabled form controls are always valid, so we need to recheck validity when the state changes\n this.setInvalid(false);\n }\n\n /** @internal */\n @watch(\"value\", { waitUntilFirstUpdate: true })\n _handleValueChange() {\n this.updateComplete.then(() => this._setTextareaHeight());\n }\n\n protected _renderHintText() {\n const hintTextTemplate = html` <div id=\"${this._controlId}Help\" class=\"form-text\">${this.hintText}</div> `;\n return this.hintText && hintTextTemplate;\n }\n\n private _wordCount() {\n return html`\n <div\n class=\"form-text word-count ${classMap({\n \"invalid-feedback\": this.invalid && this.hasFeedback\n })}\"\n >\n ${this.value.length}/${this.maxlength}\n </div>\n `;\n }\n render() {\n return html`\n <div\n class=\"form-control-container ${classMap({\n disabled: this.disabled\n })}\"\n >\n <label for=${this._controlId} class=\"form-label\">${this.label}</label>\n <textarea\n class=${classMap({\n \"form-control-group\": true,\n // \"form-control\": true,\n \"is-invalid\": this.hasFeedback && this.invalid,\n \"textarea-resize-none\": this.resize === \"none\",\n \"textarea-resize-vertical\": this.resize === \"vertical\",\n \"textarea-resize-auto\": this.resize === \"auto\",\n readonly: this.readonly,\n disabled: this.disabled\n })}\n id=${this._controlId}\n name=${ifDefined(this.name)}\n rows=${ifDefined(this.rows)}\n placeholder=${ifDefined(this.placeholder)}\n minlength=${ifDefined(this.minlength)}\n maxlength=${ifDefined(this.maxlength)}\n .value=${live(this.value)}\n aria-invalid=${this.invalid ? \"true\" : \"false\"}\n spellcheck=${ifDefined(this.spellcheck)}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n ?autofocus=${this.autofocus}\n autocorrect=${ifDefined(this.autocorrect)}\n inputmode=${ifDefined(this.inputmode)}\n @input=${(e: Event) => this._handleInputChange(e)}\n @change=${(e: Event) => this._handleChange(e)}\n @invalid=${(e: Event) => this._handleInvalid(e)}\n @focus=${this._handleFocus}\n @blur=${this._handleBlur}\n ></textarea>\n <div class=\"textarea-info-container\">\n ${this.invalid && this.hasFeedback\n ? html`\n <div class=\"invalid-feedback-container\">\n <sgds-icon name=\"exclamation-circle-fill\" size=\"md\"></sgds-icon>\n <div id=\"${this._controlId}-invalid\" class=\"invalid-feedback\">\n ${this.invalidFeedback ? this.invalidFeedback : this.input.validationMessage}\n </div>\n </div>\n `\n : html`${this._renderHintText()}`}\n ${this.maxlength > 0 ? this._wordCount() : nothing}\n </div>\n </div>\n `;\n }\n}\n\nexport default SgdsTextarea;\n"],"names":["SgdsFormValidatorMixin","FormControlElement","html","classMap","ifDefined","live","nothing","formTextControlStyles","textareaStyle","__decorate","query","property","defaultValue","state","watch"],"mappings":";;;;;;;;;;;;;;;;;;;AAcA;;;;;;;;;AASG;MACU,YAAa,SAAQA,qCAAsB,CAACC,6BAAkB,CAAC,CAAA;AAA5E,IAAA,WAAA,GAAA;;;QAU6C,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;;QAMV,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;;QAEnC,IAAI,CAAA,IAAA,GAAG,CAAC,CAAC;;QAEM,IAAW,CAAA,WAAA,GAAG,aAAa,CAAC;;QAE5B,IAAe,CAAA,eAAA,GAAG,EAAE,CAAC;;QAEpB,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;;QAElB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAElB,IAAM,CAAA,MAAA,GAAiC,UAAU,CAAC;;QAe7F,IAAY,CAAA,YAAA,GAAG,EAAE,CAAC;;QAE0B,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;;QAGpB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAGhC,IAAQ,CAAA,QAAA,GAAG,EAAE,CAAC;QAE1B,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;KA6KrC;;AA1KQ,IAAA,KAAK,CAAC,OAAsB,EAAA;AACjC,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;KAC9B;;IAEM,IAAI,GAAA;AACT,QAAA,IAAI,C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IAAI,EAAE,CAAC;AAIjD,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,uBAAA,EAAA,IAAA,CAAA,CAAA;AAIDL,gBAAA,CAAA;IADCK,WAAK,CAAC,OAAO,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAG9C,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,oBAAA,EAAA,IAAA,CAAA;;;;;"}
1
+ {"version":3,"file":"sgds-textarea.cjs.js","sources":["../../../../src/components/Textarea/sgds-textarea.ts"],"sourcesContent":["import { nothing } from \"lit\";\nimport { property, query, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { html } from \"lit/static-html.js\";\nimport FormControlElement from \"../../base/form-control-element\";\nimport { defaultValue } from \"../../utils/defaultvalue\";\nimport { SgdsFormControl } from \"../../utils/formSubmitController\";\nimport { SgdsFormValidatorMixin } from \"../../utils/validatorMixin\";\nimport { watch } from \"../../utils/watch\";\nimport textareaStyle from \"./textarea.css\";\nimport formTextControlStyles from \"../../styles/form-text-control.css\";\n\n/**\n * @summary Text areas allow for the collection of input longer than a single line.\n *\n * @slot invalidIcon - The slot for invalid icon\n *\n * @event sgds-change - Emitted when an alteration to the control's value is committed by the user.\n * @event sgds-input - Emitted when the control receives input and its value changes.\n * @event sgds-focus - Emitted when textarea is in focus.\n * @event sgds-blur - Emitted when textarea loses focus.\n */\nexport class SgdsTextarea extends SgdsFormValidatorMixin(FormControlElement) implements SgdsFormControl {\n static styles = [...FormControlElement.styles, formTextControlStyles, textareaStyle];\n /**@internal */\n @query(\"textarea.form-control-group\") textarea: HTMLTextAreaElement;\n /**@internal */\n private resizeObserver: ResizeObserver;\n /**The textarea's name attribute */\n @property({ type: String, reflect: true }) name: string;\n /**The textarea's value attribute. */\n @property({ type: String, reflect: true }) value = \"\";\n /**Sets the minimum length of the textarea */\n @property({ type: Number, reflect: true }) minlength: number;\n /**Sets the maximum length of the textarea. When maxlength is defined, a word count appears on bottom right of the input*/\n @property({ type: Number, reflect: true }) maxlength: number;\n /**Enables spell checking on the textarea */\n @property({ type: Boolean, reflect: true }) spellcheck = false;\n /** The number of rows to display by default. */\n @property({ type: Number }) rows = 4;\n /**The textarea's placeholder text. */\n @property({ type: String, reflect: true }) placeholder = \"Placeholder\";\n /** Custom feedback text for error state when validated */\n @property({ type: String, reflect: true }) invalidFeedback = \"\";\n /**Autofocus the textarea */\n @property({ type: Boolean, reflect: true }) autofocus = false;\n /** Makes the textarea readonly. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n /** Controls how the textarea can be resized. */\n @property({ type: String, reflect: true }) resize: \"none\" | \"vertical\" | \"auto\" = \"vertical\";\n /** The native textarea's inputmode attribute. It hints at the type of data that might be entered by the user while editing the element or its contents. This allows a browser to display an appropriate virtual keyboard. */\n @property({ type: String, reflect: true }) inputmode:\n | \"none\"\n | \"text\"\n | \"decimal\"\n | \"numeric\"\n | \"tel\"\n | \"search\"\n | \"email\"\n | \"url\";\n /** The native textarea's autocorrect attribute. */\n @property({ type: Boolean, reflect: true }) autocorrect: boolean;\n /** @internal Gets or sets the default value used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */\n @defaultValue()\n defaultValue = \"\";\n /** Allows invalidFeedback, invalid and valid styles to be visible with the input */\n @property({ type: Boolean, reflect: true }) hasFeedback = false;\n\n /** Makes the textarea as a required field. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /** The textarea's hint text */\n @property({ reflect: true }) hintText = \"\";\n\n @state() private _isTouched = false;\n\n /** Sets focus on the textarea. */\n public focus(options?: FocusOptions) {\n this.textarea.focus(options);\n }\n /** Sets blur on the textarea. */\n public blur() {\n this.textarea.blur();\n }\n\n /**\n * Checks for validity. Under the hood, HTMLFormElement's reportValidity method calls this method to check for component's validity state\n * Note that the native error popup is prevented for SGDS form components by default. Instead the validation message shows up in the feedback container of SgdsInput\n */\n public reportValidity(): boolean {\n return this._mixinReportValidity();\n }\n /**\n * Checks for validity without any native error popup message\n */\n public checkValidity(): boolean {\n return this._mixinCheckValidity();\n }\n /**\n * Returns the ValidityState object\n */\n public get validity(): ValidityState {\n return this._mixinGetValidity();\n }\n /**\n * Returns the validation message based on the ValidityState\n */\n public get validationMessage() {\n return this._mixinGetValidationMessage();\n }\n\n /** Selects all the text in the textarea. */\n public select() {\n this.textarea.select();\n }\n private _handleInvalid(e: Event) {\n e.preventDefault();\n this.invalid = true;\n }\n\n protected _handleChange(e: Event) {\n this.value = this.input.value;\n this.emit(\"sgds-change\");\n super._mixinHandleChange(e);\n }\n private _handleInputChange(e: Event) {\n this.value = this.input.value;\n this.emit(\"sgds-input\");\n super._mixinHandleInputChange(e);\n }\n\n private _handleFocus() {\n this.emit(\"sgds-focus\");\n }\n\n private _handleBlur() {\n this._isTouched = true;\n this.emit(\"sgds-blur\");\n }\n\n /** @internal */\n @watch(\"rows\", { waitUntilFirstUpdate: true })\n _handleRowsChange() {\n this._setTextareaHeight();\n }\n\n private _setTextareaHeight() {\n if (this.resize === \"auto\") {\n this.textarea.style.height = \"auto\";\n this.textarea.style.height = `${this.textarea.scrollHeight}px`;\n } else {\n (this.textarea.style.height as string | undefined) = undefined;\n }\n }\n /** @internal */\n @watch(\"_isTouched\", { waitUntilFirstUpdate: true })\n _handleIsTouched() {\n if (this._isTouched) {\n this.invalid = !this.textarea.checkValidity();\n }\n }\n\n /** @internal */\n @watch(\"disabled\", { waitUntilFirstUpdate: true })\n _handleDisabledChange() {\n // Disabled form controls are always valid, so we need to recheck validity when the state changes\n this.setInvalid(false);\n }\n\n /** @internal */\n @watch(\"value\", { waitUntilFirstUpdate: true })\n _handleValueChange() {\n this.updateComplete.then(() => this._setTextareaHeight());\n }\n\n protected _renderHintText() {\n const hintTextTemplate = html` <div id=\"${this._controlId}Help\" class=\"form-text\">${this.hintText}</div> `;\n return this.hintText && hintTextTemplate;\n }\n\n private _wordCount() {\n return html`\n <div\n class=\"form-text word-count ${classMap({\n \"invalid-feedback\": this.invalid && this.hasFeedback\n })}\"\n >\n ${this.value.length}/${this.maxlength}\n </div>\n `;\n }\n render() {\n return html`\n <div\n class=\"form-control-container ${classMap({\n disabled: this.disabled\n })}\"\n >\n <label for=${this._controlId} class=\"form-label\">${this.label}</label>\n <textarea\n class=${classMap({\n \"form-control-group\": true,\n // \"form-control\": true,\n \"is-invalid\": this.hasFeedback && this.invalid,\n \"textarea-resize-none\": this.resize === \"none\",\n \"textarea-resize-vertical\": this.resize === \"vertical\",\n \"textarea-resize-auto\": this.resize === \"auto\",\n readonly: this.readonly,\n disabled: this.disabled\n })}\n id=${this._controlId}\n name=${ifDefined(this.name)}\n rows=${ifDefined(this.rows)}\n placeholder=${ifDefined(this.placeholder)}\n minlength=${ifDefined(this.minlength)}\n maxlength=${ifDefined(this.maxlength)}\n .value=${live(this.value)}\n aria-invalid=${this.invalid ? \"true\" : \"false\"}\n spellcheck=${ifDefined(this.spellcheck)}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n ?autofocus=${this.autofocus}\n autocorrect=${ifDefined(this.autocorrect)}\n inputmode=${ifDefined(this.inputmode)}\n @input=${(e: Event) => this._handleInputChange(e)}\n @change=${(e: Event) => this._handleChange(e)}\n @invalid=${(e: Event) => this._handleInvalid(e)}\n @focus=${this._handleFocus}\n @blur=${this._handleBlur}\n ></textarea>\n <div class=\"textarea-info-container\">\n ${this.invalid && this.hasFeedback\n ? html`\n <div class=\"invalid-feedback-container\">\n <sgds-icon name=\"exclamation-circle-fill\" size=\"md\"></sgds-icon>\n <div id=\"${this._controlId}-invalid\" class=\"invalid-feedback\">\n ${this.invalidFeedback ? this.invalidFeedback : this.input.validationMessage}\n </div>\n </div>\n `\n : html`${this._renderHintText()}`}\n ${this.maxlength > 0 ? this._wordCount() : nothing}\n </div>\n </div>\n `;\n }\n}\n\nexport default SgdsTextarea;\n"],"names":["SgdsFormValidatorMixin","FormControlElement","html","classMap","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extarea.styles = [...FormControlElement.styles, css_248z, css_248z$1];
214
- SgdsTextarea.formAssociated = true;
215
214
  __decorate([
216
215
  query("textarea.form-control-group")
217
216
  ], SgdsTextarea.prototype, "textarea", void 0);