@pequity/squirrel 10.1.0 → 11.0.1
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/index.js +199 -143
- 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/index.js +199 -143
- 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 +35 -2
- package/package.json +28 -27
- 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],
|