@eturnity/eturnity_reusable_components 7.35.1-EPDM-10620.1 → 7.35.1-EPDM-10620.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "7.35.1-EPDM-10620.1",
3
+ "version": "7.35.1-EPDM-10620.2",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -26,7 +26,7 @@
26
26
 
27
27
  import { onMounted, reactive, watch } from 'vue'
28
28
  import styled from 'vue3-styled-components'
29
- import { fetchIcon } from './iconCache.mjs'
29
+ // import { fetchIcon } from './iconCache.mjs'
30
30
 
31
31
  const props = defineProps({
32
32
  disabled: {
@@ -9,6 +9,7 @@
9
9
  <ListItem
10
10
  v-for="item in limitedOptions"
11
11
  :key="item.type"
12
+ :disabled="item.disabled || false"
12
13
  :hover-color="item.hoverColor"
13
14
  @click="$emit('on-' + item.type)"
14
15
  >
@@ -16,8 +17,8 @@
16
17
  </ListItem>
17
18
  <ButtonContainer
18
19
  v-if="optionsList.length > optionLimit || hasComponent"
19
- @click="expandOptions"
20
20
  name="more_options,_tool_tips"
21
+ @click="expandOptions"
21
22
  >
22
23
  <DotItem />
23
24
  <DotItem />
@@ -54,23 +55,33 @@
54
55
  <ExpandedListItem
55
56
  v-for="item in limitedOptions"
56
57
  :key="item.type"
58
+ :disabled="item.disabled || false"
57
59
  :hover-color="item.hoverColor"
58
- @click="item?.component ? '' : $emit('on-' + item.type)"
60
+ @click="!item?.component && $emit('on-' + item.type)"
59
61
  >
60
- {{ item.name }}
61
- <IconContainer
62
+ <ListItemWrapper
62
63
  v-if="item?.component"
63
- @click="toggleElement(item.type)"
64
+ @click="!item.disabled && toggleElement(item.type)"
64
65
  >
66
+ <ListItemTitle>
67
+ {{ item.name }}
68
+ <InfoText
69
+ v-if="item.disabled && item.disabledInfo"
70
+ :text="item.disabledInfo"
71
+ />
72
+ </ListItemTitle>
65
73
  <Icon
66
74
  color="white"
67
- cursor="pointer"
75
+ :cursor="item.disabled ? 'not-allowed' : 'pointer'"
68
76
  name="arrow_right"
69
- size="14px"
77
+ size="20px"
70
78
  />
71
- </IconContainer>
79
+ </ListItemWrapper>
80
+ <template v-else>
81
+ {{ item.name }}
82
+ </template>
72
83
  <OptionsContainer v-if="item?.component && item.open">
73
- <slot :name="item.component" />
84
+ <slot :name="item.component"></slot>
74
85
  </OptionsContainer>
75
86
  </ExpandedListItem>
76
87
  </CenterBox>
@@ -113,7 +124,7 @@
113
124
  // </template>
114
125
  // </SelectedOptions>
115
126
  import styled from 'vue3-styled-components'
116
- import MainButton from '../buttons/mainButton'
127
+ import InfoText from '../infoText'
117
128
  import Icon from '../icon'
118
129
 
119
130
  const PageWrapper = styled.div``
@@ -219,25 +230,23 @@
219
230
  `
220
231
 
221
232
  const ListAttrs = {
233
+ disabled: Boolean,
222
234
  hoverColor: String,
223
235
  }
224
236
  const ListItem = styled('div', ListAttrs)`
225
- cursor: pointer;
237
+ cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};
238
+ color: ${(props) => props.disabled && props.theme.colors.grey3};
239
+
226
240
  &:hover {
227
241
  color: ${(props) =>
228
- props.hoverColor
242
+ props.disabled
243
+ ? props.theme.colors.grey3
244
+ : props.hoverColor
229
245
  ? props.theme.colors[props.hoverColor]
230
246
  : props.theme.colors.green};
231
247
  }
232
248
  `
233
249
 
234
- const ExpandedListItem = styled(ListItem)`
235
- display: flex;
236
- width: 100%;
237
- justify-content: space-between;
238
- align-items: center;
239
- `
240
-
241
250
  const IconContainer = styled.div`
242
251
  display: grid;
243
252
  align-items: center;
@@ -253,6 +262,26 @@
253
262
  }
254
263
  `
255
264
 
265
+ const ExpandedListItem = styled(ListItem)`
266
+ display: flex;
267
+ width: 100%;
268
+ justify-content: space-between;
269
+ align-items: center;
270
+ `
271
+
272
+ const ListItemWrapper = styled.div`
273
+ width: 100%;
274
+ display: flex;
275
+ align-items: center;
276
+ justify-content: space-between;
277
+ `
278
+
279
+ const ListItemTitle = styled.div`
280
+ display: flex;
281
+ align-items: center;
282
+ gap: 10px;
283
+ `
284
+
256
285
  const EmptyText = styled.div`
257
286
  color: ${(props) => props.theme.colors.white};
258
287
  font-size: 13px;
@@ -266,13 +295,15 @@
266
295
  BoxContainer,
267
296
  SelectedContainer,
268
297
  ListContainer,
269
- MainButton,
270
298
  ButtonContainer,
271
299
  DotItem,
272
300
  ListItem,
301
+ InfoText,
273
302
  CenterBox,
274
303
  Icon,
275
304
  CenterPageContainer,
305
+ ListItemWrapper,
306
+ ListItemTitle,
276
307
  PageWrapper,
277
308
  OptionsContainer,
278
309
  ExpandedListItem,
@@ -282,12 +313,48 @@
282
313
  BoxTitle,
283
314
  Divider,
284
315
  },
