@bimdata/design-system 3.0.0-beta.1 → 3.0.0-beta.10

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 (72) hide show
  1. package/package.json +10 -10
  2. package/src/BIMDataComponents/BIMDataAvatar/BIMDataAvatar.vue +93 -0
  3. package/src/BIMDataComponents/BIMDataButton/BIMDataButton.css +28 -8
  4. package/src/BIMDataComponents/BIMDataCheckbox/BIMDataCheckbox.vue +9 -8
  5. package/src/BIMDataComponents/BIMDataColorSelector/BIMDataColorSelector.css +8 -0
  6. package/src/BIMDataComponents/BIMDataColorSelector/BIMDataColorSelector.vue +12 -1
  7. package/src/BIMDataComponents/BIMDataDatePicker/{_BIMDataDatePicker.scss → BIMDataDatePicker.css} +117 -42
  8. package/src/BIMDataComponents/BIMDataDatePicker/BIMDataDatePicker.vue +13 -4
  9. package/src/BIMDataComponents/BIMDataDatePicker/components/DateInput.vue +11 -2
  10. package/src/BIMDataComponents/BIMDataDropdownList/BIMDataDropdownList.vue +18 -12
  11. package/src/BIMDataComponents/BIMDataDropdownMenu/BIMDataDropdownMenu.css +1 -1
  12. package/src/BIMDataComponents/BIMDataDropdownMenu/BIMDataDropdownMenu.vue +10 -5
  13. package/src/BIMDataComponents/BIMDataIcon/BIMDataIcon.vue +10 -0
  14. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/DeniedFile.vue +1 -1
  15. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/PieGraph.vue +0 -1
  16. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/Translate.vue +2 -2
  17. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/ValidatedFile.vue +1 -1
  18. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/polychrome/BcfPolychrome.vue +0 -1
  19. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/polychrome/CreateWindowPolychrome.vue +0 -1
  20. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/polychrome/DocInfoPolychrome.vue +0 -2
  21. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/polychrome/FileDwgPolychrome.vue +3 -4
  22. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/polychrome/FileDxfPolychrome.vue +3 -4
  23. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/polychrome/FileIfcPolychrome.vue +3 -4
  24. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/polychrome/FileImagePolychrome.vue +3 -4
  25. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/polychrome/FileJpegPolychrome.vue +4 -5
  26. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/polychrome/FilePdfPolychrome.vue +1 -2
  27. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/polychrome/FilePhotospherePolychrome.vue +3 -4
  28. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/polychrome/FilePlanPolychrome.vue +1 -2
  29. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/polychrome/FilePngPolychrome.vue +3 -4
  30. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/polychrome/FilePointCloudPolychrome.vue +1 -2
  31. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/polychrome/FolderPolychrome.vue +0 -1
  32. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/polychrome/StructurePolychrome.vue +0 -1
  33. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/polychrome/Viewer2DPolychrome.vue +0 -1
  34. package/src/BIMDataComponents/BIMDataIcon/BIMDataLibraryIcons/polychrome/Viewer3DPolychrome.vue +0 -2
  35. package/src/BIMDataComponents/BIMDataIcon/Icon.vue +11 -1
  36. package/src/BIMDataComponents/BIMDataInfobox/BIMDataInfobox.vue +18 -7
  37. package/src/BIMDataComponents/BIMDataInput/BIMDataInput.vue +23 -12
  38. package/src/BIMDataComponents/BIMDataList/BIMDataList.vue +2 -2
  39. package/src/BIMDataComponents/BIMDataMenu/BIMDataMenu.css +59 -1
  40. package/src/BIMDataComponents/BIMDataMenu/BIMDataMenu.vue +14 -4
  41. package/src/BIMDataComponents/BIMDataMenuInline/BIMDataMenuInline.css +5 -0
  42. package/src/BIMDataComponents/BIMDataMenuInline/BIMDataMenuInline.vue +16 -6
  43. package/src/BIMDataComponents/BIMDataNavigation/BIMDataNavigation.vue +17 -10
  44. package/src/BIMDataComponents/BIMDataPaginatedList/BIMDataPaginatedList.vue +20 -8
  45. package/src/BIMDataComponents/BIMDataPagination/{_BIMDataPagination.scss → BIMDataPagination.css} +4 -2
  46. package/src/BIMDataComponents/BIMDataPagination/BIMDataPagination.vue +20 -9
  47. package/src/BIMDataComponents/BIMDataRadio/BIMDataRadio.vue +10 -5
  48. package/src/BIMDataComponents/BIMDataSafeZoneInline/{_BIMDataSafeZoneInline.scss → BIMDataSafeZoneInline.css} +7 -2
  49. package/src/BIMDataComponents/BIMDataSafeZoneInline/BIMDataSafeZoneInline.vue +15 -3
  50. package/src/BIMDataComponents/BIMDataSearch/BIMDataSearch.css +1 -1
  51. package/src/BIMDataComponents/BIMDataSearchAutocomplete/BIMDataSearchAutocomplete.css +28 -0
  52. package/src/BIMDataComponents/BIMDataSearchAutocomplete/BIMDataSearchAutocomplete.vue +10 -1
  53. package/src/BIMDataComponents/BIMDataSelect/BIMDataSelect.css +104 -2
  54. package/src/BIMDataComponents/BIMDataSelect/BIMDataSelectMulti.vue +38 -14
  55. package/src/BIMDataComponents/BIMDataSelect/BIMDataSelectSingle.vue +11 -6
  56. package/src/BIMDataComponents/BIMDataSlider/{_BIMDataSlider.scss → BIMDataSlider.css} +39 -2
  57. package/src/BIMDataComponents/BIMDataSlider/BIMDataSlider.vue +13 -2
  58. package/src/BIMDataComponents/BIMDataTable/{_BIMDataTable.scss → BIMDataTable.css} +22 -4
  59. package/src/BIMDataComponents/BIMDataTable/BIMDataTable.vue +22 -17
  60. package/src/BIMDataComponents/BIMDataTable/column-sorting/ColumnSorting.vue +1 -1
  61. package/src/BIMDataComponents/BIMDataTabs/BIMDataTabs.vue +10 -5
  62. package/src/BIMDataComponents/BIMDataText/BIMDataText.css +10 -0
  63. package/src/BIMDataComponents/BIMDataText/BIMDataText.vue +19 -2
  64. package/src/BIMDataComponents/BIMDataTextarea/{_BIMDataTextarea.scss → BIMDataTextarea.css} +20 -9
  65. package/src/BIMDataComponents/BIMDataTextarea/BIMDataTextarea.vue +13 -1
  66. package/src/BIMDataComponents/BIMDataToggle/{_BIMDataToggle.scss → BIMDataToggle.css} +12 -1
  67. package/src/BIMDataComponents/BIMDataToggle/BIMDataToggle.vue +11 -2
  68. package/src/BIMDataComponents/BIMDataTree/BIMDataTree.vue +2 -2
  69. package/src/BIMDataComponents/index.js +1 -0
  70. package/src/assets/colors.js +1 -0
  71. package/src/assets/css/utilities/_colors.css +9 -0
  72. package/src/assets/iconsColors.js +3 -0
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="safe-zone-inline">
2
+ <div class="safe-zone-inline" :class="{ dark: isDark }">
3
3
  <BIMDataButton
