@pequity/squirrel 5.4.8 → 5.4.9
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/README.md +1 -1
- package/dist/cjs/chunks/p-date-picker.js +143 -85
- package/dist/cjs/chunks/p-inline-date-picker.js +117 -67
- package/dist/es/chunks/p-date-picker.js +144 -86
- package/dist/es/chunks/p-inline-date-picker.js +118 -68
- package/dist/squirrel/components/p-date-picker/p-date-picker.vue.d.ts +27 -31
- package/dist/squirrel/components/p-drawer/p-drawer.vue.d.ts +2 -2
- package/dist/squirrel/components/p-dropdown-select/p-dropdown-select.vue.d.ts +1 -1
- package/dist/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue.d.ts +46 -0
- package/dist/squirrel/components/p-modal/p-modal.vue.d.ts +3 -3
- package/dist/style.css +37 -928
- package/package.json +7 -9
- package/squirrel/assets/squirrel.css +45 -6
- package/squirrel/components/p-date-picker/p-date-picker.spec.js +292 -0
- package/squirrel/components/p-date-picker/p-date-picker.stories.js +2 -2
- package/squirrel/components/p-date-picker/p-date-picker.vue +45 -90
- package/squirrel/components/p-inline-date-picker/p-inline-date-picker.spec.js +21 -45
- package/squirrel/components/p-inline-date-picker/p-inline-date-picker.stories.js +2 -2
- package/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue +16 -85
|
@@ -1,106 +1,164 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, mergeModels, useModel, useAttrs, computed, openBlock, createBlock, unref, mergeProps, withCtx, createVNode, withKeys } from "vue";
|
|
2
2
|
import PInput from "../p-input.js";
|
|
3
|
-
import
|
|
4
|
-
import dayjs from "dayjs";
|
|
5
|
-
import { isString, isDate } from "lodash-es";
|
|
6
|
-
import { DatePicker } from "v-calendar";
|
|
7
|
-
const _hoisted_1 = ["data-has-error"];
|
|
3
|
+
import VueDatePicker from "@vuepic/vue-datepicker";
|
|
8
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
5
|
...{
|
|
10
6
|
name: "PDatePicker",
|
|
11
7
|
inheritAttrs: false
|
|
12
8
|
},
|
|
13
9
|
__name: "p-date-picker",
|
|
14
|
-
props: {
|
|
15
|
-
modelValue: { default: "" },
|
|
10
|
+
props: /* @__PURE__ */ mergeModels({
|
|
16
11
|
label: { default: "" },
|
|
17
12
|
errorMsg: { default: "" },
|
|
18
13
|
required: { type: Boolean, default: false },
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
uid: {},
|
|
15
|
+
name: {},
|
|
16
|
+
is24: { type: Boolean },
|
|
17
|
+
enableTimePicker: { type: Boolean, default: false },
|
|
18
|
+
range: { type: [Boolean, Object] },
|
|
19
|
+
multiCalendars: { type: [Boolean, Number, String, Object] },
|
|
20
|
+
modelValue: {},
|
|
21
|
+
locale: {},
|
|
22
|
+
position: {},
|
|
23
|
+
dark: { type: Boolean },
|
|
24
|
+
placeholder: {},
|
|
25
|
+
weekNumbers: {},
|
|
26
|
+
hoursIncrement: {},
|
|
27
|
+
hoursGridIncrement: {},
|
|
28
|
+
secondsGridIncrement: {},
|
|
29
|
+
minutesGridIncrement: {},
|
|
30
|
+
minutesIncrement: {},
|
|
31
|
+
secondsIncrement: {},
|
|
32
|
+
minDate: {},
|
|
33
|
+
maxDate: {},
|
|
34
|
+
minTime: {},
|
|
35
|
+
maxTime: {},
|
|
36
|
+
weekStart: { default: 0 },
|
|
37
|
+
disabled: { type: Boolean },
|
|
38
|
+
readonly: { type: Boolean },
|
|
39
|
+
format: { type: [String, Function], default: "dd-MMM-yyyy" },
|
|
40
|
+
previewFormat: {},
|
|
41
|
+
hideInputIcon: { type: Boolean },
|
|
42
|
+
state: { type: Boolean },
|
|
43
|
+
clearable: { type: Boolean },
|
|
44
|
+
autoApply: { type: Boolean, default: true },
|
|
45
|
+
filters: {},
|
|
46
|
+
disableMonthYearSelect: { type: Boolean },
|
|
47
|
+
yearRange: {},
|
|
48
|
+
disabledDates: {},
|
|
49
|
+
inline: { type: [Boolean, Object], default: false },
|
|
50
|
+
selectText: {},
|
|
51
|
+
cancelText: {},
|
|
52
|
+
weekNumName: {},
|
|
53
|
+
autoPosition: { type: [Boolean, String] },
|
|
54
|
+
monthPicker: { type: Boolean },
|
|
55
|
+
timePicker: { type: Boolean },
|
|
56
|
+
textInput: { type: [Boolean, Object], default: true },
|
|
57
|
+
monthNameFormat: {},
|
|
58
|
+
startDate: {},
|
|
59
|
+
startTime: {},
|
|
60
|
+
hideOffsetDates: { type: Boolean, default: true },
|
|
61
|
+
noToday: { type: Boolean },
|
|
62
|
+
noHoursOverlay: { type: Boolean },
|
|
63
|
+
noMinutesOverlay: { type: Boolean },
|
|
64
|
+
noSecondsOverlay: { type: Boolean },
|
|
65
|
+
altPosition: {},
|
|
66
|
+
disabledWeekDays: {},
|
|
67
|
+
allowedDates: {},
|
|
68
|
+
nowButtonLabel: {},
|
|
69
|
+
monthChangeOnScroll: { type: [Boolean, String] },
|
|
70
|
+
markers: {},
|
|
71
|
+
transitions: { type: [Boolean, Object] },
|
|
72
|
+
enableSeconds: { type: Boolean },
|
|
73
|
+
escClose: { type: Boolean },
|
|
74
|
+
spaceConfirm: { type: Boolean },
|
|
75
|
+
monthChangeOnArrows: { type: Boolean },
|
|
76
|
+
formatLocale: {},
|
|
77
|
+
autocomplete: {},
|
|
78
|
+
multiDates: { type: [Boolean, Object] },
|
|
79
|
+
presetDates: {},
|
|
80
|
+
flow: {},
|
|
81
|
+
partialFlow: { type: Boolean },
|
|
82
|
+
preventMinMaxNavigation: { type: Boolean },
|
|
83
|
+
utc: { type: [Boolean, String] },
|
|
84
|
+
reverseYears: { type: Boolean },
|
|
85
|
+
weekPicker: { type: Boolean },
|
|
86
|
+
vertical: { type: Boolean },
|
|
87
|
+
ariaLabels: {},
|
|
88
|
+
arrowNavigation: { type: Boolean },
|
|
89
|
+
yearPicker: { type: Boolean },
|
|
90
|
+
dayNames: {},
|
|
91
|
+
modelType: { default: "yyyy-MM-dd" },
|
|
92
|
+
modelAuto: { type: Boolean },
|
|
93
|
+
highlight: {},
|
|
94
|
+
offset: {},
|
|
95
|
+
teleportCenter: { type: Boolean },
|
|
96
|
+
teleport: { type: [Boolean, String] },
|
|
97
|
+
ignoreTimeValidation: { type: Boolean },
|
|
98
|
+
dayClass: {},
|
|
99
|
+
hideNavigation: {},
|
|
100
|
+
sixWeeks: { type: [Boolean, String] },
|
|
101
|
+
timezone: {},
|
|
102
|
+
disableYearSelect: { type: Boolean },
|
|
103
|
+
focusStartDate: { type: Boolean },
|
|
104
|
+
disabledTimes: {},
|
|
105
|
+
timePickerInline: { type: Boolean },
|
|
106
|
+
calendar: {},
|
|
107
|
+
config: {},
|
|
108
|
+
quarterPicker: { type: Boolean },
|
|
109
|
+
yearFirst: { type: Boolean },
|
|
110
|
+
loading: { type: Boolean },
|
|
111
|
+
onInternalModelChange: {},
|
|
112
|
+
enableMinutes: { type: Boolean },
|
|
113
|
+
ui: {}
|
|
114
|
+
}, {
|
|
115
|
+
"modelValue": { default: "" },
|
|
116
|
+
"modelModifiers": {}
|
|
117
|
+
}),
|
|
23
118
|
emits: ["update:modelValue"],
|
|
24
|
-
setup(__props
|
|
25
|
-
const selectAttribute = { highlight: { class: "bg-primary", contentClass: "text-white" } };
|
|
26
|
-
const DEFAULT_MASKS = {
|
|
27
|
-
// The mask for the input
|
|
28
|
-
input: "DD-MMM-YYYY",
|
|
29
|
-
// The mask for the model value
|
|
30
|
-
data: "YYYY-MM-DD"
|
|
31
|
-
};
|
|
119
|
+
setup(__props) {
|
|
32
120
|
const props = __props;
|
|
33
|
-
const
|
|
34
|
-
const { labelClasses, errorMsgClasses } = useInputClasses(props);
|
|
121
|
+
const model = useModel(__props, "modelValue");
|
|
35
122
|
const attrs = useAttrs();
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return Object.assign(DEFAULT_MASKS, attrs.masks);
|
|
40
|
-
});
|
|
41
|
-
const displayPlaceholder = computed(() => {
|
|
42
|
-
return isString(attrs.placeholder) ? attrs.placeholder : masks.value.input;
|
|
123
|
+
const datePickerProps = computed(() => {
|
|
124
|
+
const { modelValue: _, ...propsWithoutModelValue } = props;
|
|
125
|
+
return propsWithoutModelValue;
|
|
43
126
|
});
|
|
44
|
-
const
|
|
45
|
-
const { class: classes, style
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
() => props.modelValue,
|
|
53
|
-
(nV) => {
|
|
54
|
-
if (!stopWatch.value) {
|
|
55
|
-
innerValue.value = nV ? dayjs(nV, masks.value.data).toDate() : null;
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
{ immediate: true }
|
|
59
|
-
);
|
|
60
|
-
watch(innerValue, (nV) => {
|
|
61
|
-
const toEmit = isDate(nV) && nV.toString() !== "Invalid Date" ? dayjs(nV).format(masks.value.data) : null;
|
|
62
|
-
stopWatch.value = true;
|
|
63
|
-
emit("update:modelValue", toEmit);
|
|
64
|
-
nextTick(() => {
|
|
65
|
-
stopWatch.value = false;
|
|
66
|
-
});
|
|
127
|
+
const inputPropsAndAttrs = computed(() => {
|
|
128
|
+
const { class: classes, style, ...res } = attrs;
|
|
129
|
+
res.label = props.label;
|
|
130
|
+
res.errorMsg = props.errorMsg;
|
|
131
|
+
res.required = props.required;
|
|
132
|
+
res.disabled = props.disabled;
|
|
133
|
+
res.placeholder = props.placeholder ? props.placeholder : props.format;
|
|
134
|
+
return res;
|
|
67
135
|
});
|
|
136
|
+
const handleInput = (e, onInputFn, onClearFn) => {
|
|
137
|
+
if (e.target instanceof HTMLInputElement && e.target.value === "") {
|
|
138
|
+
onClearFn(e);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
return onInputFn(e);
|
|
142
|
+
};
|
|
68
143
|
return (_ctx, _cache) => {
|
|
69
|
-
return openBlock(),
|
|
70
|
-
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
144
|
+
return openBlock(), createBlock(unref(VueDatePicker), mergeProps({
|
|
145
|
+
modelValue: model.value,
|
|
146
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
147
|
+
class: [{ hidden: _ctx.$attrs.hidden }, _ctx.$attrs.class]
|
|
148
|
+
}, datePickerProps.value), {
|
|
149
|
+
"dp-input": withCtx(({ value, onInput, onEnter, onTab, onFocus, onBlur, onClear }) => [
|
|
150
|
+
createVNode(PInput, mergeProps({ "model-value": value }, inputPropsAndAttrs.value, {
|
|
151
|
+
onInput: ($event) => handleInput($event, onInput, onClear),
|
|
152
|
+
onKeydown: [
|
|
153
|
+
withKeys(($event) => onEnter($event), ["enter"]),
|
|
154
|
+
withKeys(($event) => onTab($event), ["tab"])
|
|
155
|
+
],
|
|
156
|
+
onFocus,
|
|
157
|
+
onBlur
|
|
158
|
+
}), null, 16, ["model-value", "onInput", "onKeydown", "onFocus", "onBlur"])
|
|
82
159
|
]),
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => innerValue.value = $event),
|
|
86
|
-
"select-attribute": selectAttribute,
|
|
87
|
-
popover: { visibility: "click", placement: "auto" },
|
|
88
|
-
"min-date": _ctx.minDate || null,
|
|
89
|
-
"max-date": _ctx.maxDate || null,
|
|
90
|
-
masks: masks.value,
|
|
91
|
-
timezone: _ctx.timezone
|
|
92
|
-
}, {
|
|
93
|
-
default: withCtx(({ inputValue, inputEvents }) => [
|
|
94
|
-
createVNode(PInput, mergeProps({ value: inputValue }, attrsWithoutClassAndStyle.value, { placeholder: displayPlaceholder.value }, toHandlers(inputEvents)), null, 16, ["value", "placeholder"])
|
|
95
|
-
]),
|
|
96
|
-
_: 1
|
|
97
|
-
}, 8, ["modelValue", "min-date", "max-date", "masks", "timezone"]),
|
|
98
|
-
withDirectives(createElementVNode("div", {
|
|
99
|
-
class: normalizeClass(unref(errorMsgClasses))
|
|
100
|
-
}, toDisplayString(_ctx.errorMsg), 3), [
|
|
101
|
-
[vShow, _ctx.errorMsg]
|
|
102
|
-
])
|
|
103
|
-
], 14, _hoisted_1);
|
|
160
|
+
_: 1
|
|
161
|
+
}, 16, ["modelValue", "class"]);
|
|
104
162
|
};
|
|
105
163
|
}
|
|
106
164
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, mergeModels, useModel, useAttrs, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, unref, toDisplayString, createCommentVNode, createVNode, mergeProps, withDirectives, createElementVNode, vShow } from "vue";
|
|
2
2
|
import { useInputClasses } from "../useInputClasses.js";
|
|
3
|
-
import
|
|
4
|
-
import { DatePicker } from "v-calendar";
|
|
3
|
+
import VueDatePicker from "@vuepic/vue-datepicker";
|
|
5
4
|
const _hoisted_1 = ["data-has-error"];
|
|
6
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
6
|
...{
|
|
@@ -9,69 +8,128 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
9
8
|
inheritAttrs: false
|
|
10
9
|
},
|
|
11
10
|
__name: "p-inline-date-picker",
|
|
12
|
-
props: {
|
|
13
|
-
modelValue: { default: "" },
|
|
11
|
+
props: /* @__PURE__ */ mergeModels({
|
|
14
12
|
label: { default: "" },
|
|
15
13
|
errorMsg: { default: "" },
|
|
16
14
|
required: { type: Boolean, default: false },
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
uid: {},
|
|
16
|
+
name: {},
|
|
17
|
+
is24: { type: Boolean },
|
|
18
|
+
enableTimePicker: { type: Boolean, default: false },
|
|
19
|
+
range: { type: [Boolean, Object] },
|
|
20
|
+
multiCalendars: { type: [Boolean, Number, String, Object] },
|
|
21
|
+
modelValue: {},
|
|
22
|
+
locale: {},
|
|
23
|
+
position: {},
|
|
24
|
+
dark: { type: Boolean },
|
|
25
|
+
placeholder: {},
|
|
26
|
+
weekNumbers: {},
|
|
27
|
+
hoursIncrement: {},
|
|
28
|
+
hoursGridIncrement: {},
|
|
29
|
+
secondsGridIncrement: {},
|
|
30
|
+
minutesGridIncrement: {},
|
|
31
|
+
minutesIncrement: {},
|
|
32
|
+
secondsIncrement: {},
|
|
33
|
+
minDate: {},
|
|
34
|
+
maxDate: {},
|
|
35
|
+
minTime: {},
|
|
36
|
+
maxTime: {},
|
|
37
|
+
weekStart: { default: 0 },
|
|
38
|
+
disabled: { type: Boolean },
|
|
39
|
+
readonly: { type: Boolean },
|
|
40
|
+
format: {},
|
|
41
|
+
previewFormat: {},
|
|
42
|
+
hideInputIcon: { type: Boolean },
|
|
43
|
+
state: { type: Boolean },
|
|
44
|
+
clearable: { type: Boolean },
|
|
45
|
+
autoApply: { type: Boolean, default: true },
|
|
46
|
+
filters: {},
|
|
47
|
+
disableMonthYearSelect: { type: Boolean },
|
|
48
|
+
yearRange: {},
|
|
49
|
+
disabledDates: {},
|
|
50
|
+
inline: { type: [Boolean, Object], default: true },
|
|
51
|
+
selectText: {},
|
|
52
|
+
cancelText: {},
|
|
53
|
+
weekNumName: {},
|
|
54
|
+
autoPosition: { type: [Boolean, String] },
|
|
55
|
+
monthPicker: { type: Boolean },
|
|
56
|
+
timePicker: { type: Boolean },
|
|
57
|
+
textInput: { type: [Boolean, Object] },
|
|
58
|
+
monthNameFormat: {},
|
|
59
|
+
startDate: {},
|
|
60
|
+
startTime: {},
|
|
61
|
+
hideOffsetDates: { type: Boolean, default: true },
|
|
62
|
+
noToday: { type: Boolean },
|
|
63
|
+
noHoursOverlay: { type: Boolean },
|
|
64
|
+
noMinutesOverlay: { type: Boolean },
|
|
65
|
+
noSecondsOverlay: { type: Boolean },
|
|
66
|
+
altPosition: {},
|
|
67
|
+
disabledWeekDays: {},
|
|
68
|
+
allowedDates: {},
|
|
69
|
+
nowButtonLabel: {},
|
|
70
|
+
monthChangeOnScroll: { type: [Boolean, String] },
|
|
71
|
+
markers: {},
|
|
72
|
+
transitions: { type: [Boolean, Object] },
|
|
73
|
+
enableSeconds: { type: Boolean },
|
|
74
|
+
escClose: { type: Boolean },
|
|
75
|
+
spaceConfirm: { type: Boolean },
|
|
76
|
+
monthChangeOnArrows: { type: Boolean },
|
|
77
|
+
formatLocale: {},
|
|
78
|
+
autocomplete: {},
|
|
79
|
+
multiDates: { type: [Boolean, Object] },
|
|
80
|
+
presetDates: {},
|
|
81
|
+
flow: {},
|
|
82
|
+
partialFlow: { type: Boolean },
|
|
83
|
+
preventMinMaxNavigation: { type: Boolean },
|
|
84
|
+
utc: { type: [Boolean, String] },
|
|
85
|
+
reverseYears: { type: Boolean },
|
|
86
|
+
weekPicker: { type: Boolean },
|
|
87
|
+
vertical: { type: Boolean },
|
|
88
|
+
ariaLabels: {},
|
|
89
|
+
arrowNavigation: { type: Boolean },
|
|
90
|
+
yearPicker: { type: Boolean },
|
|
91
|
+
dayNames: {},
|
|
92
|
+
modelType: { default: "yyyy-MM-dd" },
|
|
93
|
+
modelAuto: { type: Boolean },
|
|
94
|
+
highlight: {},
|
|
95
|
+
offset: {},
|
|
96
|
+
teleportCenter: { type: Boolean },
|
|
97
|
+
teleport: { type: [Boolean, String] },
|
|
98
|
+
ignoreTimeValidation: { type: Boolean },
|
|
99
|
+
dayClass: {},
|
|
100
|
+
hideNavigation: {},
|
|
101
|
+
sixWeeks: { type: [Boolean, String] },
|
|
102
|
+
timezone: {},
|
|
103
|
+
disableYearSelect: { type: Boolean },
|
|
104
|
+
focusStartDate: { type: Boolean },
|
|
105
|
+
disabledTimes: {},
|
|
106
|
+
timePickerInline: { type: Boolean },
|
|
107
|
+
calendar: {},
|
|
108
|
+
config: {},
|
|
109
|
+
quarterPicker: { type: Boolean },
|
|
110
|
+
yearFirst: { type: Boolean },
|
|
111
|
+
loading: { type: Boolean },
|
|
112
|
+
onInternalModelChange: {},
|
|
113
|
+
enableMinutes: { type: Boolean },
|
|
114
|
+
ui: {}
|
|
115
|
+
}, {
|
|
116
|
+
"modelValue": { default: "" },
|
|
117
|
+
"modelModifiers": {}
|
|
118
|
+
}),
|
|
21
119
|
emits: ["update:modelValue"],
|
|
22
|
-
setup(__props
|
|
23
|
-
const selectAttribute = {
|
|
24
|
-
highlight: { class: "bg-primary", contentClass: "text-white" }
|
|
25
|
-
};
|
|
26
|
-
const DEFAULT_MASKS = {
|
|
27
|
-
// The mask for the input
|
|
28
|
-
input: "DD-MMM-YYYY",
|
|
29
|
-
// The mask for the model value
|
|
30
|
-
data: "YYYY-MM-DD"
|
|
31
|
-
};
|
|
120
|
+
setup(__props) {
|
|
32
121
|
const props = __props;
|
|
33
|
-
const
|
|
34
|
-
const { labelClasses, errorMsgClasses } = useInputClasses(props);
|
|
122
|
+
const model = useModel(__props, "modelValue");
|
|
35
123
|
const attrs = useAttrs();
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const listeners = computed(() => {
|
|
42
|
-
return Object.keys(attrs).reduce((acc, curr) => {
|
|
43
|
-
if (curr.startsWith("on")) {
|
|
44
|
-
return { ...acc, [curr]: attrs[curr] };
|
|
45
|
-
} else {
|
|
46
|
-
return acc;
|
|
47
|
-
}
|
|
48
|
-
}, {});
|
|
124
|
+
const { labelClasses, errorMsgClasses } = useInputClasses(props);
|
|
125
|
+
const datePickerProps = computed(() => {
|
|
126
|
+
const { modelValue: _, ...propsWithoutModelValue } = props;
|
|
127
|
+
const { class: classes, style: style2, ...attrsWithoutClassAndStyle } = attrs;
|
|
128
|
+
return { ...propsWithoutModelValue, ...attrsWithoutClassAndStyle };
|
|
49
129
|
});
|
|
50
130
|
const style = computed(() => {
|
|
51
131
|
return attrs.style;
|
|
52
132
|
});
|
|
53
|
-
const styleDatepicker = computed(() => {
|
|
54
|
-
return props.errorMsg ? { border: "1px solid #f0453c" } : {};
|
|
55
|
-
});
|
|
56
|
-
const dayclick = (e) => {
|
|
57
|
-
emit("update:modelValue", e.id);
|
|
58
|
-
};
|
|
59
|
-
watch(
|
|
60
|
-
() => props.modelValue,
|
|
61
|
-
async (nV) => {
|
|
62
|
-
const date = dayjs(nV, masks.value.data).toDate();
|
|
63
|
-
if (nV && date.toString() === "Invalid Date") {
|
|
64
|
-
emit("update:modelValue", null);
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
innerValue.value = nV ? dayjs(nV, masks.value.data).toDate() : null;
|
|
68
|
-
const datepicker = datepickerRef.value;
|
|
69
|
-
if (datepicker && typeof datepicker.move === "function" && innerValue.value) {
|
|
70
|
-
await datepicker.move(innerValue.value);
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
{ immediate: true }
|
|
74
|
-
);
|
|
75
133
|
return (_ctx, _cache) => {
|
|
76
134
|
return openBlock(), createElementBlock("div", {
|
|
77
135
|
class: normalizeClass([{ hidden: _ctx.$attrs.hidden }, _ctx.$attrs.class]),
|
|
@@ -87,18 +145,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
87
145
|
class: normalizeClass(unref(labelClasses))
|
|
88
146
|
}, toDisplayString(_ctx.label), 3)) : createCommentVNode("", true)
|
|
89
147
|
]),
|
|
90
|
-
createVNode(unref(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"model-value": innerValue.value,
|
|
95
|
-
"select-attribute": selectAttribute,
|
|
96
|
-
"min-date": _ctx.minDate || null,
|
|
97
|
-
"max-date": _ctx.maxDate || null,
|
|
98
|
-
masks: masks.value,
|
|
99
|
-
style: styleDatepicker.value,
|
|
100
|
-
timezone: _ctx.timezone
|
|
101
|
-
}, listeners.value, { onDayclick: dayclick }), null, 16, ["class", "model-value", "min-date", "max-date", "masks", "style", "timezone"]),
|
|
148
|
+
createVNode(unref(VueDatePicker), mergeProps({
|
|
149
|
+
modelValue: model.value,
|
|
150
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event)
|
|
151
|
+
}, datePickerProps.value), null, 16, ["modelValue"]),
|
|
102
152
|
withDirectives(createElementVNode("div", {
|
|
103
153
|
class: normalizeClass(unref(errorMsgClasses))
|
|
104
154
|
}, toDisplayString(_ctx.errorMsg), 3), [
|
|
@@ -1,41 +1,37 @@
|
|
|
1
|
+
import { type VueDatePickerProps } from '@vuepic/vue-datepicker';
|
|
1
2
|
type Props = {
|
|
2
|
-
modelValue?: string | null;
|
|
3
3
|
label?: string;
|
|
4
4
|
errorMsg?: string;
|
|
5
5
|
required?: boolean;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
labelClasses: string;
|
|
16
|
-
}): any;
|
|
17
|
-
};
|
|
18
|
-
refs: {};
|
|
19
|
-
rootEl: any;
|
|
20
|
-
};
|
|
21
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
22
|
-
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
|
-
"update:modelValue": (value: string | null) => any;
|
|
24
|
-
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
25
|
-
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
6
|
+
} & VueDatePickerProps;
|
|
7
|
+
type __VLS_Props = Props;
|
|
8
|
+
type __VLS_PublicProps = {
|
|
9
|
+
modelValue?: Date | string | null;
|
|
10
|
+
} & __VLS_Props;
|
|
11
|
+
declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
"update:modelValue": (value: string | Date | null) => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
14
|
+
"onUpdate:modelValue"?: ((value: string | Date | null) => any) | undefined;
|
|
26
15
|
}>, {
|
|
27
16
|
label: string;
|
|
17
|
+
inline: boolean | {
|
|
18
|
+
input?: boolean;
|
|
19
|
+
};
|
|
28
20
|
required: boolean;
|
|
29
|
-
modelValue: string | null;
|
|
30
21
|
errorMsg: string;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
enableTimePicker: boolean;
|
|
23
|
+
weekStart: "0" | "1" | "2" | "3" | "4" | "5" | "6" | 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
24
|
+
format: string | ((date: Date) => string) | ((dates: Date[]) => string);
|
|
25
|
+
autoApply: boolean;
|
|
26
|
+
textInput: boolean | {
|
|
27
|
+
enterSubmit?: boolean;
|
|
28
|
+
tabSubmit?: boolean;
|
|
29
|
+
openMenu?: "open" | "toggle" | boolean;
|
|
30
|
+
rangeSeparator?: string;
|
|
31
|
+
selectOnFocus?: boolean;
|
|
32
|
+
format?: string | string[] | ((value: string) => Date | null);
|
|
33
|
+
};
|
|
34
|
+
hideOffsetDates: boolean;
|
|
35
|
+
modelType: "timestamp" | "iso" | "format" | string;
|
|
34
36
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
36
37
|
export default _default;
|
|
37
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
38
|
-
new (): {
|
|
39
|
-
$slots: S;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
@@ -79,7 +79,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
79
79
|
beforeClose(): void;
|
|
80
80
|
closing(): void;
|
|
81
81
|
closed(): void;
|
|
82
|
-
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "before-open" | "opening" | "opened" | "before-close" | "closing"
|
|
82
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "closed" | "before-open" | "opening" | "opened" | "before-close" | "closing")[], "update:modelValue" | "closed" | "before-open" | "opening" | "opened" | "before-close" | "closing", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
83
83
|
appendTo: {
|
|
84
84
|
type: StringConstructor;
|
|
85
85
|
default: string;
|
|
@@ -147,12 +147,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
147
147
|
};
|
|
148
148
|
}>> & Readonly<{
|
|
149
149
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
150
|
+
onClosed?: ((...args: any[]) => any) | undefined;
|
|
150
151
|
"onBefore-open"?: ((...args: any[]) => any) | undefined;
|
|
151
152
|
onOpening?: ((...args: any[]) => any) | undefined;
|
|
152
153
|
onOpened?: ((...args: any[]) => any) | undefined;
|
|
153
154
|
"onBefore-close"?: ((...args: any[]) => any) | undefined;
|
|
154
155
|
onClosing?: ((...args: any[]) => any) | undefined;
|
|
155
|
-
onClosed?: ((...args: any[]) => any) | undefined;
|
|
156
156
|
}>, {
|
|
157
157
|
zIndex: number;
|
|
158
158
|
width: string;
|
|
@@ -489,6 +489,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
489
489
|
itemText: string;
|
|
490
490
|
errorMsg: string;
|
|
491
491
|
placeholder: string;
|
|
492
|
+
clearable: boolean;
|
|
492
493
|
valueIsObject: boolean;
|
|
493
494
|
itemValue: string | number;
|
|
494
495
|
itemSize: number;
|
|
@@ -498,7 +499,6 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
498
499
|
dropdownMenuStyle: Record<string, any>;
|
|
499
500
|
pDropdownProps: Record<string, any>;
|
|
500
501
|
searchable: boolean;
|
|
501
|
-
clearable: boolean;
|
|
502
502
|
multiple: boolean;
|
|
503
503
|
placeholderSearch: string;
|
|
504
504
|
selectedTopShown: boolean;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type VueDatePickerProps } from '@vuepic/vue-datepicker';
|
|
2
|
+
type Props = {
|
|
3
|
+
label?: string;
|
|
4
|
+
errorMsg?: string;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
} & VueDatePickerProps;
|
|
7
|
+
type __VLS_Props = Props;
|
|
8
|
+
type __VLS_PublicProps = {
|
|
9
|
+
modelValue?: Date | string | null;
|
|
10
|
+
} & __VLS_Props;
|
|
11
|
+
declare function __VLS_template(): {
|
|
12
|
+
attrs: Partial<{}>;
|
|
13
|
+
slots: {
|
|
14
|
+
label?(_: {
|
|
15
|
+
label: string;
|
|
16
|
+
labelClasses: string;
|
|
17
|
+
}): any;
|
|
18
|
+
};
|
|
19
|
+
refs: {};
|
|
20
|
+
rootEl: any;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
23
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
24
|
+
"update:modelValue": (value: string | Date | null) => any;
|
|
25
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
26
|
+
"onUpdate:modelValue"?: ((value: string | Date | null) => any) | undefined;
|
|
27
|
+
}>, {
|
|
28
|
+
label: string;
|
|
29
|
+
inline: boolean | {
|
|
30
|
+
input?: boolean;
|
|
31
|
+
};
|
|
32
|
+
required: boolean;
|
|
33
|
+
errorMsg: string;
|
|
34
|
+
enableTimePicker: boolean;
|
|
35
|
+
weekStart: "0" | "1" | "2" | "3" | "4" | "5" | "6" | 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
36
|
+
autoApply: boolean;
|
|
37
|
+
hideOffsetDates: boolean;
|
|
38
|
+
modelType: "timestamp" | "iso" | "format" | string;
|
|
39
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
41
|
+
export default _default;
|
|
42
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
43
|
+
new (): {
|
|
44
|
+
$slots: S;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -94,12 +94,12 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
94
94
|
};
|
|
95
95
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
96
96
|
"update:modelValue": (...args: any[]) => void;
|
|
97
|
+
closed: (...args: any[]) => void;
|
|
97
98
|
"before-open": (...args: any[]) => void;
|
|
98
99
|
opening: (...args: any[]) => void;
|
|
99
100
|
opened: (...args: any[]) => void;
|
|
100
101
|
"before-close": (...args: any[]) => void;
|
|
101
102
|
closing: (...args: any[]) => void;
|
|
102
|
-
closed: (...args: any[]) => void;
|
|
103
103
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
104
104
|
name: {
|
|
105
105
|
type: StringConstructor;
|
|
@@ -179,12 +179,12 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
179
179
|
};
|
|
180
180
|
}>> & Readonly<{
|
|
181
181
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
182
|
+
onClosed?: ((...args: any[]) => any) | undefined;
|
|
182
183
|
"onBefore-open"?: ((...args: any[]) => any) | undefined;
|
|
183
184
|
onOpening?: ((...args: any[]) => any) | undefined;
|
|
184
185
|
onOpened?: ((...args: any[]) => any) | undefined;
|
|
185
186
|
"onBefore-close"?: ((...args: any[]) => any) | undefined;
|
|
186
187
|
onClosing?: ((...args: any[]) => any) | undefined;
|
|
187
|
-
onClosed?: ((...args: any[]) => any) | undefined;
|
|
188
188
|
}>, {
|
|
189
189
|
maxWidth: string;
|
|
190
190
|
name: string;
|
|
@@ -198,9 +198,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
198
198
|
live: boolean;
|
|
199
199
|
closeLabel: string;
|
|
200
200
|
enableClose: boolean;
|
|
201
|
-
wrapperClass: StyleValue;
|
|
202
201
|
baseZindex: number;
|
|
203
202
|
bgClass: StyleValue;
|
|
203
|
+
wrapperClass: StyleValue;
|
|
204
204
|
modalClass: StyleValue;
|
|
205
205
|
modalStyle: StyleValue;
|
|
206
206
|
bgInClass: string;
|