@eturnity/eturnity_reusable_components 1.0.93 → 1.0.96

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": "1.0.93",
3
+ "version": "1.0.96",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -1,5 +1,10 @@
1
1
  <template>
2
- <dropdown-row :colspan="colSpan" @click="toggleOpen" ref="dropdownItem">
2
+ <dropdown-row
3
+ :colspan="colSpan"
4
+ @click="toggleOpen"
5
+ ref="dropdownItem"
6
+ :disabled="disabled"
7
+ >
3
8
  <component-container :colSpan="colSpan" class="table-dropdown">
4
9
  <component-item v-for="(item, index) in tableItems" :key="index">
5
10
  <template-button
@@ -114,15 +119,18 @@
114
119
  // :optionItems="groupComponents" // list of options
115
120
  // :optionsLoading="dropdownOptionsLoading"
116
121
  // :optionsDisplay="['display_name', 'company_item_number']" // Array. what should be displayed
122
+ // :disabled="true"
117
123
  // />
118
124
  import styled from "vue-styled-components"
119
125
  import Spinner from "@eturnity/eturnity_reusable_components/src/components/spinner"
120
126
  import SearchInput from "@eturnity/eturnity_reusable_components/src/components/inputs/searchInput"
121
127
 
122
- const DropdownRow = styled.td``
128
+ const rowAttrs = { disabled: Boolean }
129
+ const DropdownRow = styled("td", rowAttrs)`
130
+ cursor: ${(props) => (props.disabled ? "not-allowed" : "auto")};
131
+ `
123
132
 
124
133
  const ComponentItem = styled.div`
125
- /* padding-left: 12px; */
126
134
  overflow: hidden;
127
135
  text-overflow: ellipsis;
128
136
  `
@@ -283,6 +291,10 @@ export default {
283
291
  required: true,
284
292
  default: [], // should be like ['display_name', 'company_item_number', 'description']
285
293
  },
294
+ disabled: {
295
+ required: false,
296
+ default: false,
297
+ },
286
298
  },
287
299
  data() {
288
300
  return {
@@ -291,6 +303,9 @@ export default {
291
303
  },
292
304
  methods: {
293
305
  toggleOpen() {
306
+ if (this.disabled) {
307
+ return
308
+ }
294
309
  if (!this.isOpen) {
295
310
  document.addEventListener("click", this.clickOutside)
296
311
  this.$emit("dropdown-search", "")
@@ -180,7 +180,7 @@ const TableContainer = styled.table`
180
180
 
181
181
  tr {
182
182
  &.disabled {
183
- cursor: not-allowed;
183
+ cursor: not-allowed !important;
184
184
  }
185
185
 
186
186
  .arrow-dropdown {
@@ -197,7 +197,7 @@ const TableContainer = styled.table`
197
197
  .text {
198
198
  padding: 10px 15px 10px 15px;
199
199
  color: ${(props) => props.theme.colors.black};
200
- cursor: auto;
200
+ cursor: pointer;
201
201
  }
202
202
 
203
203
  .bold {