316
+ props: {
317
+ optionsList: {
318
+ type: Array,
319
+ required: true,
320
+ },
321
+ numberSelected: {
322
+ type: Number,
323
+ required: true,
324
+ default: 0,
325
+ },
326
+ },
327
+ data() {
328
+ return {
329
+ //maximum number of options to display, if more than 4, display a 'more' option
330
+ optionLimit: 4,
331
+ showOverlay: false,
332
+ expanded: false,
333
+ limitedOptions: [],
334
+ }
335
+ },
285
336
  computed: {
286
337
  hasComponent() {
287
338
  return this.optionsList.some((item) => item.component)
288
339
  },
289
340
  },
341
+ watch: {
342
+ optionsList() {
343
+ this.initializeOptions()
344
+ },
345
+ },
346
+ mounted() {
347
+ this.initializeOptions()
348
+ },
290
349
  methods: {
350
+ initializeOptions() {
351
+ this.limitedOptions = this.optionsList
352
+ .map((item) => {
353
+ return { ...item, open: false }
354
+ })
355
+ .filter((item) => !item.component)
356
+ .slice(0, this.optionLimit)
357
+ },
291
358
  toggleElement(type) {
292
359
  this.limitedOptions = this.optionsList.map((item) => {
293
360
  if (item.type === type) {
@@ -302,30 +369,5 @@
302
369
  this.limitedOptions = this.optionsList
303
370
  },
304
371
  },
305
- props: {
306
- optionsList: {
307
- required: true,
308
- },
309
- numberSelected: {
310
- required: true,
311
- default: 0,
312
- },
313
- },
314
- mounted() {
315
- this.limitedOptions = this.optionsList
316
- .map((item) => {
317
- return { ...item, open: false }
318
- })
319
- .filter((item) => !item.component)
320
- .slice(0, this.optionLimit)
321
- },
322
- data() {
323
- return {
324
- //maximum number of options to display, if more than 4, display a 'more' option
325
- optionLimit: 4,
326
- expanded: false,
327
- limitedOptions: [],
328
- }
329
- },
330
372
  }
331
373
  </script>