@eccenca/gui-elements 23.3.1 → 23.4.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 (145) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +3 -2
  3. package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  4. package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js +11 -6
  5. package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
  6. package/dist/cjs/cmem/DateTimeDisplay/ElapsedDateTimeDisplay.js +7 -4
  7. package/dist/cjs/cmem/DateTimeDisplay/ElapsedDateTimeDisplay.js.map +1 -1
  8. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +61 -19
  9. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  10. package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js +4 -18
  11. package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
  12. package/dist/cjs/components/AutoSuggestion/ExtendedCodeEditor.js +65 -0
  13. package/dist/cjs/components/AutoSuggestion/ExtendedCodeEditor.js.map +1 -0
  14. package/dist/cjs/components/AutoSuggestion/index.js +3 -3
  15. package/dist/cjs/components/AutoSuggestion/index.js.map +1 -1
  16. package/dist/cjs/components/Card/CardHeader.js +19 -18
  17. package/dist/cjs/components/Card/CardHeader.js.map +1 -1
  18. package/dist/cjs/components/Grid/GridColumn.js +3 -3
  19. package/dist/cjs/components/Grid/GridColumn.js.map +1 -1
  20. package/dist/cjs/components/Icon/TestIcon.js +4 -4
  21. package/dist/cjs/components/Icon/TestIcon.js.map +1 -1
  22. package/dist/cjs/components/Icon/canonicalIconNames.js +5 -0
  23. package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
  24. package/dist/cjs/components/PropertyValuePair/PropertyName.js +4 -2
  25. package/dist/cjs/components/PropertyValuePair/PropertyName.js.map +1 -1
  26. package/dist/cjs/components/PropertyValuePair/PropertyValue.js +6 -4
  27. package/dist/cjs/components/PropertyValuePair/PropertyValue.js.map +1 -1
  28. package/dist/cjs/components/PropertyValuePair/PropertyValuePair.js +13 -3
  29. package/dist/cjs/components/PropertyValuePair/PropertyValuePair.js.map +1 -1
  30. package/dist/cjs/components/Skeleton/Skeleton.js +30 -0
  31. package/dist/cjs/components/Skeleton/Skeleton.js.map +1 -0
  32. package/dist/cjs/components/Skeleton/classnames.js +6 -0
  33. package/dist/cjs/components/Skeleton/classnames.js.map +1 -0
  34. package/dist/cjs/components/Table/TableCell.js +3 -2
  35. package/dist/cjs/components/Table/TableCell.js.map +1 -1
  36. package/dist/cjs/components/TextField/useTextValidation.js.map +1 -1
  37. package/dist/cjs/components/index.js +1 -0
  38. package/dist/cjs/components/index.js.map +1 -1
  39. package/dist/cjs/index.js +2 -0
  40. package/dist/cjs/index.js.map +1 -1
  41. package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js +3 -2
  42. package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
  43. package/dist/esm/cmem/ActivityControl/SilkActivityControl.js +14 -9
  44. package/dist/esm/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
  45. package/dist/esm/cmem/DateTimeDisplay/ElapsedDateTimeDisplay.js +8 -4
  46. package/dist/esm/cmem/DateTimeDisplay/ElapsedDateTimeDisplay.js.map +1 -1
  47. package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +82 -40
  48. package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  49. package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js +6 -20
  50. package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
  51. package/dist/esm/components/AutoSuggestion/ExtendedCodeEditor.js +70 -0
  52. package/dist/esm/components/AutoSuggestion/ExtendedCodeEditor.js.map +1 -0
  53. package/dist/esm/components/AutoSuggestion/index.js +2 -2
  54. package/dist/esm/components/AutoSuggestion/index.js.map +1 -1
  55. package/dist/esm/components/Card/CardHeader.js +15 -14
  56. package/dist/esm/components/Card/CardHeader.js.map +1 -1
  57. package/dist/esm/components/Grid/GridColumn.js +3 -3
  58. package/dist/esm/components/Grid/GridColumn.js.map +1 -1
  59. package/dist/esm/components/Icon/TestIcon.js +4 -4
  60. package/dist/esm/components/Icon/TestIcon.js.map +1 -1
  61. package/dist/esm/components/Icon/canonicalIconNames.js +5 -0
  62. package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
  63. package/dist/esm/components/PropertyValuePair/PropertyName.js +4 -2
  64. package/dist/esm/components/PropertyValuePair/PropertyName.js.map +1 -1
  65. package/dist/esm/components/PropertyValuePair/PropertyValue.js +6 -4
  66. package/dist/esm/components/PropertyValuePair/PropertyValue.js.map +1 -1
  67. package/dist/esm/components/PropertyValuePair/PropertyValuePair.js +13 -3
  68. package/dist/esm/components/PropertyValuePair/PropertyValuePair.js.map +1 -1
  69. package/dist/esm/components/Skeleton/Skeleton.js +24 -0
  70. package/dist/esm/components/Skeleton/Skeleton.js.map +1 -0
  71. package/dist/esm/components/Skeleton/classnames.js +3 -0
  72. package/dist/esm/components/Skeleton/classnames.js.map +1 -0
  73. package/dist/esm/components/Table/TableCell.js +4 -3
  74. package/dist/esm/components/Table/TableCell.js.map +1 -1
  75. package/dist/esm/components/TextField/useTextValidation.js.map +1 -1
  76. package/dist/esm/components/index.js +1 -0
  77. package/dist/esm/components/index.js.map +1 -1
  78. package/dist/esm/index.js +2 -0
  79. package/dist/esm/index.js.map +1 -1
  80. package/dist/types/cmem/ActivityControl/ActivityControlTypes.d.ts +1 -0
  81. package/dist/types/cmem/ActivityControl/ActivityControlWidget.d.ts +4 -0
  82. package/dist/types/cmem/ActivityControl/SilkActivityControl.d.ts +8 -4
  83. package/dist/types/cmem/DateTimeDisplay/ElapsedDateTimeDisplay.d.ts +5 -4
  84. package/dist/types/components/AutoSuggestion/AutoSuggestion.d.ts +8 -2
  85. package/dist/types/components/AutoSuggestion/AutoSuggestionList.d.ts +6 -4
  86. package/dist/types/components/AutoSuggestion/{SingleLineCodeEditor.d.ts → ExtendedCodeEditor.d.ts} +7 -4
  87. package/dist/types/components/AutoSuggestion/index.d.ts +3 -3
  88. package/dist/types/components/Card/CardHeader.d.ts +2 -2
  89. package/dist/types/components/Grid/GridColumn.d.ts +1 -0
  90. package/dist/types/components/Icon/TestIcon.d.ts +2 -1
  91. package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
  92. package/dist/types/components/PropertyValuePair/PropertyName.d.ts +7 -1
  93. package/dist/types/components/PropertyValuePair/PropertyValue.d.ts +7 -1
  94. package/dist/types/components/PropertyValuePair/PropertyValuePair.d.ts +5 -1
  95. package/dist/types/components/Skeleton/Skeleton.d.ts +13 -0
  96. package/dist/types/components/Skeleton/classnames.d.ts +1 -0
  97. package/dist/types/components/Table/TableCell.d.ts +7 -2
  98. package/dist/types/components/TextField/useTextValidation.d.ts +1 -0
  99. package/dist/types/components/index.d.ts +1 -0
  100. package/dist/types/index.d.ts +3 -0
  101. package/package.json +6 -3
  102. package/src/cmem/ActivityControl/ActivityControlTypes.ts +2 -0
  103. package/src/cmem/ActivityControl/ActivityControlWidget.tsx +6 -0
  104. package/src/cmem/ActivityControl/SilkActivityControl.tsx +78 -46
  105. package/src/cmem/DateTimeDisplay/ElapsedDateTimeDisplay.tsx +12 -4
  106. package/src/components/AutoSuggestion/AutoSuggestion.tsx +84 -31
  107. package/src/components/AutoSuggestion/AutoSuggestionList.tsx +11 -42
  108. package/src/components/AutoSuggestion/ExtendedCodeEditor.tsx +129 -0
  109. package/src/components/AutoSuggestion/index.ts +3 -11
  110. package/src/components/AutoSuggestion/tests/AutoSuggestionList.test.tsx +83 -84
  111. package/src/components/AutoSuggestion/tests/{SingleLineCodeEditor.test.tsx → ExtendedCodeEditor.test.tsx} +7 -7
  112. package/src/components/Card/CardHeader.tsx +23 -25
  113. package/src/components/Grid/GridColumn.tsx +15 -13
  114. package/src/components/Icon/TestIcon.tsx +9 -13
  115. package/src/components/Icon/canonicalIconNames.tsx +10 -0
  116. package/src/components/Icon/stories/Icon.stories.tsx +17 -30
  117. package/src/components/Icon/stories/TestIcon.stories.tsx +8 -9
  118. package/src/components/OverviewItem/overviewitem.scss +27 -33
  119. package/src/components/Pagination/pagination.scss +6 -1
  120. package/src/components/PropertyValuePair/PropertyName.tsx +21 -2
  121. package/src/components/PropertyValuePair/PropertyValue.tsx +21 -5
  122. package/src/components/PropertyValuePair/PropertyValuePair.tsx +23 -4
  123. package/src/components/PropertyValuePair/propertyvalue.scss +6 -1
  124. package/src/components/PropertyValuePair/stories/PropertyName.stories.tsx +18 -0
  125. package/src/components/PropertyValuePair/stories/PropertyValue.stories.tsx +18 -0
  126. package/src/components/PropertyValuePair/stories/PropertyValueList.stories.tsx +33 -0
  127. package/src/components/PropertyValuePair/stories/PropertyValuePair.stories.tsx +29 -0
  128. package/src/components/Skeleton/Skeleton.stories.tsx +29 -0
  129. package/src/components/Skeleton/Skeleton.tsx +32 -0
  130. package/src/components/Skeleton/classnames.ts +3 -0
  131. package/src/components/Skeleton/skeleton.scss +1 -0
  132. package/src/components/Table/TableCell.tsx +12 -8
  133. package/src/components/Table/stories/TableCell.stories.tsx +30 -0
  134. package/src/components/Table/table.scss +96 -50
  135. package/src/components/TextField/stories/TextField.stories.tsx +21 -18
  136. package/src/components/TextField/useTextValidation.ts +82 -68
  137. package/src/components/index.scss +1 -0
  138. package/src/components/index.ts +1 -0
  139. package/src/extensions/codemirror/_codemirror.scss +1 -0
  140. package/src/index.ts +2 -0
  141. package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js +0 -53
  142. package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js.map +0 -1
  143. package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js +0 -47
  144. package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js.map +0 -1
  145. package/src/components/AutoSuggestion/SingleLineCodeEditor.tsx +0 -110