4
4
  class="safe-zone-inline__btn-delete"
5
5
  color="high"
@@ -14,9 +14,10 @@
14
14
  :style="{ width: '15px', order: reverse ? -1 : 0 }"
15
15
  width="0px"
16
16
  radius
17
+ :color="isDark ? 'quaternary' : 'granite'"
17
18
  @click="$emit('cancel-delete')"
18
19
  >
19
- <BIMDataIconClose size="xxs" color="granite" />
20
+ <BIMDataIconClose size="xxs" :color="isDark ? 'quaternary-lighter' : 'granite'" />
20
21
  </BIMDataButton>
21
22
  </div>
22
23
  </template>
@@ -30,6 +31,12 @@ export default {
30
31
  BIMDataIconClose,
31
32
  BIMDataButton,
32
33
  },
34
+ inject: {
35
+ darkThemeRef: {
36
+ from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
37
+ default: () => ({ value: false }),
38
+ },
39
+ },
33
40
  props: {
34
41
  reverse: {
35
42
  type: Boolean,
@@ -37,7 +44,12 @@ export default {
37
44
  },
38
45
  },
39
46
  emits: ["confirm-delete", "cancel-delete"],
47
+ computed: {
48
+ isDark() {
49
+ return this.darkThemeRef;
50
+ },
51
+ }
40
52
  };
