vueless 0.0.573 → 0.0.575
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 +1 -1
- package/ui.data-table/UTableRow.vue +0 -2
- package/ui.form-calendar/utilCalendar.ts +1 -1
- package/ui.form-calendar/utilFormatting.ts +1 -1
- package/ui.form-date-picker/UDatePicker.vue +13 -4
- package/ui.form-date-picker/storybook/stories.ts +0 -1
- package/ui.form-input/UInput.vue +18 -0
- package/web-types.json +9 -1
package/package.json
CHANGED
|
@@ -13,8 +13,6 @@ import UCheckbox from "../ui.form-checkbox/UCheckbox.vue";
|
|
|
13
13
|
|
|
14
14
|
import type { Cell, CellObject, Row, RowScopedProps, UTableRowProps } from "./types.ts";
|
|
15
15
|
|
|
16
|
-
const { hasSlotContent } = useUI(defaultConfig);
|
|
17
|
-
|
|
18
16
|
const NESTED_ROW_SHIFT_REM = 1;
|
|
19
17
|
const LAST_NESTED_ROW_SHIFT_REM = 1.1;
|
|
20
18
|
|
|
@@ -109,7 +109,7 @@ export function parseStringDate<TLocale extends DateLocale>(
|
|
|
109
109
|
let parsedDate = new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0);
|
|
110
110
|
|
|
111
111
|
const isRelativeDay = [locale.tomorrow, locale.today, locale.tomorrow].some((word) => {
|
|
112
|
-
return dateString.toLowerCase().includes(word.toLowerCase());
|
|
112
|
+
return word && dateString.toLowerCase().includes(word.toLowerCase());
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
if (!isRelativeDay) {
|
|
@@ -157,7 +157,11 @@ function onPaste(event: ClipboardEvent) {
|
|
|
157
157
|
const relativeTokensAmount = Number(userFormat.match(/(?<!\\)r/g)?.length);
|
|
158
158
|
|
|
159
159
|
// Amount of tokens used in format string without decimeters.
|
|
160
|
-
const
|
|
160
|
+
const dateFormatTokensAmount = props.userDateFormat
|
|
161
|
+
.split("")
|
|
162
|
+
.filter((char) => Object.keys(TOKEN_REG_EXP).includes(char)).length;
|
|
163
|
+
|
|
164
|
+
const timeFormatTokensAmount = props.userDateTimeFormat
|
|
161
165
|
.split("")
|
|
162
166
|
.filter((char) => Object.keys(TOKEN_REG_EXP).includes(char)).length;
|
|
163
167
|
|
|
@@ -180,13 +184,18 @@ function onPaste(event: ClipboardEvent) {
|
|
|
180
184
|
pastedTokensAmount -= relativeTokensAmount;
|
|
181
185
|
}
|
|
182
186
|
|
|
183
|
-
if (
|
|
187
|
+
if (
|
|
188
|
+
pastedTokensAmount !== dateFormatTokensAmount &&
|
|
189
|
+
pastedTokensAmount !== timeFormatTokensAmount
|
|
190
|
+
) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
184
193
|
|
|
185
194
|
const parsedDate = parseDate(pasteContent, userFormat, locale.value);
|
|
186
195
|
|
|
187
196
|
if (parsedDate) {
|
|
188
197
|
localValue.value = (
|
|
189
|
-
props.dateFormat ? formatDate(parsedDate,
|
|
198
|
+
props.dateFormat ? formatDate(parsedDate, userFormat, locale.value) : parsedDate
|
|
190
199
|
) as TModelValue;
|
|
191
200
|
}
|
|
192
201
|
} catch (error) {
|
|
@@ -259,8 +268,8 @@ defineExpose({
|
|
|
259
268
|
v-bind="isShownCalendar ? datepickerInputActiveAttrs : datepickerInputAttrs"
|
|
260
269
|
@input="onTextInput"
|
|
261
270
|
@focus="activate"
|
|
262
|
-
@paste="onPaste"
|
|
263
271
|
@copy="onCopy"
|
|
272
|
+
@paste="onPaste"
|
|
264
273
|
@keydown.esc="deactivate"
|
|
265
274
|
@keydown="onTextInputKeyDown"
|
|
266
275
|
>
|
package/ui.form-input/UInput.vue
CHANGED
|
@@ -69,6 +69,16 @@ const emit = defineEmits([
|
|
|
69
69
|
* @property {number} modelValue
|
|
70
70
|
*/
|
|
71
71
|
"input",
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Triggers when content copied from the input.
|
|
75
|
+
*/
|
|
76
|
+
"copy",
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Triggers when content pasted to the input.
|
|
80
|
+
*/
|
|
81
|
+
"paste",
|
|
72
82
|
]);
|
|
73
83
|
|
|
74
84
|
const VALIDATION_RULES_REG_EX = {
|
|
@@ -186,6 +196,14 @@ function onMousedown(event: MouseEvent) {
|
|
|
186
196
|
emit("mousedown", event);
|
|
187
197
|
}
|
|
188
198
|
|
|
199
|
+
function onPaste(event: ClipboardEvent) {
|
|
200
|
+
emit("paste", event);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function onCopy(event: ClipboardEvent) {
|
|
204
|
+
emit("copy", event);
|
|
205
|
+
}
|
|
206
|
+
|
|
189
207
|
function onClickShowPassword() {
|
|
190
208
|
isShownPassword.value = !isShownPassword.value;
|
|
191
209
|
}
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "vueless",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.575",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -6013,6 +6013,14 @@
|
|
|
6013
6013
|
"name": "modelValue"
|
|
6014
6014
|
}
|
|
6015
6015
|
]
|
|
6016
|
+
},
|
|
6017
|
+
{
|
|
6018
|
+
"name": "copy",
|
|
6019
|
+
"description": "Triggers when content copied from the input."
|
|
6020
|
+
},
|
|
6021
|
+
{
|
|
6022
|
+
"name": "paste",
|
|
6023
|
+
"description": "Triggers when content pasted to the input."
|
|
6016
6024
|
}
|
|
6017
6025
|
],
|
|
6018
6026
|
"slots": [
|