@@ -1,7 +1,11 @@
1
+ @use "sass:color";
2
+
1
3
  // import libs
2
4
  @use "~@carbon/styles/scss/components/data-table/data-table";
5
+
3
6
  // currently not needed @import "~@carbon/styles/scss/components/data-table/action";
4
7
  @use "~@carbon/styles/scss/components/data-table/expandable/index" as table-expandable;
8
+
5
9
  // currently not needed @import ~@carbon/styles/scss/components/data-table/skeleton;
6
10
  @use "~@carbon/styles/scss/components/data-table/sort/index" as table-sort;
7
11
  @include data-table.data-table;
@@ -17,11 +21,15 @@ $eccgui-size-tablecell-font-weight: $eccgui-font-weight-regular !default;
17
21
  $eccgui-size-tableheader-font-weight: $eccgui-font-weight-bold !default;
18
22
  $eccgui-color-table-background: $card-background-color !default;
19
23
  $eccgui-color-tableheader-background: $button-background-color !default;
20
- $eccgui-color-tablerow-background-even: lighten($menu-item-color-hover, 24%) !default;
24
+ $eccgui-color-tablerow-background-even: color.adjust($menu-item-color-hover, $lightness: 24%) !default;
21
25
  $eccgui-color-tablerow-background-odd: transparent !default;
