@pequity/squirrel 10.1.0 → 11.0.0
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/dist/cjs/chunks/p-inline-date-picker.js +51 -84
- package/dist/cjs/dateLocale.js +886 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/p-date-picker.js +146 -2
- package/dist/cjs/p-select-pill.js +1 -1
- package/dist/es/chunks/p-inline-date-picker.js +50 -83
- package/dist/es/dateLocale.js +886 -0
- package/dist/es/index.js +50 -50
- package/dist/es/p-date-picker.js +146 -2
- package/dist/es/p-select-pill.js +1 -1
- package/dist/squirrel/components/p-date-picker/p-date-picker.vue.d.ts +19 -23
- package/dist/squirrel/components/p-drawer/p-drawer.vue.d.ts +2 -2
- package/dist/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue.d.ts +12 -13
- package/dist/squirrel/components/p-modal/p-modal.vue.d.ts +2 -2
- package/dist/squirrel/components/p-steps/p-steps.vue.d.ts +1 -1
- package/dist/squirrel/utils/dateLocale.d.ts +2 -0
- package/dist/squirrel.css +34 -1
- package/package.json +24 -23
- package/squirrel/components/p-date-picker/p-date-picker.spec.js +49 -4
- package/squirrel/components/p-date-picker/p-date-picker.vue +84 -12
- package/squirrel/components/p-inline-date-picker/p-inline-date-picker.spec.js +33 -18
- package/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue +21 -10
- package/squirrel/components/p-select-pill/p-select-pill.vue +1 -1
- package/squirrel/utils/dateLocale.spec.ts +20 -0
- package/squirrel/utils/dateLocale.ts +19 -0
- package/dist/cjs/chunks/p-date-picker.js +0 -171
- package/dist/es/chunks/p-date-picker.js +0 -172
package/dist/cjs/index.js
CHANGED
|
@@ -8,7 +8,7 @@ const pCard_vue_vue_type_script_setup_true_lang = require("./chunks/p-card.js");
|
|
|
8
8
|
const pCheckbox = require("./p-checkbox.js");
|
|
9
9
|
const pChips = require("./p-chips.js");
|
|
10
10
|
const pCloseBtn = require("./p-close-btn.js");
|
|
11
|
-
const
|
|
11
|
+
const pDatePicker = require("./p-date-picker.js");
|
|
12
12
|
const pDrawer = require("./p-drawer.js");
|
|
13
13
|
const pDropdown = require("./p-dropdown.js");
|
|
14
14
|
const pDropdownSelect_vue_vue_type_script_setup_true_lang = require("./chunks/p-dropdown-select.js");
|
|
@@ -1096,7 +1096,7 @@ exports.PCard = pCard_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
|
1096
1096
|
exports.PCheckbox = pCheckbox;
|
|
1097
1097
|
exports.PChips = pChips;
|
|
1098
1098
|
exports.PCloseBtn = pCloseBtn;
|
|
1099
|
-
exports.PDatePicker =
|
|
1099
|
+
exports.PDatePicker = pDatePicker;
|
|
1100
1100
|
exports.PDrawer = pDrawer;
|
|
1101
1101
|
exports.PDropdown = pDropdown;
|
|
1102
1102
|
exports.PDropdownSelect = pDropdownSelect_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
@@ -1,3 +1,147 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
3
|
-
|
|
2
|
+
const vue = require("vue");
|
|
3
|
+
const pInput_vue_vue_type_script_setup_true_lang = require("./chunks/p-input.js");
|
|
4
|
+
const dateLocale = require("./dateLocale.js");
|
|
5
|
+
const vueDatepicker = require("@vuepic/vue-datepicker");
|
|
6
|
+
const vueI18n = require("vue-i18n");
|
|
7
|
+
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
9
|
+
...{
|
|
10
|
+
name: "PDatePicker",
|
|
11
|
+
inheritAttrs: false
|
|
12
|
+
},
|
|
13
|
+
__name: "p-date-picker",
|
|
14
|
+
props: /* @__PURE__ */ vue.mergeModels({
|
|
15
|
+
multiCalendars: { type: [Boolean, Number, String, Object] },
|
|
16
|
+
modelType: { default: "yyyy-MM-dd" },
|
|
17
|
+
dark: { type: Boolean },
|
|
18
|
+
transitions: { type: [Boolean, Object] },
|
|
19
|
+
ariaLabels: {},
|
|
20
|
+
hideNavigation: {},
|
|
21
|
+
timezone: {},
|
|
22
|
+
vertical: { type: Boolean },
|
|
23
|
+
hideMonthYearSelect: { type: Boolean },
|
|
24
|
+
disableYearSelect: { type: Boolean },
|
|
25
|
+
yearRange: {},
|
|
26
|
+
autoApply: { type: Boolean, default: true },
|
|
27
|
+
disabledDates: {},
|
|
28
|
+
startDate: {},
|
|
29
|
+
hideOffsetDates: { type: Boolean, default: true },
|
|
30
|
+
noToday: { type: Boolean },
|
|
31
|
+
allowedDates: {},
|
|
32
|
+
markers: {},
|
|
33
|
+
presetDates: {},
|
|
34
|
+
flow: {},
|
|
35
|
+
preventMinMaxNavigation: { type: Boolean },
|
|
36
|
+
reverseYears: { type: Boolean },
|
|
37
|
+
weekPicker: { type: Boolean },
|
|
38
|
+
filters: {},
|
|
39
|
+
arrowNavigation: { type: Boolean },
|
|
40
|
+
highlight: {},
|
|
41
|
+
teleport: { type: [String, Boolean] },
|
|
42
|
+
centered: { type: Boolean },
|
|
43
|
+
locale: {},
|
|
44
|
+
weekStart: { default: 0 },
|
|
45
|
+
weekNumbers: { type: [Boolean, Object] },
|
|
46
|
+
dayNames: {},
|
|
47
|
+
monthPicker: { type: Boolean },
|
|
48
|
+
yearPicker: { type: Boolean },
|
|
49
|
+
modelAuto: { type: Boolean },
|
|
50
|
+
formats: { default: () => ({ input: "dd-MMM-yyyy" }) },
|
|
51
|
+
multiDates: { type: [Boolean, Object] },
|
|
52
|
+
minDate: {},
|
|
53
|
+
maxDate: {},
|
|
54
|
+
minTime: {},
|
|
55
|
+
maxTime: {},
|
|
56
|
+
inputAttrs: {},
|
|
57
|
+
timeConfig: { default: () => ({ enableTimePicker: false }) },
|
|
58
|
+
placeholder: { default: "" },
|
|
59
|
+
timePicker: { type: Boolean },
|
|
60
|
+
range: { type: [Boolean, Object] },
|
|
61
|
+
menuId: {},
|
|
62
|
+
disabled: { type: Boolean },
|
|
63
|
+
readonly: { type: Boolean },
|
|
64
|
+
inline: { type: [Boolean, Object] },
|
|
65
|
+
textInput: { type: [Boolean, Object], default: true },
|
|
66
|
+
sixWeeks: { type: [Boolean, String] },
|
|
67
|
+
actionRow: {},
|
|
68
|
+
focusStartDate: { type: Boolean },
|
|
69
|
+
disabledTimes: {},
|
|
70
|
+
calendar: {},
|
|
71
|
+
config: {},
|
|
72
|
+
quarterPicker: { type: Boolean },
|
|
73
|
+
yearFirst: { type: Boolean },
|
|
74
|
+
loading: { type: Boolean },
|
|
75
|
+
ui: {},
|
|
76
|
+
floating: {},
|
|
77
|
+
name: { default: "" },
|
|
78
|
+
label: { default: "" },
|
|
79
|
+
errorMsg: { default: "" },
|
|
80
|
+
required: { type: Boolean, default: false }
|
|
81
|
+
}, {
|
|
82
|
+
"modelValue": {},
|
|
83
|
+
"modelModifiers": {}
|
|
84
|
+
}),
|
|
85
|
+
emits: ["update:modelValue"],
|
|
86
|
+
setup(__props) {
|
|
87
|
+
const props = __props;
|
|
88
|
+
const model = vue.useModel(__props, "modelValue");
|
|
89
|
+
const { locale } = vueI18n.useI18n();
|
|
90
|
+
const attrs = vue.useAttrs();
|
|
91
|
+
const datePickerProps = vue.computed(() => {
|
|
92
|
+
const { name, label, errorMsg, required, ...vueDatePickerProps } = props;
|
|
93
|
+
const { class: classes, style, ...attrsWithoutClassAndStyle } = attrs;
|
|
94
|
+
return {
|
|
95
|
+
...vueDatePickerProps,
|
|
96
|
+
...attrsWithoutClassAndStyle,
|
|
97
|
+
locale: dateLocale.getDateFnsLocale(locale.value)
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
const inputPropsAndAttrs = vue.computed(() => {
|
|
101
|
+
const { class: classes, style, ...res } = attrs;
|
|
102
|
+
res.label = props.label;
|
|
103
|
+
res.errorMsg = props.errorMsg;
|
|
104
|
+
res.required = props.required;
|
|
105
|
+
res.disabled = props.disabled;
|
|
106
|
+
res.placeholder = props.placeholder ? props.placeholder : typeof props.formats?.input === "string" ? props.formats.input : "dd-MMM-yyyy";
|
|
107
|
+
res.name = props.name;
|
|
108
|
+
res.readonly = props.readonly;
|
|
109
|
+
return res;
|
|
110
|
+
});
|
|
111
|
+
const handleInput = (e, onInputFn, onClearFn) => {
|
|
112
|
+
if (e.target instanceof HTMLInputElement && e.target.value === "") {
|
|
113
|
+
onClearFn(e);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
return onInputFn(e);
|
|
117
|
+
};
|
|
118
|
+
return (_ctx, _cache) => {
|
|
119
|
+
return vue.openBlock(), vue.createBlock(vue.unref(vueDatepicker.VueDatePicker), vue.mergeProps({
|
|
120
|
+
modelValue: model.value,
|
|
121
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
122
|
+
class: [
|
|
123
|
+
{ hidden: _ctx.$attrs.hidden },
|
|
124
|
+
_ctx.$attrs.class,
|
|
125
|
+
{ "has-label": !!__props.label },
|
|
126
|
+
{ "has-error": !!__props.errorMsg },
|
|
127
|
+
`size-${_ctx.$attrs.size || "md"}`
|
|
128
|
+
]
|
|
129
|
+
}, datePickerProps.value), {
|
|
130
|
+
"dp-input": vue.withCtx(({ value, onInput, onEnter, onTab, onFocus, onBlur, onClear }) => [
|
|
131
|
+
vue.createVNode(pInput_vue_vue_type_script_setup_true_lang._sfc_main, vue.mergeProps({ "model-value": value }, inputPropsAndAttrs.value, {
|
|
132
|
+
onInput: ($event) => handleInput($event, onInput, onClear),
|
|
133
|
+
onKeydown: [
|
|
134
|
+
vue.withKeys(($event) => onEnter($event), ["enter"]),
|
|
135
|
+
vue.withKeys(($event) => onTab($event), ["tab"])
|
|
136
|
+
],
|
|
137
|
+
onFocus,
|
|
138
|
+
onBlur
|
|
139
|
+
}), null, 16, ["model-value", "onInput", "onKeydown", "onFocus", "onBlur"])
|
|
140
|
+
]),
|
|
141
|
+
_: 1
|
|
142
|
+
}, 16, ["modelValue", "class"]);
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
const pDatePicker = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-5f4efd82"]]);
|
|
147
|
+
module.exports = pDatePicker;
|
|
@@ -136,7 +136,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
136
136
|
vue.createElementVNode("div", _hoisted_2, null, 512),
|
|
137
137
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.items, (o) => {
|
|
138
138
|
return vue.openBlock(), vue.createElementBlock("button", {
|
|
139
|
-
key: o[_ctx.itemValue],
|
|
139
|
+
key: String(o[_ctx.itemValue]),
|
|
140
140
|
disabled: o.disabled,
|
|
141
141
|
class: vue.normalizeClass(["z-10 duration-700", [
|
|
142
142
|
_ctx.SIZES[_ctx.size],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineComponent, mergeModels, useModel, useAttrs, computed, createElementBlock, openBlock, normalizeStyle, normalizeClass, renderSlot, createVNode, withDirectives, unref, createCommentVNode, toDisplayString, mergeProps, createElementVNode, vShow } from "vue";
|
|
2
2
|
import { useInputClasses } from "../useInputClasses.js";
|
|
3
|
-
import
|
|
3
|
+
import { getDateFnsLocale } from "../dateLocale.js";
|
|
4
|
+
import { VueDatePicker } from "@vuepic/vue-datepicker";
|
|
4
5
|
import { useI18n } from "vue-i18n";
|
|
5
6
|
const _hoisted_1 = ["data-has-error"];
|
|
6
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -10,112 +11,73 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10
11
|
},
|
|
11
12
|
__name: "p-inline-date-picker",
|
|
12
13
|
props: /* @__PURE__ */ mergeModels({
|
|
13
|
-
label: { default: "" },
|
|
14
|
-
errorMsg: { default: "" },
|
|
15
|
-
required: { type: Boolean, default: false },
|
|
16
|
-
uid: {},
|
|
17
|
-
name: {},
|
|
18
|
-
is24: { type: Boolean },
|
|
19
|
-
enableTimePicker: { type: Boolean, default: false },
|
|
20
|
-
range: { type: [Boolean, Object] },
|
|
21
14
|
multiCalendars: { type: [Boolean, Number, String, Object] },
|
|
22
|
-
|
|
23
|
-
locale: {},
|
|
24
|
-
position: {},
|
|
15
|
+
modelType: { default: "yyyy-MM-dd" },
|
|
25
16
|
dark: { type: Boolean },
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
secondsIncrement: {},
|
|
34
|
-
minDate: {},
|
|
35
|
-
maxDate: {},
|
|
36
|
-
minTime: {},
|
|
37
|
-
maxTime: {},
|
|
38
|
-
weekStart: { default: 0 },
|
|
39
|
-
disabled: { type: Boolean },
|
|
40
|
-
readonly: { type: Boolean },
|
|
41
|
-
format: {},
|
|
42
|
-
previewFormat: {},
|
|
43
|
-
hideInputIcon: { type: Boolean },
|
|
44
|
-
state: { type: Boolean },
|
|
45
|
-
clearable: { type: Boolean },
|
|
46
|
-
alwaysClearable: { type: Boolean },
|
|
47
|
-
autoApply: { type: Boolean, default: true },
|
|
48
|
-
filters: {},
|
|
49
|
-
disableMonthYearSelect: { type: Boolean },
|
|
17
|
+
transitions: { type: [Boolean, Object] },
|
|
18
|
+
ariaLabels: {},
|
|
19
|
+
hideNavigation: {},
|
|
20
|
+
timezone: {},
|
|
21
|
+
vertical: { type: Boolean },
|
|
22
|
+
hideMonthYearSelect: { type: Boolean },
|
|
23
|
+
disableYearSelect: { type: Boolean },
|
|
50
24
|
yearRange: {},
|
|
25
|
+
autoApply: { type: Boolean, default: true },
|
|
51
26
|
disabledDates: {},
|
|
52
|
-
inline: { type: [Boolean, Object], default: true },
|
|
53
|
-
selectText: {},
|
|
54
|
-
cancelText: {},
|
|
55
|
-
weekNumName: {},
|
|
56
|
-
autoPosition: { type: [Boolean, String] },
|
|
57
|
-
monthPicker: { type: Boolean },
|
|
58
|
-
timePicker: { type: Boolean },
|
|
59
|
-
textInput: { type: [Boolean, Object] },
|
|
60
|
-
monthNameFormat: {},
|
|
61
27
|
startDate: {},
|
|
62
|
-
startTime: {},
|
|
63
28
|
hideOffsetDates: { type: Boolean, default: true },
|
|
64
29
|
noToday: { type: Boolean },
|
|
65
|
-
noHoursOverlay: { type: Boolean },
|
|
66
|
-
noMinutesOverlay: { type: Boolean },
|
|
67
|
-
noSecondsOverlay: { type: Boolean },
|
|
68
|
-
altPosition: {},
|
|
69
|
-
disabledWeekDays: {},
|
|
70
30
|
allowedDates: {},
|
|
71
|
-
nowButtonLabel: {},
|
|
72
|
-
monthChangeOnScroll: { type: [Boolean, String] },
|
|
73
31
|
markers: {},
|
|
74
|
-
transitions: { type: [Boolean, Object] },
|
|
75
|
-
enableSeconds: { type: Boolean },
|
|
76
|
-
escClose: { type: Boolean },
|
|
77
|
-
spaceConfirm: { type: Boolean },
|
|
78
|
-
monthChangeOnArrows: { type: Boolean },
|
|
79
|
-
formatLocale: {},
|
|
80
|
-
autocomplete: {},
|
|
81
|
-
multiDates: { type: [Boolean, Object] },
|
|
82
32
|
presetDates: {},
|
|
83
33
|
flow: {},
|
|
84
|
-
partialFlow: { type: Boolean },
|
|
85
34
|
preventMinMaxNavigation: { type: Boolean },
|
|
86
|
-
utc: { type: [Boolean, String] },
|
|
87
35
|
reverseYears: { type: Boolean },
|
|
88
36
|
weekPicker: { type: Boolean },
|
|
89
|
-
|
|
90
|
-
ariaLabels: {},
|
|
37
|
+
filters: {},
|
|
91
38
|
arrowNavigation: { type: Boolean },
|
|
92
|
-
|
|
39
|
+
highlight: {},
|
|
40
|
+
teleport: { type: [String, Boolean] },
|
|
41
|
+
centered: { type: Boolean },
|
|
42
|
+
locale: {},
|
|
43
|
+
weekStart: { default: 0 },
|
|
44
|
+
weekNumbers: { type: [Boolean, Object] },
|
|
93
45
|
dayNames: {},
|
|
94
|
-
|
|
46
|
+
monthPicker: { type: Boolean },
|
|
47
|
+
yearPicker: { type: Boolean },
|
|
95
48
|
modelAuto: { type: Boolean },
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
49
|
+
formats: {},
|
|
50
|
+
multiDates: { type: [Boolean, Object] },
|
|
51
|
+
minDate: {},
|
|
52
|
+
maxDate: {},
|
|
53
|
+
minTime: {},
|
|
54
|
+
maxTime: {},
|
|
55
|
+
inputAttrs: {},
|
|
56
|
+
timeConfig: { default: () => ({ enableTimePicker: false }) },
|
|
57
|
+
placeholder: { default: "" },
|
|
58
|
+
timePicker: { type: Boolean },
|
|
59
|
+
range: { type: [Boolean, Object] },
|
|
60
|
+
menuId: {},
|
|
61
|
+
disabled: { type: Boolean },
|
|
62
|
+
readonly: { type: Boolean },
|
|
63
|
+
inline: { type: [Boolean, Object] },
|
|
64
|
+
textInput: { type: [Boolean, Object], default: false },
|
|
103
65
|
sixWeeks: { type: [Boolean, String] },
|
|
104
|
-
|
|
105
|
-
disableYearSelect: { type: Boolean },
|
|
66
|
+
actionRow: {},
|
|
106
67
|
focusStartDate: { type: Boolean },
|
|
107
68
|
disabledTimes: {},
|
|
108
|
-
timePickerInline: { type: Boolean },
|
|
109
69
|
calendar: {},
|
|
110
70
|
config: {},
|
|
111
71
|
quarterPicker: { type: Boolean },
|
|
112
72
|
yearFirst: { type: Boolean },
|
|
113
73
|
loading: { type: Boolean },
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
74
|
+
ui: {},
|
|
75
|
+
floating: {},
|
|
76
|
+
label: { default: "" },
|
|
77
|
+
errorMsg: { default: "" },
|
|
78
|
+
required: { type: Boolean, default: false }
|
|
117
79
|
}, {
|
|
118
|
-
"modelValue": {
|
|
80
|
+
"modelValue": {},
|
|
119
81
|
"modelModifiers": {}
|
|
120
82
|
}),
|
|
121
83
|
emits: ["update:modelValue"],
|
|
@@ -126,9 +88,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
126
88
|
const attrs = useAttrs();
|
|
127
89
|
const { labelClasses, errorMsgClasses } = useInputClasses(props);
|
|
128
90
|
const datePickerProps = computed(() => {
|
|
129
|
-
const {
|
|
91
|
+
const { label, errorMsg, required, ...vueDatePickerProps } = props;
|
|
130
92
|
const { class: classes, style: style2, ...attrsWithoutClassAndStyle } = attrs;
|
|
131
|
-
return {
|
|
93
|
+
return {
|
|
94
|
+
...vueDatePickerProps,
|
|
95
|
+
...attrsWithoutClassAndStyle,
|
|
96
|
+
locale: getDateFnsLocale(locale.value),
|
|
97
|
+
inline: true
|
|
98
|
+
};
|
|
132
99
|
});
|
|
133
100
|
const style = computed(() => {
|
|
134
101
|
return attrs.style;
|