41
53
  </script>
42
54
 
43
- <style scoped lang="scss" src="./_BIMDataSafeZoneInline.scss"></style>
55
+ <style scoped src="./BIMDataSafeZoneInline.css"></style>
@@ -56,7 +56,7 @@
56
56
  background-color: var(--color-tertiary-lighter);
57
57
  }
58
58
  &.bimdata-search-bar__quaternary {
59
- background-color: var(--color-quaternary);
59
+ background-color: var(--color-quaternary-dark);
60
60
  color: var(--color-quaternary-lighter);
61
61
  input {
62
62
  color: var(--color-quaternary-lighter);
@@ -142,4 +142,32 @@
142
142
  }
143
143
  }
144
144
  }
145
+ &.bimdata-search-autocomplete--quaternary {
146
+ color: var(--color-quaternary-lighter);
147
+ input {
148
+ background-color: var(--color-quaternary);
149
+ color: var(--color-quaternary-lighter);
150
+ &::placeholder {
151
+ color: var(--color-quaternary-lighter);
152
+ }
153
+ }
154
+ & .bimdata-search-autocomplete__dropdown {
155
+ background-color: var(--color-quaternary);
156
+ color: var(--color-quaternary-lighter);
157
+ .active {
158
+ background-color: color-mix(in srgb, transparent, var(--color-quaternary-lighter) 5%);
159
+ }
160
+ li {
161
+ &:hover {
162
+ background-color: color-mix(in srgb, transparent, var(--color-quaternary-lighter) 8%);
163
+ cursor: pointer;
164
+ }
165
+ }
166
+ & .bimdata-search-autocomplete__dropdown__button {
167
+ &:hover {
168
+ background-color: color-mix(in srgb, transparent, var(--color-quaternary-lighter) 8%);
169
+ }
170
+ }
171
+ }
172
+ }
145
173
  }
@@ -2,7 +2,7 @@
2
2
  <div
3
3
  class="bimdata-search-autocomplete"
4
4
  v-clickaway="away"
5
- :class="[{ open: openResults }, `bimdata-search-autocomplete--${color}`]"
5
+ :class="[{ open: openResults, dark: isDark }, `bimdata-search-autocomplete--${color}`]"
6
6
  >
7
7
  <div class="bimdata-search-autocomplete__input flex items-center">
8
8
  <span class="bimdata-search-icon flex">
@@ -94,6 +94,12 @@ export default {
94
94
  BIMDataTextbox,
95
95
  },
96
96
  directives: { clickaway },
97
+ inject: {
98
+ darkThemeRef: {
99
+ from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
100
+ default: () => ({ value: false }),
101
+ },
102
+ },
97
103
  props: {
98
104
  items: {
99
105
  type: Array,
@@ -162,6 +168,9 @@ export default {
162
168
  this.search !== "" && this.results.length !== 0 && this.isOpen === true
163
169
  );
164
170
  },
171
+ isDark() {
172
+ return this.darkThemeRef;
173
+ },
165
174
  },