22
26
  $eccgui-color-tablerow-hover: $menu-item-color-hover !default;
23
27
  $eccgui-color-tablerow-selected: rgba($eccgui-color-accent, 0.1) !default;
24
- $eccgui-color-tablerow-selected-hover: mix($eccgui-color-tablerow-selected, $eccgui-color-tablerow-hover, 50%) !default;
28
+ $eccgui-color-tablerow-selected-hover: color.mix(
29
+ $eccgui-color-tablerow-selected,
30
+ $eccgui-color-tablerow-hover,
31
+ 50%
32
+ ) !default;
25
33
  $eccgui-color-tablerow-border: $pt-divider-black !default;
26
34
 
27
35
  // changes
@@ -32,8 +40,29 @@ $eccgui-color-tablerow-border: $pt-divider-black !default;
32
40
 
33
41
  .#{$prefix}--data-table {
34
42
  min-width: 100%;
43
+
35
44
  --#{$eccgui}-color-border: #{$eccgui-color-tablerow-border};
36
45
  --#{$eccgui}-divider-row: none;
46
+
47
+ thead th,
48
+ tbody td,
49
+ tbody th {
50
+ padding-right: $eccgui-size-block-whitespace * 0.5;
51
+ padding-left: $eccgui-size-block-whitespace * 0.5;
52
+ overflow: hidden;
53
+
54
+ &.#{$prefix}--table-expand {
55
+ width: $button-height;
56
+ height: $button-height;
57
+ padding-top: $eccgui-size-tablecell-padding-regular * 1.05;
58
+ padding-left: 0;
59
+ }
60
+ }
61
+
62
+ thead th.#{$prefix}--table-expand {
63
+ padding-top: 0;
64
+ padding-bottom: 0;
65
+ }
37
66
  }
38
67
 
39
68
  .#{$eccgui}-simpletable--haslayout {
@@ -45,14 +74,14 @@ $eccgui-color-tablerow-border: $pt-divider-black !default;
45
74
  }
46
75
 
47
76
  .#{$prefix}--data-table thead {
48
- background-color: transparent;
49
77
  font-weight: $eccgui-size-tablecell-font-weight;
78
+ background-color: transparent;
50
79
  }
51
80
 
52
81
  .#{$prefix}--data-table th,
53
82
  .#{$prefix}--data-table-header {
54
- background-color: $eccgui-color-tableheader-background;
55
83
  font-weight: $eccgui-size-tableheader-font-weight;
84
+ background-color: $eccgui-color-tableheader-background;
56
85
  }
57
86
  .#{$prefix}--data-table th.#{$prefix}--table-column-checkbox {
58
87
  background: $eccgui-color-tableheader-background;
@@ -65,10 +94,10 @@ $eccgui-color-tablerow-border: $pt-divider-black !default;
65
94
  }
66
95
 
67
96
  .#{$prefix}--data-table .#{$prefix}--table-header-label {
68
- padding: $eccgui-size-tablecell-padding-regular 0;
69
- overflow: hidden;
70
97
  flex-shrink: 1;
71
98
  min-width: 0;
99
+ padding: $eccgui-size-tablecell-padding-regular 0;
100
+ overflow: hidden;
72
101
  text-overflow: ellipsis;
73
102
  }
74
103
 
