@eturnity/eturnity_reusable_components 1.0.92 → 1.0.95
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
|
@@ -17,6 +17,9 @@
|
|
|
17
17
|
:inputWidth="inputWidth"
|
|
18
18
|
:value="value"
|
|
19
19
|
@input="onChangeHandler"
|
|
20
|
+
:noBorder="noBorder"
|
|
21
|
+
:disabled="disabled"
|
|
22
|
+
:isDisabled="disabled"
|
|
20
23
|
/>
|
|
21
24
|
</input-wrapper>
|
|
22
25
|
<error-message v-if="isError">{{ errorMessage }}</error-message>
|
|
@@ -44,11 +47,20 @@ const LabelWrapper = styled.div`
|
|
|
44
47
|
margin-bottom: 12px;
|
|
45
48
|
`
|
|
46
49
|
|
|
47
|
-
const inputProps = {
|
|
50
|
+
const inputProps = {
|
|
51
|
+
isError: Boolean,
|
|
52
|
+
inputWidth: String,
|
|
53
|
+
noBorder: Boolean,
|
|
54
|
+
isDisabled: Boolean,
|
|
55
|
+
}
|
|
48
56
|
const InputContainer = styled("input", inputProps)`
|
|
49
57
|
border: ${(props) =>
|
|
50
58
|
props.isError
|
|
51
59
|
? "1px solid " + props.theme.colors.red
|
|
60
|
+
: props.noBorder
|
|
61
|
+
? "none"
|
|
62
|
+
: props.hasLength
|
|
63
|
+
? "1px solid " + props.theme.colors.black
|
|
52
64
|
: "1px solid " + props.theme.colors.mediumGray};
|
|
53
65
|
padding: ${(props) =>
|
|
54
66
|
props.hasUnit ? "11px 40px 11px 10px" : "11px 5px 11px 10px"};
|
|
@@ -59,6 +71,9 @@ const InputContainer = styled("input", inputProps)`
|
|
|
59
71
|
width: 100%;
|
|
60
72
|
box-sizing: border-box; // to allow width of 100% with padding
|
|
61
73
|
font-weight: 500;
|
|
74
|
+
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "auto")};
|
|
75
|
+
background-color: ${(props) =>
|
|
76
|
+
props.isDisabled ? props.theme.colors.grey5 : "#fff"};
|
|
62
77
|
|
|
63
78
|
&::placeholder {
|
|
64
79
|
color: ${(props) =>
|
|
@@ -84,16 +99,16 @@ const ErrorMessage = styled.div`
|
|
|
84
99
|
export default {
|
|
85
100
|
// import InputText from "@eturnity/eturnity_reusable_components/src/components/inputs/inputText"
|
|
86
101
|
// To use:
|
|
87
|
-
//
|
|
88
|
-
//
|
|
89
|
-
//
|
|
90
|
-
//
|
|
91
|
-
//
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
//
|
|
95
|
-
//
|
|
96
|
-
//
|
|
102
|
+
// <input-text
|
|
103
|
+
// placeholder="Company name"
|
|
104
|
+
// :value="companyName"
|
|
105
|
+
// @input-change="onInputChange({ value: $event, type: 'companyName' })"
|
|
106
|
+
// :isError="checkErrors()"
|
|
107
|
+
// :errorMessage="This is my error message"
|
|
108
|
+
// infoTextAlign="right" // left by default
|
|
109
|
+
// infoTextMessage="My info message"
|
|
110
|
+
// label="Question 5"
|
|
111
|
+
// />
|
|
97
112
|
name: "input-text",
|
|
98
113
|
components: {
|
|
99
114
|
Container,
|
|
@@ -134,6 +149,14 @@ export default {
|
|
|
134
149
|
label: {
|
|
135
150
|
required: false,
|
|
136
151
|
},
|
|
152
|
+
noBorder: {
|
|
153
|
+
required: false,
|
|
154
|
+
default: false,
|
|
155
|
+
},
|
|
156
|
+
disabled: {
|
|
157
|
+
required: false,
|
|
158
|
+
default: false,
|
|
159
|
+
},
|
|
137
160
|
},
|
|
138
161
|
methods: {
|
|
139
162
|
onChangeHandler($event) {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<dropdown-row
|
|
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
|
|
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", "")
|