166
175
  methods: {
167
176
  onChange() {
@@ -26,7 +26,7 @@
26
26
 
27
27
  & .bimdata-select__content__label {
28
28
  position: absolute;
29
- top: 6px;
29
+ top: 8px;
30
30
  left: 12px;
31
31
  font-size: 12px;
32
32
  transition: 0.2s ease all;
@@ -110,6 +110,30 @@
110
110
  color: var(--color-primary);
111
111
  }
112
112
  }
113
+ &.dark {
114
+ &.active, &.not-empty {
115
+ & .bimdata-select__content {
116
+ .bimdata-select__content__label {
117
+ color: var(--color-quaternary-lighter);
118
+ }
119
+ }
120
+ }
121
+ .bimdata-select__content {
122
+ background-color: var(--color-quaternary-light);
123
+ .bimdata-select__content__value, .bimdata-select__content__label {
124
+ color: var(--color-quaternary-lighter);
125
+ }
126
+ }
127
+ .bimdata-select__option-list {
128
+ background-color: var(--color-primary);
129
+ color: var(--color-white);
130
+ .bimdata-select__option-list__entry {
131
+ &.selected, &:hover {
132
+ background-color: var(--color-primary-light);
133
+ }
134
+ }
135
+ }
136
+ }
113
137
  &.active {
114
138
  .bimdata-select__content {
115
139
  .bimdata-select__content__value, .bimdata-select__content__label {
@@ -136,6 +160,13 @@
136
160
  }
137
161
  }
138
162
  &.dark {
163
+ &.active, &.not-empty {
164
+ & .bimdata-select__content {
165
+ .bimdata-select__content__label {
166
+ color: var(--color-quaternary-lighter);
167
+ }
168
+ }
169
+ }
139
170
  .bimdata-select__option-list {
140
171
  background-color: var(--color-primary);
141
172
  color: var(--color-white);
@@ -150,10 +181,22 @@
150
181
  &.secondary {
151
182
  .bimdata-select__content {
152
183
  background-color: var(--color-secondary);
153
- .bimdata-select__content__label {
184
+ .bimdata-select__content__label, .bimdata-select__content__value {
154
185
  color: var(--color-primary);
155
186
  }
156
187
  }
188
+ &.dark {
189
+ .bimdata-select__option-list {
190
+ background-color: var(--color-quaternary-light);
191
+ }
192
+ &.active, &.not-empty {
193
+ & .bimdata-select__content {
194
+ .bimdata-select__content__label {
195
+ color: var(--color-quaternary-lighter);
196
+ }
197
+ }
198
+ }
199
+ }
157
200
  }
158
201
  &.tertiary {
159
202
  .bimdata-select__content {
@@ -240,4 +283,63 @@
240
283
  }
241
284
  }
242
285
  }
286
+ &.white {
287
+ .bimdata-select__content {
288
+ background-color: var(--color-white);
289
+ .bimdata-select__content__label {
290
+ color: var(--color-quaternary);
291
+ }
292
+ .bimdata-select__content__value {
293
+ color: var(--color-quaternary);
294
+ }
295
+ }
296
+ &.active {
297
+ .bimdata-select__content {
298
+ .bimdata-select__content__value, .bimdata-select__content__label {
299
+ color: var(--color-quaternary);
300
+ }
301
+ }
302
+ .bimdata-select__option-list {
303
+ .bimdata-select__option-list__entry {
304
+ &.selected, &:hover {
305
+ background-color: var(--color-tertiary-lighter);
306
+ }
307
+ }
308
+ }
309
+ }
310
+ &.dark {
311
+ .bimdata-select__option-list {
312
+ .bimdata-select__option-list__entry {
313
+ color: var(--color-quaternary);
314
+ }
315
+ }
316
+ &.not-empty {
317
+ .bimdata-select__content {
318
+ .bimdata-select__content__label {
319
+ color: var(--color-white);
320
+ }
321
+ }
322
+ }
323
+ }
324
+ &:deep() {
325
+ .bimdata-checkbox {
326
+ &.dark {
327
+ .bimdata-checkbox__text {
328
+ color: var(--color-quaternary)
329
+ }
330
+ .bimdata-checkbox__mark {
331
+ border-color: var(--color-quaternary);
332
+ }
333
+ &.checked {
334
+ .bimdata-checkbox__mark {
335
+ background-color: var(--color-quaternary);
336
+ &::after {
337
+ border-color: var(--color-quaternary-lighter);
338
+ }
339
+ }
340
+ }
341
+ }
342
+ }
343
+ }
344
+ }
243
345
  }
@@ -1,10 +1,12 @@
1
1
  <template>
2
2
  <div
3
- class="bimdata-select"
3
+ class="bimdata-select multi"
4
4
  :class="{
5
5
  disabled,
6
6
  active: isOpen,
7
+ dark: isDark,
7
8
  'not-empty': modelValue.length > 0,
9
+ [color]: true,
8
10
  }"
9
11
  :style="{ width }"
10
12
  v-clickaway="away"
@@ -25,7 +27,7 @@
25
27
  <BIMDataSearch
26
28
  v-if="search"
27
29
  width="calc(100% - 12px)"
28
- color="primary"
30
+ :color="searchColor"
29
31
  radius
30
32
  :placeholder="searchPlaceholder"
31
33
  v-model="searchText"
@@ -80,14 +82,33 @@ export default {
80
82
  prop: "modelValue",
81
83
  event: "update:modelValue",
82
84
  },
85
+ inject: {
86
+ darkThemeRef: {
87
+ from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
88
+ default: () => ({ value: false }),
89
+ },
90
+ },
83
91
  props: {
84
- width: {
85
- type: [String, Number],
92
+ color: {
93
+ type: String,
94
+ default: "default",
95
+ validator: value =>
96
+ ["default", "primary", "secondary", "tertiary", "tertiary-light", "quaternary", "white"].includes(value),
97
+ },
98
+ disabled: {
99
+ type: Boolean,
100
+ default: false,
86
101
  },
87
102
  label: {
88
103
  type: String,
89
104
  default: null,
90
105
  },
106
+ modelValue: {
107
+ type: Array,
108
+ },
109
+ nullLabel: {
110
+ type: String,
111
+ },
91
112
  options: {
92
113
  type: Array,
93
114
  default: () => [],
@@ -98,13 +119,7 @@ export default {
98
119
  optionLabelKey: {
99
120
  type: String,
100
121
  },
101
- modelValue: {
102
- type: Array,
103
- },
104
- nullLabel: {
105
- type: String,
106
- },
107
- disabled: {
122
+ resetOnLeave: {
108
123
  type: Boolean,
109
124
  default: false,
110
125
  },
@@ -112,13 +127,19 @@ export default {
112
127
  type: Boolean,
113
128
  default: false,
114
129
  },
130
+ searchColor: {
131
+ type: String,
132
+ default: "primary",
133
+ validator: value =>
134
+ ["primary", "secondary", "tertiary", "quaternary"].includes(value),
135
+ },
115
136
  searchPlaceholder: {
116
137
  type: String,
117
138
  default: "Search",
118
139
  },
119
- resetOnLeave: {
120
- type: Boolean,
121
- default: false,
140
+
141
+ width: {
142
+ type: [String, Number],
122
143
  },
123
144
  },
124
145
  emits: ["update:modelValue"],
@@ -159,6 +180,9 @@ export default {
159
180
  }
160
181
  }
161
182
  },
183
+ isDark() {
184
+ return this.darkThemeRef;
185
+ },
162
186
  },
163
187
  methods: {
164
188
  toggle() {
@@ -5,7 +5,7 @@
5
5
  disabled,
6
6
  active: isOpen,
7
7
  'not-empty': modelValue !== undefined && modelValue !== null,
8
- dark,
8
+ dark: isDark,
9
9
  [color]: true,
10
10
  }"
11
11
  :style="{ width }"
@@ -78,6 +78,12 @@ export default {
78
78
  prop: "modelValue",
79
79
  event: "update:modelValue",
80
80
  },
81
+ inject: {
82
+ darkThemeRef: {
83
+ from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
84
+ default: () => ({ value: false }),
85
+ },
86
+ },
81
87
  props: {
82
88
  width: {
83
89
  type: [String, Number],
@@ -126,15 +132,11 @@ export default {
126
132
  type: Boolean,
127
133
  default: false,
128
134
  },
129
- dark: {
130
- type: Boolean,
131
- default: false,
132
- },
133
135
  color: {
134
136
  type: String,
135
137
  default: "default",
136
138
  validator: value =>
137
- ["default", "primary", "secondary", "tertiary", "tertiary-light", "quaternary"].includes(value),
139
+ ["default", "primary", "secondary", "tertiary", "tertiary-light", "quaternary", "white"].includes(value),
138
140
  },
139
141
  searchColor: {
140
142
  type: String,
@@ -181,6 +183,9 @@ export default {
181
183
  }
182
184
  }
183
185
  },
186
+ isDark() {
187
+ return this.darkThemeRef;
188
+ },
184
189
  },
185
190
  methods: {
186
191
  toggle() {
@@ -50,7 +50,7 @@
50
50
  transition: opacity 0.2s ease-out;
51
51
  }
52
52
  }
53
- &-tooltip {
53
+ .bimdata-slider-tooltip {
54
54
  background: var(--color-primary);
55
55
  color: var(--color-white);
56
56
  padding: calc(var(--spacing-unit) / 2);
@@ -64,7 +64,7 @@
64
64
  &::after {
65
65
  border: 5px solid transparent;
66
66
  border-top-color: var(--color-primary);
67
- bottom: 5px * -2;
67
+ bottom: calc(5px * -2);
68
68
  content: "";
69
69
  height: 0;
70
70
  left: 50%;
@@ -79,4 +79,41 @@
79
79
  appearance: none;
80
80
  -webkit-appearance: none;
81
81
  }
82
+
83
+ &.dark {
84
+ .bimdata-slider-input {
85
+ background-color: transparent;
86
+ &::-webkit-slider-runnable-track {
87
+ height: 3px;
88
+ background: linear-gradient(
89
+ to right,
90
+ var(--color-tertiary),
91
+ var(--color-tertiary)
92
+ ),
93
+ var(--color-quaternary-lighter);
94
+ background-size: var(--background-size, 0%) 100%;
95
+ background-repeat: no-repeat;
96
+ border-radius: 5px;
97
+ }
98
+ &::-webkit-slider-thumb {
99
+ background: var(--color-tertiary);
100
+ }
101
+ &::-moz-range-progress {
102
+ background-color: var(--color-tertiary);
103
+ }
104
+ &::-moz-range-track {
105
+ background-color: var(--color-quaternary-lighter);
106
+ border-radius: 5px;
107
+ }
108
+ &::-moz-range-thumb {
109
+ background: var(--color-tertiary);
110
+ }
111
+ }
112
+ .bimdata-slider-tooltip {
113
+ background: var(--color-tertiary);
114
+ &::after {
115
+ border-top-color: var(--color-tertiary);
116
+ }
117
+ }
118
+ }
82
119
  }
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="bimdata-slider">
2
+ <div class="bimdata-slider" :class="{dark: isDark}">
3
3
  <input
4
4
  ref="input"
5
5
  class="bimdata-slider-input"
@@ -23,6 +23,12 @@
23
23
 
24
24
  <script>
25
25
  export default {
26
+ inject: {
27
+ darkThemeRef: {
28
+ from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
29
+ default: () => ({ value: false }),
30
+ },
31
+ },
26
32
  props: {
27
33
  min: {
28
34
  type: [Number, String],
@@ -95,7 +101,12 @@ export default {
95
101
  this.tooltipPosition = `calc(${newVal}% + (${8 - newVal * 0.18}px))`;
96
102
  },
97
103
  },
104
+ computed: {
105
+ isDark() {
106
+ return this.darkThemeRef;
107
+ },
108
+ },
98
109
  };
99
110
  </script>
100
111
 
101
- <style scoped lang="scss" src="./_BIMDataSlider.scss"></style>
112
+ <style scoped src="./BIMDataSlider.css"></style>
@@ -3,7 +3,7 @@
3
3
  font-size: 0.9rem;
4
4
  background-color: var(--color-white);
5
5
 
6
- &__container {
6
+ & .bimdata-table__container {
7
7
  height: 100%;
8
8
 
9
9
  table {
@@ -46,7 +46,7 @@
46
46
  }
47
47
  }
48
48
 
49
- &__placeholder {
49
+ .bimdata-table__container__placeholder {
50
50
  display: flex;
51
51
  justify-content: center;
52
52
  align-items: center;
@@ -56,14 +56,32 @@
56
56
  }
57
57
  }
58
58
 
59
- &__page-nav {
59
+ & .bimdata-table__container__page-nav {
60
60
  display: flex;
61
61
  justify-content: flex-end;
62
62
  align-items: center;
63
63
  padding: var(--spacing-unit);
64
64
 
65
- &__text {
65
+ & .bimdata-table__container__page-nav__text {
66
66
  margin: 0 var(--spacing-unit);
67
67
  }
68
68
  }
69
+
70
+ &.dark {
71
+ .bimdata-table__container table tbody tr:nth-child(odd) {
72
+ background-color: var(--color-quaternary-dark);
73
+ }
74
+ .bimdata-table__container table thead tr,
75
+ .bimdata-table__container table tbody tr:nth-child(even) {
76
+ background-color: var(--color-quaternary);
77
+ th {
78
+ color: var(--color-quaternary-lighter);
79
+ }
80
+ }
81
+ .bimdata-table__container {
82
+ td {
83
+ color: var(--color-white);
84
+ }
85
+ }
86
+ }
69
87
  }
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="bimdata-table">
2
+ <div class="bimdata-table" :class="{ dark: isDark }">
3
3
  <div
4
4
  class="bimdata-table__container"
5
5
  :style="{
@@ -51,7 +51,7 @@
51
51
  class="m-l-6"
52
52
  :class="{
53
53
  active: filters.some(
54
- filter => filter.columnKey === column.id
54
+ filter => filter.columnKey === column.id,
55
55
  ),
56
56
  }"
57
57
  @click="toggleFiltersMenu(column)"
@@ -63,7 +63,7 @@
63
63
  :column="column"
64
64
  :columnData="
65
65
  computedRows.map(
66
- computedRow => computedRow.data[column.id]
66
+ computedRow => computedRow.data[column.id],
67
67
  )
68
68
  "
69
69
  :filters="
@@ -164,7 +164,7 @@
164
164
  </template>
165
165
 
166
166
  <script>
167
- import { computed, ref, watch, shallowReactive } from "vue";
167
+ import { computed, inject, ref, watch, shallowReactive } from "vue";
168
168
  import { useRowSelection } from "./table-row-selection.js";
169
169
  import clickaway from "../../BIMDataDirectives/click-away.js";
170
170
 
@@ -245,9 +245,13 @@ export default {
245
245
  "row-drop",
246
246
  ],
247
247
  setup(props, { emit }) {
248
+ const darkThemeRef = inject("BIMDATA_DESIGN_SYSTEM_DARK_THEME");
249
+ const isDark = computed(() => {
250
+ return darkThemeRef.value;
251
+ });
248
252
  // Compute rows keys based on props values.
249
253
  const computedRows = computed(() =>
250
- props.rows.map((row, i) => ({ key: row[props.rowKey] ?? i, data: row }))
254
+ props.rows.map((row, i) => ({ key: row[props.rowKey] ?? i, data: row })),
251
255
  );
252
256
 
253
257
  const { rowSelection, toggleRowSelection, toggleFullSelection } =
@@ -273,7 +277,7 @@ export default {
273
277
  emit("all-deselected");
274
278
  }
275
279
  },
276
- }
280
+ },
277
281
  );
278
282
 
279
283
  const selectionState = computed(() =>
@@ -281,7 +285,7 @@ export default {
281
285
  ? rowSelection.value.size > 0
282
286
  ? null
283
287
  : false
284
- : rowSelection.value.size > 0
288
+ : rowSelection.value.size > 0,
285
289
  );
286
290
 
287
291
  const toggleRow = row => {
@@ -387,7 +391,7 @@ export default {
387
391
  return sortedRows.value.filter(row => {
388
392
  return filters.value.every(filter => {
389
393
  const column = props.columns.find(
390
- column => column.id === filter.columnKey
394
+ column => column.id === filter.columnKey,
391
395
  );
392
396
  const columnRowData = row.data[filter.columnKey];
393
397
 
@@ -399,17 +403,17 @@ export default {
399
403
  typeof column.filterFunction === "function"
400
404
  ? column.filterFunction(columnRowDataElement)
401
405
  : column.filterKey
402
- ? columnRowDataElement[column.filterKey]
403
- : columnRowDataElement
404
- )
406
+ ? columnRowDataElement[column.filterKey]
407
+ : columnRowDataElement,
408
+ ),
405
409
  );
406
410
  } else {
407
411
  return filter.columnFilters.includes(
408
412
  typeof column.filterFunction === "function"
409
413
  ? column.filterFunction(columnRowData)
410
414
  : column.filterKey
411
- ? columnRowData[column.filterKey]
412
- : columnRowData
415
+ ? columnRowData[column.filterKey]
416
+ : columnRowData,
413
417
  );
414
418
  }
415
419
  });
@@ -421,7 +425,7 @@ export default {
421
425
  */
422
426
  const updateFilters = (column, columnFilters) => {
423
427
  filters.value = filters.value.filter(
424
- filter => filter.columnKey !== column.id
428
+ filter => filter.columnKey !== column.id,
425
429
  );
426
430
  if (columnFilters.length > 0) {
427
431
  filters.value.push({
@@ -442,7 +446,7 @@ export default {
442
446
  () => {
443
447
  pageIndex.value = 0;
444
448
  },
445
- { immediate: true }
449
+ { immediate: true },
446
450
  );
447
451
  // Compute `paginatedRows` according to rows array and pagination settings.
448
452
  watch(
@@ -460,11 +464,12 @@ export default {
460
464
  paginatedRows.value = rowKeys;
461
465
  }
462
466
  },
463
- { immediate: true }
467
+ { immediate: true },
464
468
  );
465
469
 
466
470
  return {
467
471
  // References
472
+ isDark,
468
473
  activeHeadercolumnKey: null,
469
474
  computedRows,
470
475
  paginatedRows,
@@ -494,4 +499,4 @@ export default {
494
499
  };
495
500
  </script>
496
501
 
497
- <style scoped lang="scss" src="./_BIMDataTable.scss"></style>
502
+ <style scoped src="./BIMDataTable.css"></style>
@@ -56,7 +56,7 @@ export default {
56
56
  };
57
57
  </script>
58
58
 
59
- <style scoped lang="scss">
59
+ <style scoped>
60
60
  span {
61
61
  cursor: pointer;
62
62
  }