@@ -76,13 +105,19 @@ $eccgui-color-tablerow-border: $pt-divider-black !default;
76
105
  .#{$prefix}--data-table tbody th {
77
106
  padding-top: $eccgui-size-tablecell-padding-regular * 1.05;
78
107
  padding-bottom: $eccgui-size-tablecell-padding-regular * 0.95;
79
-
80
108
  vertical-align: top;
109
+ background: var(--#{$eccgui}-color-cell) !important;
110
+ border-top: 1px var(--#{$eccgui}-divider-row) var(--#{$eccgui}-color-cell) !important;
111
+ border-bottom: 1px var(--#{$eccgui}-divider-row) var(--#{$eccgui}-color-border) !important;
81
112
 
82
113
  &.#{$eccgui}-simpletable__cell--middle {
83
114
  vertical-align: middle;
84
115
  }
85
116
 
117
+ &.#{$eccgui}-simpletable__cell--center {
118
+ text-align: center;
119
+ }
120
+
86
121
  & + td:first-of-type {
87
122
  padding-left: $spacing-05;
88
123
  }
@@ -94,49 +129,25 @@ $eccgui-color-tablerow-border: $pt-divider-black !default;
94
129
  min-width: 0;
95
130
  }
96
131
 
97
- .#{$prefix}--data-table {
98
- thead th, tbody td, tbody th {
99
- padding-left: $eccgui-size-block-whitespace * 0.5;
100
- padding-right: $eccgui-size-block-whitespace * 0.5;
101
- overflow: hidden;
102
-
103
- &.#{$prefix}--table-expand {
104
- height: $button-height;
105
- width: $button-height;
106
- padding-top: $eccgui-size-tablecell-padding-regular * 1.05;
107
- padding-left: 0;
108
- }
109
- }
110
-
111
- thead th.#{$prefix}--table-expand {
112
- padding-top: 0;
113
- padding-bottom: 0;
114
- }
115
- }
116
-
117
132
  .#{$prefix}--table-expand__button {
118
- height: $button-height;
119
133
  width: $button-height;
120
- }
121
-
122
- .#{$prefix}--data-table td,
123
- .#{$prefix}--data-table tbody th {
124
- border-top: 1px var(--#{$eccgui}-divider-row) var(--#{$eccgui}-color-cell) !important;
125
- border-bottom: 1px var(--#{$eccgui}-divider-row) var(--#{$eccgui}-color-border) !important;
126
- background: var(--#{$eccgui}-color-cell) !important;
134
+ height: $button-height;
127
135
  }
128
136
 
129
137
  // Row background colors
130
138
 
131
139
  .#{$eccgui}-simpletable--colorless > tbody {
132
- & > tr, & > tr:hover {
140
+ & > tr,
141
+ & > tr:hover {
133
142
  background: transparent;
143
+
134
144
  --#{$eccgui}-color-cell: transparent;
135
145
  }
136
146
  }
137
147
 
138
148
  .#{$prefix}--data-table:not(.#{$eccgui}-simpletable--colorless) > tbody {
139
149
  background-color: transparent;
150
+
140
151
  --#{$eccgui}-color-cell: #{$eccgui-color-tablerow-background-odd};
141
152
 
142
153
  & > tr {
@@ -149,23 +160,34 @@ $eccgui-color-tablerow-border: $pt-divider-black !default;
149
160
  &.#{$prefix}--expandable-row--hover {
150
161
  background-color: transparent;
151
162
 
152
- & > th, & > td {
163
+ & > th,
164
+ & > td {
153
165
  --#{$eccgui}-color-cell: #{$eccgui-color-tablerow-hover};
154
166
  }
155
167
  }
156
168
 
157
169
  &.#{$prefix}--data-table--selected {
158
170
  & > th {
159
- --#{$eccgui}-color-cell: #{mix($eccgui-color-tablerow-selected, $eccgui-color-tableheader-background, 50%)};
171
+ --#{$eccgui}-color-cell: #{color.mix(
172
+ $eccgui-color-tablerow-selected,
173
+ $eccgui-color-tableheader-background,
174
+ 50%
175
+ )};
160
176
  }
177
+
161
178
  & > td {
162
179
  --#{$eccgui}-color-cell: #{$eccgui-color-tablerow-selected};
163
180
  }
164
181
 
165
182
  &:hover {
166
183
  & > th {
167
- --#{$eccgui}-color-cell: #{mix($eccgui-color-tablerow-selected-hover, $eccgui-color-tableheader-background, 50%)};
184
+ --#{$eccgui}-color-cell: #{color.mix(
185
+ $eccgui-color-tablerow-selected-hover,
186
+ $eccgui-color-tableheader-background,
187
+ 50%
188
+ )};
168
189
  }
190
+
169
191
  & > td {
170
192
  --#{$eccgui}-color-cell: #{$eccgui-color-tablerow-selected-hover};
171
193
  }
@@ -176,43 +198,67 @@ $eccgui-color-tablerow-border: $pt-divider-black !default;
176
198
 
177
199
  // zebra style
178
200
 
