ar-design 0.3.74 → 0.3.76
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.
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
user-select: none;
|
|
5
5
|
|
|
6
6
|
> .ar-select {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: row;
|
|
7
9
|
position: relative;
|
|
8
10
|
width: 100%;
|
|
9
11
|
|
|
@@ -73,92 +75,100 @@
|
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
> .ar-input-wrapper {
|
|
76
|
-
padding-right: 3rem;
|
|
77
|
-
overflow: hidden;
|
|
78
78
|
white-space: nowrap;
|
|
79
79
|
text-overflow: ellipsis;
|
|
80
80
|
|
|
81
81
|
> .ar-input {
|
|
82
|
-
padding-right: 3rem;
|
|
83
|
-
overflow: hidden;
|
|
84
82
|
white-space: nowrap;
|
|
85
83
|
text-overflow: ellipsis;
|
|
86
84
|
|
|
87
|
-
> input {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
> .input {
|
|
86
|
+
width: 100%;
|
|
87
|
+
|
|
88
|
+
> input {
|
|
89
|
+
width: 100%;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
white-space: nowrap;
|
|
92
|
+
text-overflow: ellipsis;
|
|
93
|
+
outline: none;
|
|
94
|
+
padding-right: 3.5rem;
|
|
95
|
+
}
|
|
92
96
|
}
|
|
93
97
|
}
|
|
94
98
|
}
|
|
95
99
|
|
|
96
|
-
|
|
97
|
-
position:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
right: 0.5rem;
|
|
101
|
-
width: 0.75rem;
|
|
102
|
-
height: 0.75rem;
|
|
103
|
-
cursor: pointer;
|
|
104
|
-
transform-origin: center;
|
|
105
|
-
transition: transform 250ms ease-in-out;
|
|
106
|
-
|
|
107
|
-
&.opened {
|
|
108
|
-
transform: translateY(-50%) scaleY(-1);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
&.closed {
|
|
112
|
-
transform: translateY(-50%) scaleY(1);
|
|
113
|
-
}
|
|
100
|
+
.buttons {
|
|
101
|
+
position: relative;
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: row;
|
|
114
104
|
|
|
115
|
-
|
|
116
|
-
display: inline-block;
|
|
117
|
-
content: "";
|
|
105
|
+
> .angel-down {
|
|
118
106
|
position: absolute;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
}
|
|
107
|
+
top: calc(var(--input-height) / 2);
|
|
108
|
+
transform: translateY(-50%);
|
|
109
|
+
right: 0.5rem;
|
|
110
|
+
width: 0.75rem;
|
|
111
|
+
height: 0.75rem;
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
transform-origin: center;
|
|
114
|
+
transition: transform 250ms ease-in-out;
|
|
115
|
+
|
|
116
|
+
&.opened {
|
|
117
|
+
transform: translateY(-50%) scaleY(-1);
|
|
118
|
+
}
|
|
133
119
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
transform: translateY(-50%);
|
|
138
|
-
right: 2rem;
|
|
139
|
-
background-color: rgba(var(--black-rgb), 0.25);
|
|
140
|
-
backdrop-filter: blur(5px);
|
|
141
|
-
width: 1rem;
|
|
142
|
-
height: 1rem;
|
|
143
|
-
border-radius: var(--border-radius-pill);
|
|
144
|
-
text-align: center;
|
|
145
|
-
line-height: 0.7rem;
|
|
146
|
-
cursor: pointer;
|
|
147
|
-
|
|
148
|
-
&.opened {
|
|
149
|
-
visibility: visible;
|
|
150
|
-
opacity: 1;
|
|
151
|
-
}
|
|
120
|
+
&.closed {
|
|
121
|
+
transform: translateY(-50%) scaleY(1);
|
|
122
|
+
}
|
|
152
123
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
124
|
+
&::before {
|
|
125
|
+
display: inline-block;
|
|
126
|
+
content: "";
|
|
127
|
+
position: absolute;
|
|
128
|
+
width: 100%;
|
|
129
|
+
height: 100%;
|
|
130
|
+
border: 1px transparent;
|
|
131
|
+
border-top-style: dashed;
|
|
132
|
+
border-right-style: dashed;
|
|
133
|
+
border-bottom-style: solid;
|
|
134
|
+
border-left-style: solid;
|
|
135
|
+
border-top-color: rgba(var(--black-rgb), 0.1);
|
|
136
|
+
border-right-color: rgba(var(--black-rgb), 0.1);
|
|
137
|
+
border-bottom-color: rgba(var(--black-rgb), 0.5);
|
|
138
|
+
border-left-color: rgba(var(--black-rgb), 0.5);
|
|
139
|
+
transform: rotate(-45deg);
|
|
140
|
+
}
|
|
156
141
|
}
|
|
157
142
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
143
|
+
> .button-clear {
|
|
144
|
+
position: absolute;
|
|
145
|
+
top: calc(var(--input-height) / 2);
|
|
146
|
+
transform: translateY(-50%);
|
|
147
|
+
right: 2rem;
|
|
148
|
+
background-color: rgba(var(--black-rgb), 0.25);
|
|
149
|
+
backdrop-filter: blur(5px);
|
|
150
|
+
width: 1rem;
|
|
151
|
+
height: 1rem;
|
|
152
|
+
border-radius: var(--border-radius-pill);
|
|
153
|
+
text-align: center;
|
|
154
|
+
line-height: 0.7rem;
|
|
155
|
+
cursor: pointer;
|
|
156
|
+
|
|
157
|
+
&.opened {
|
|
158
|
+
visibility: visible;
|
|
159
|
+
opacity: 1;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&.closed {
|
|
163
|
+
visibility: hidden;
|
|
164
|
+
opacity: 0;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&::before {
|
|
168
|
+
content: "x";
|
|
169
|
+
color: var(--white);
|
|
170
|
+
font-size: 0.75rem;
|
|
171
|
+
}
|
|
162
172
|
}
|
|
163
173
|
}
|
|
164
174
|
|
|
@@ -296,18 +296,19 @@ const Select = ({ variant = "outlined", status, color, border = { radius: "sm" }
|
|
|
296
296
|
return;
|
|
297
297
|
setSearchText(event.currentTarget.value);
|
|
298
298
|
}, placeholder: placeholder, validation: validation, disabled: disabled })),
|
|
299
|
-
React.createElement("
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
299
|
+
React.createElement("div", { className: "buttons" },
|
|
300
|
+
React.createElement("span", { className: `button-clear ${!disabled && (multiple ? value.length > 0 : value) ? "opened" : "closed"}`, onClick: (event) => {
|
|
301
|
+
if (disabled)
|
|
302
|
+
return;
|
|
303
|
+
event.stopPropagation();
|
|
304
|
+
handleCleanSelection();
|
|
305
|
+
} }),
|
|
306
|
+
React.createElement("span", { className: `angel-down ${!disabled && optionsOpen ? "opened" : "closed"}`, onClick: (event) => {
|
|
307
|
+
if (disabled)
|
|
308
|
+
return;
|
|
309
|
+
event.stopPropagation();
|
|
310
|
+
setOptionsOpen((x) => !x);
|
|
311
|
+
} })),
|
|
311
312
|
multiple && validation && React.createElement("span", { className: "validation" }, validation.text)),
|
|
312
313
|
!disabled &&
|
|
313
314
|
optionsOpen &&
|
|
@@ -135,7 +135,21 @@ export const useValidation = function (data, params, step) {
|
|
|
135
135
|
if (s.type === "maximum" && vLenght > s.value) {
|
|
136
136
|
setError(key, Utils.StringFormat(s.message, s.value), param.step, index);
|
|
137
137
|
}
|
|
138
|
-
|
|
138
|
+
// Regexes
|
|
139
|
+
const phoneRegex = /^((\+90|0)?([2-5]\d{2})\d{7}|\+[1-9]\d{7,14})$/;
|
|
140
|
+
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
141
|
+
const ibanRegex = /^TR\d{24}$/;
|
|
142
|
+
const accountNumberRegex = /^\d{6,16}$/;
|
|
143
|
+
if (s.type === "phone" && value && !phoneRegex.test(value)) {
|
|
144
|
+
setError(key, s.message, param.step, index);
|
|
145
|
+
}
|
|
146
|
+
if (s.type === "email" && value && !emailRegex.test(value)) {
|
|
147
|
+
setError(key, s.message, param.step, index);
|
|
148
|
+
}
|
|
149
|
+
if (s.type === "iban" && value && !ibanRegex.test(value.replace(/\s/g, ""))) {
|
|
150
|
+
setError(key, s.message, param.step, index);
|
|
151
|
+
}
|
|
152
|
+
if (s.type === "account-number" && value && !accountNumberRegex.test(value)) {
|
|
139
153
|
setError(key, s.message, param.step, index);
|
|
140
154
|
}
|
|
141
155
|
};
|
|
@@ -69,7 +69,7 @@ export type KanbanBoardColumnType<T, TColumnProperties> = {
|
|
|
69
69
|
columnProperties: TColumnProperties;
|
|
70
70
|
};
|
|
71
71
|
export type ValidationShape = {
|
|
72
|
-
type: "required" | "minimum" | "maximum" | "email";
|
|
72
|
+
type: "required" | "minimum" | "maximum" | "email" | "phone" | "iban" | "account-number";
|
|
73
73
|
value?: string | number;
|
|
74
74
|
message: string;
|
|
75
75
|
};
|