179
- .#{$prefix}--data-table--zebra > tbody > tr[data-parent-row]:nth-child(4n+3),
180
- .#{$prefix}--data-table--zebra > tbody > tr[data-child-row]:nth-child(4n+4),
201
+ .#{$prefix}--data-table--zebra > tbody > tr[data-parent-row]:nth-child(4n + 3),
202
+ .#{$prefix}--data-table--zebra > tbody > tr[data-child-row]:nth-child(4n + 4),
181
203
  .#{$prefix}--data-table > tbody > tr.#{eccgui}-simpletable__row--zebra,
182
204
  .#{$prefix}--data-table > tbody > tr.#{eccgui}-simpletable__row--zebra + tr[data-child-row],
183
- .#{$prefix}--data-table--zebra > tbody > tr:not([data-parent-row]):not([data-child-row]):nth-child(2n+0) {
205
+ .#{$prefix}--data-table--zebra > tbody > tr:not([data-parent-row]):not([data-child-row]):nth-child(2n + 0) {
184
206
  // even rows
185
207
 
186
208
  &.#{$prefix}--expandable-row:not([data-child-row]) {
187
209
  --#{$eccgui}-color-border: #{$eccgui-color-tablerow-background-even};
188
210
  }
189
211
 
190
- & > th, & > td {
212
+ & > th,
213
+ & > td {
191
214
  --#{$eccgui}-color-cell: #{$eccgui-color-tablerow-background-even};
192
215
  }
193
216
 
194
217
  &:hover,
195
218
  &:hover + tr[data-child-row],
196
219
  &.#{$prefix}--expandable-row--hover {
197
- & > th, & > td {
198
- --#{$eccgui}-color-cell: #{mix($eccgui-color-tablerow-hover, $eccgui-color-tablerow-background-even, 50%)};
220
+ & > th,
221
+ & > td {
222
+ --#{$eccgui}-color-cell: #{color.mix(
223
+ $eccgui-color-tablerow-hover,
224
+ $eccgui-color-tablerow-background-even,
225
+ 50%
226
+ )};
199
227
  }
200
228
  }
201
229
 
202
230
  &.#{$prefix}--data-table--selected {
203
231
  & > th {
204
- --#{$eccgui}-color-cell: #{mix(mix($eccgui-color-tablerow-selected, $eccgui-color-tablerow-background-even, 50%), $eccgui-color-tableheader-background, 50%)};
232
+ --#{$eccgui}-color-cell: #{color.mix(
233
+ color.mix($eccgui-color-tablerow-selected, $eccgui-color-tablerow-background-even, 50%),
234
+ $eccgui-color-tableheader-background,
235
+ 50%
236
+ )};
205
237
  }
238
+
206
239
  & > td {
207
- --#{$eccgui}-color-cell: #{mix($eccgui-color-tablerow-selected, $eccgui-color-tablerow-background-even, 50%)};
240
+ --#{$eccgui}-color-cell: #{color.mix(
241
+ $eccgui-color-tablerow-selected,
242
+ $eccgui-color-tablerow-background-even,
243
+ 50%
244
+ )};
208
245
  }
209
246
 
210
247
  &:hover {
211
248
  & > th {
212
- --#{$eccgui}-color-cell: #{mix(mix($eccgui-color-tablerow-selected-hover, $eccgui-color-tablerow-background-even, 50%), $eccgui-color-tableheader-background, 50%)};
249
+ --#{$eccgui}-color-cell: #{color.mix(
250
+ color.mix($eccgui-color-tablerow-selected-hover, $eccgui-color-tablerow-background-even, 50%),
251
+ $eccgui-color-tableheader-background,
252
+ 50%
253
+ )};
213
254
  }
255
+
214
256
  & > td {
215
- --#{$eccgui}-color-cell: #{mix($eccgui-color-tablerow-selected-hover, $eccgui-color-tablerow-background-even, 50%)};
257
+ --#{$eccgui}-color-cell: #{color.mix(
258
+ $eccgui-color-tablerow-selected-hover,
259
+ $eccgui-color-tablerow-background-even,
260
+ 50%
261
+ )};
216
262
  }
217
263
  }
218
264
  }
@@ -283,8 +329,8 @@ tr.#{$prefix}--parent-row.#{$prefix}--expandable-row + tr[data-child-row] {
283
329
  // Sorting option
284
330
 
285
331
  .#{$prefix}--table-sort {
286
- background-color: transparent;
287
332
  padding-left: $eccgui-size-block-whitespace * 0.5;
333
+ background-color: transparent;
288
334
 
289
335
  &:hover {
290
336
  background-color: $button-background-color-hover;
@@ -1,9 +1,11 @@
1
1
  import React from "react";
2
- import { ComponentStory, ComponentMeta } from "@storybook/react";
3
- import { TextField } from "./../../../../index";
2
+ import { ComponentMeta, ComponentStory } from "@storybook/react";
3
+
4
4
  import { helpersArgTypes } from "../../../../.storybook/helpers";
5
- import {TextFieldProps} from "../TextField";
6
- import characters from "../../../common/utils/characters"
5
+ import characters from "../../../common/utils/characters";
6
+ import { TextFieldProps } from "../TextField";
7
+
8
+ import { TextField } from "./../../../../index";
7
9
 
8
10
  export default {
9
11
  title: "Forms/TextField",
@@ -17,13 +19,11 @@ export default {
17
19
  },
18
20
  intent: {
19
21
  ...helpersArgTypes.exampleIntent,
20
- }
22
+ },
21
23
  },
22
24
  } as ComponentMeta<typeof TextField>;
23
25
 
24
- const Template: ComponentStory<typeof TextField> = (args) => (
25
- <TextField {...args}></TextField>
26
- );
26
+ const Template: ComponentStory<typeof TextField> = (args) => <TextField {...args}></TextField>;
27
27
 
28
28
  export const Default = Template.bind({});
29
29
 
@@ -36,24 +36,27 @@ Default.args = {
36
36
  /** Text field with default value that contains a zero width/invisible character.
37
37
  * As long as the character exists, an alert is raised for every value change with a delay of 500ms.
38
38
  * Instead of an alert, something more sophisticated like a clean up action should be offered in production. */
39
- export const InvisibleCharacterWarning = Template.bind({})
39
+ export const InvisibleCharacterWarning = Template.bind({});
40
40
 
41
41
  const invisibleCharacterWarningProps: TextFieldProps = {
42
42
  ...Default.args,
43
43
  invisibleCharacterWarning: {
44
44
  callback: (codePoints) => {
45
- if(codePoints.size) {
45
+ if (codePoints.size) {
46
46
  const codePointsString = [...Array.from(codePoints)]
47
47
  .map((n) => {
48
- const info = characters.invisibleZeroWidthCharacters.codePointMap.get(n)
49
- return info.fullLabel
48
+ const info = characters.invisibleZeroWidthCharacters.codePointMap.get(n);
49
+ return info.fullLabel;
50
50
  })
51
- .join(", ")
52
- alert("Invisible character detected in input string. Code points: " + codePointsString)
51
+ .join(", ");
52
+ alert("Invisible character detected in input string. Code points: " + codePointsString);
53
53
  }
54
54
  },
55
- callbackDelay: 500
55
+ callbackDelay: 500,
56
+ },
57
+ onChange: () => {
58
+ /** needs to be defined, else the invisible character warning callback will not be triggered. */
56
59
  },
57
- defaultValue: "Invisible character ->​<-"
58
- }
59
- InvisibleCharacterWarning.args = invisibleCharacterWarningProps
60
+ defaultValue: "Invisible character ->​<-",
61
+ };
62
+ InvisibleCharacterWarning.args = invisibleCharacterWarningProps;
@@ -1,18 +1,20 @@
1
- import React, {ChangeEventHandler} from "react";
2
- import chars from "../../common/utils/characters"
1
+ import React, { ChangeEventHandler } from "react";
2
+
3
+ import chars from "../../common/utils/characters";
3
4
 
4
5
  export interface InvisibleCharacterWarningProps {
5
6
  /**
6
7
  * If set, the function is called after every value change what invisible characters have been detected.
8
+ * The input component must be controlled for this callback to be triggered.
7
9
  */
8
- callback: (detectedCodePoints: Set<number>) => any
10
+ callback: (detectedCodePoints: Set<number>) => any;
9
11
  /**
10
12
  * The delay in milliseconds after which an input string should be checked. Only the most recent value will be checked.
11
13
  * A higher value will reduce the probability that the typing stalls.
12
14
  *
13
15
  * Default: 500
14
16
  */
15
- callbackDelay?: number
17
+ callbackDelay?: number;
16
18
  }
17
19
 
18
20
  interface Props<T = Element> {
@@ -20,84 +22,96 @@ interface Props<T = Element> {
20
22
  value?: string | ReadonlyArray<string> | number | undefined;
21
23
  readOnly?: boolean | undefined;
22
24
  disabled?: boolean | undefined;
23
- onChange?: ChangeEventHandler<T>
25
+ onChange?: ChangeEventHandler<T>;
24
26
  /**
25
27
  * If set, allows to be informed of invisible, hard to spot characters in the string value.
26
28
  */
27
- invisibleCharacterWarning?: InvisibleCharacterWarningProps
29
+ invisibleCharacterWarning?: InvisibleCharacterWarningProps;
28
30
  }
29
31
 
30
32
  /** Validates the string value for invisible characters. */
31
- export const useTextValidation = <T>({value, onChange, invisibleCharacterWarning}: Props<T>) => {
32
- const callback = invisibleCharacterWarning?.callback
33
- const callbackDelay = invisibleCharacterWarning?.callbackDelay
33
+ export const useTextValidation = <T>({ value, onChange, invisibleCharacterWarning }: Props<T>) => {
34
+ const callback = invisibleCharacterWarning?.callback;
35
+ const callbackDelay = invisibleCharacterWarning?.callbackDelay;
34
36
  const state = React.useRef<{
35
- checkedValue?: string | ReadonlyArray<string> | number,
36
- timeout?: number,
37
- detectedCodePoints: Set<number>
38
- }>({detectedCodePoints: new Set()})
37
+ checkedValue?: string | ReadonlyArray<string> | number;
38
+ timeout?: number;
39
+ detectedCodePoints: Set<number>;
40
+ }>({ detectedCodePoints: new Set() });
39
41
  const clearState = React.useCallback(() => {
40
- state.current.timeout && clearTimeout(state.current.timeout)
41
- state.current.checkedValue = undefined
42
- state.current.detectedCodePoints = new Set()
43
- }, [])
44
- const detectionRegex = React.useMemo(() => chars.invisibleZeroWidthCharacters.createRegex(), [])
45
- const detectIssues = React.useCallback((value: string): void => {
46
- detectionRegex.lastIndex = 0
47
- let matchArray = detectionRegex.exec(value)
48
- while(matchArray) {
49
- const codePoint = matchArray[0].codePointAt(0)
50
- if(codePoint) {
51
- state.current.detectedCodePoints.add(codePoint)
42
+ state.current.timeout && clearTimeout(state.current.timeout);
43
+ state.current.checkedValue = undefined;
44
+ state.current.detectedCodePoints = new Set();
45
+ }, []);
46
+ const detectionRegex = React.useMemo(() => chars.invisibleZeroWidthCharacters.createRegex(), []);
47
+ const detectIssues = React.useCallback(
48
+ (value: string): void => {
49
+ detectionRegex.lastIndex = 0;
50
+ let matchArray = detectionRegex.exec(value);
51
+ while (matchArray) {
52
+ const codePoint = matchArray[0].codePointAt(0);
53
+ if (codePoint) {
54
+ state.current.detectedCodePoints.add(codePoint);
55
+ }
56
+ matchArray = detectionRegex.exec(value);
52
57
  }
53
- matchArray = detectionRegex.exec(value)
54
- }
55
- }, [detectionRegex])
58
+ },
59
+ [detectionRegex]
60
+ );
56
61
  // Checks if the value contains any problematic characters with a small delay.
57
- const checkValue = React.useCallback((value: string | ReadonlyArray<string> | number) => {
58
- state.current.detectedCodePoints = new Set()
59
- if(typeof value === "number") {
60
- clearState()
61
- } else if(typeof value === "string") {
62
- detectIssues(value)
63
- } else {
64
- value.forEach((arrayValue) => detectIssues(arrayValue))
65
- }
66
- callback?.(state.current.detectedCodePoints)
67
- }, [callback, clearState, detectIssues])
68
- const scheduleCheck = React.useCallback((value: string | ReadonlyArray<string> | number) => {
69
- if(state.current.checkedValue === value) {
70
- return
71
- }
72
- state.current.checkedValue = value
73
- state.current.timeout = window.setTimeout(() => {
74
- if(state.current.checkedValue === value) {
75
- checkValue(value)
76
- clearState()
62
+ const checkValue = React.useCallback(
63
+ (value: string | ReadonlyArray<string> | number) => {
64
+ state.current.detectedCodePoints = new Set();
65
+ if (typeof value === "number") {
66
+ clearState();
67
+ } else if (typeof value === "string") {
68
+ detectIssues(value);
69
+ } else {
70
+ value.forEach((arrayValue) => detectIssues(arrayValue));
71
+ }
72
+ callback?.(state.current.detectedCodePoints);
73
+ },
74
+ [callback, clearState, detectIssues]
75
+ );
76
+ const scheduleCheck = React.useCallback(
77
+ (value: string | ReadonlyArray<string> | number) => {
78
+ if (state.current.checkedValue === value) {
79
+ return;
77
80
  }
78
- }, callbackDelay ?? 500)
79
- }, [checkValue, clearState, callbackDelay])
81
+ state.current.checkedValue = value;
82
+ state.current.timeout = window.setTimeout(() => {
83
+ if (state.current.checkedValue === value) {
84
+ checkValue(value);
85
+ clearState();
86
+ }
87
+ }, callbackDelay ?? 500);
88
+ },
89
+ [checkValue, clearState, callbackDelay]
90
+ );
80
91
  // Do check via onChange handler
81
- const wrappedOnChangeHandler: ChangeEventHandler<T> = React.useCallback((event) => {
82
- const {value} = event.target as any
83
- if(value != null && typeof value === "string") {
84
- scheduleCheck(value)
85
- } else {
86
- clearState()
87
- }
88
- onChange?.(event)
89
- }, [clearState, onChange, scheduleCheck])
92
+ const wrappedOnChangeHandler: ChangeEventHandler<T> = React.useCallback(
93
+ (event) => {
94
+ const { value } = event.target as any;
95
+ if (value != null && typeof value === "string") {
96
+ scheduleCheck(value);
97
+ } else {
98
+ clearState();
99
+ }
100
+ onChange?.(event);
101
+ },
102
+ [clearState, onChange, scheduleCheck]
103
+ );
90
104
  // No callback, return
91
- if(!callback) {
92
- return onChange
105
+ if (!callback) {
106
+ return onChange;
93
107
  }
94
- if(value == null && onChange == null) {
95
- return onChange
108
+ if (value == null && onChange == null) {
109
+ return onChange;
96
110
  }
97
- if(value != null) {
98
- scheduleCheck(value)
99
- return onChange
111
+ if (value != null) {
112
+ scheduleCheck(value);
113
+ return onChange;
100
114
  } else {
101
- return wrappedOnChangeHandler
115
+ return wrappedOnChangeHandler;
102
116
  }
103
- }
117
+ };
@@ -22,6 +22,7 @@
22
22
  @import "./RadioButton/radiobutton";
23
23
  @import "./Select/select";
24
24
  @import "./Separation/separation";
25
+ @import "./Skeleton/skeleton";
25
26
  @import "./Spinner/spinner";
26
27
  @import "./Structure/titles";
27
28
  @import "./Table/table";
@@ -34,6 +34,7 @@ export * from "./RadioButton/RadioButton";
34
34
  export * from "./Select/Select";
35
35
  export * from "./Separation/Divider";
36
36
  export * from "./Separation/Spacing";
37
+ export * from "./Skeleton/Skeleton";
37
38
  export * from "./Spinner/Spinner";
38
39
  export * from "./Structure";
39
40
  export * from "./Switch/Switch";
@@ -9,6 +9,7 @@
9
9
  .CodeMirror {
10
10
  clip-path: unset !important; // we may check later why they set inset(0) now
11
11
  border-radius: $pt-border-radius;
12
+ height: 290px;
12
13
 
13
14
  // get them a "border" like input boxes from blueprintjs
14
15
  box-shadow: input-transition-shadow($input-shadow-color-focus), $pt-input-box-shadow;
package/src/index.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import { ClassNames as IntentClassNames } from "./common/Intent";
2
+ import * as Skeleton from "./components/Skeleton/classnames";
2
3
  import * as TypographyClassNames from "./components/Typography/classnames";
3
4
  import * as LegacyReplacements from "./legacy-replacements";
4
5
 
5
6
  const ClassNames = {
7
+ Skeleton,
6
8
  Typography: TypographyClassNames,
7
9
  Intent: IntentClassNames,
8
10
  };
@@ -1,53 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SingleLineCodeEditor = void 0;
7
- require("codemirror/addon/display/placeholder.js");
8
- require("codemirror/mode/sparql/sparql.js");
9
- const react_1 = __importDefault(require("react"));
10
- const react_codemirror2_1 = require("react-codemirror2");
11
- const core_1 = require("@blueprintjs/core");
12
- const constants_1 = require("../../configuration/constants");
13
- /** A single-line code editor. */
14
- const SingleLineCodeEditor = ({ setEditorInstance, onChange, onCursorChange, mode, initialValue, onFocusChange, onKeyDown, onSelection, enableTab = false, placeholder, showScrollBar = true }) => {
15
- const singleLineInitialContent = react_1.default.useRef(initialValue.replace(/[\r\n]/g, " "));
16
- return (react_1.default.createElement("div", { className: `${constants_1.CLASSPREFIX}-singlelinecodeeditor ${core_1.Classes.INPUT}` },
17
- react_1.default.createElement(react_codemirror2_1.UnControlled, { editorDidMount: (editor) => {
18
- editor.on("beforeChange", (_, change) => {
19
- // Prevent the user from entering new-line characters, since this is supposed to be a one-line editor.
20
- if (change.update && typeof change.update === "function" && change.text.length > 1) {
21
- change.update(change.from, change.to, [change.text.join("")]);
22
- }
23
- return true;
24
- });
25
- setEditorInstance(editor);
26
- }, value: singleLineInitialContent.current, onFocus: () => onFocusChange(true), onBlur: () => onFocusChange(false), options: {
27
- mode: mode,
28
- lineNumbers: false,
29
- theme: "xq-light",
30
- extraKeys: enableTab ? undefined : { Tab: false },
31
- placeholder,
32
- scrollbarStyle: showScrollBar ? "native" : "null"
33
- }, onSelection: (_editor, data) => {
34
- if (Array.isArray(data === null || data === void 0 ? void 0 : data.ranges)) {
35
- onSelection(data.ranges
36
- .map((r) => ({ from: r.from().ch, to: r.to().ch }))
37
- .filter((r) => r.from !== r.to));
38
- }
39
- }, onCursor: (editor, data) => {
40
- onCursorChange(data, editor.cursorCoords(true, "local"), editor.getScrollInfo());
41
- }, onBeforeChange: (_editor, data, _, next) => {
42
- // Reduce multiple lines to a single line
43
- if (data.text.length > 1) {
44
- _editor.setValue(data.text.join(""));
45
- }
46
- next();
47
- }, onChange: (_editor, _data, value) => {
48
- onChange(value);
49
- }, onKeyDown: (_, event) => onKeyDown(event) })));
50
- };
51
- exports.SingleLineCodeEditor = SingleLineCodeEditor;
52
- exports.default = exports.SingleLineCodeEditor;
53
- //# sourceMappingURL=SingleLineCodeEditor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SingleLineCodeEditor.js","sourceRoot":"","sources":["../../../../src/components/AutoSuggestion/SingleLineCodeEditor.tsx"],"names":[],"mappings":";;;;;;AAAA,mDAAgD;AAChD,4CAA0C;AAC1C,kDAA0B;AAC1B,yDAAqE;AACrE,4CAAiE;AAEjE,6DAAoE;AAiCpE,iCAAiC;AAC1B,MAAM,oBAAoB,GAAG,CAAC,EACjC,iBAAiB,EACjB,QAA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