@pequity/squirrel 5.4.7 → 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.
Files changed (158) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/chunks/p-date-picker.js +143 -85
  3. package/dist/cjs/chunks/p-dropdown-select.js +4 -4
  4. package/dist/cjs/chunks/p-inline-date-picker.js +117 -67
  5. package/dist/cjs/chunks/p-link.js +1 -1
  6. package/dist/cjs/chunks/p-select.js +1 -1
  7. package/dist/cjs/index.js +37 -37
  8. package/dist/cjs/p-btn.js +2 -2
  9. package/dist/cjs/p-checkbox.js +1 -1
  10. package/dist/cjs/p-chips.js +2 -2
  11. package/dist/cjs/p-input-number.js +3 -3
  12. package/dist/cjs/p-input-search.js +1 -1
  13. package/dist/cjs/p-loading.js +2 -2
  14. package/dist/cjs/p-modal.js +2 -2
  15. package/dist/cjs/p-skeleton-loader.js +1 -1
  16. package/dist/cjs/p-table-td.js +1 -1
  17. package/dist/cjs/p-toggle.js +1 -1
  18. package/dist/cjs/tailwind.js +2 -2
  19. package/dist/cjs/usePTableRowVirtualizer.js +1 -1
  20. package/dist/cjs/useSelectList.js +3 -3
  21. package/dist/es/chunks/p-date-picker.js +144 -86
  22. package/dist/es/chunks/p-dropdown-select.js +4 -4
  23. package/dist/es/chunks/p-inline-date-picker.js +118 -68
  24. package/dist/es/chunks/p-link.js +1 -1
  25. package/dist/es/chunks/p-select.js +1 -1
  26. package/dist/es/index.js +35 -35
  27. package/dist/es/p-btn.js +2 -2
  28. package/dist/es/p-checkbox.js +1 -1
  29. package/dist/es/p-chips.js +2 -2
  30. package/dist/es/p-input-number.js +3 -3
  31. package/dist/es/p-input-search.js +1 -1
  32. package/dist/es/p-loading.js +2 -2
  33. package/dist/es/p-modal.js +2 -2
  34. package/dist/es/p-skeleton-loader.js +1 -1
  35. package/dist/es/p-table-td.js +1 -1
  36. package/dist/es/p-toggle.js +1 -1
  37. package/dist/es/tailwind.js +2 -2
  38. package/dist/es/usePTableRowVirtualizer.js +1 -1
  39. package/dist/es/useSelectList.js +3 -3
  40. package/dist/squirrel/components/index.d.ts +13 -13
  41. package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +2 -2
  42. package/dist/squirrel/components/p-card/p-card.vue.d.ts +3 -2
  43. package/dist/squirrel/components/p-checkbox/p-checkbox.vue.d.ts +2 -1
  44. package/dist/squirrel/components/p-close-btn/p-close-btn.vue.d.ts +1 -1
  45. package/dist/squirrel/components/p-date-picker/p-date-picker.vue.d.ts +27 -30
  46. package/dist/squirrel/components/p-drawer/p-drawer.vue.d.ts +3 -3
  47. package/dist/squirrel/components/p-dropdown-select/p-dropdown-select.vue.d.ts +8 -7
  48. package/dist/squirrel/components/p-file-upload/p-file-upload.vue.d.ts +1 -1
  49. package/dist/squirrel/components/p-icon/p-icon.vue.d.ts +2 -2
  50. package/dist/squirrel/components/p-info-icon/p-info-icon.vue.d.ts +2 -1
  51. package/dist/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue.d.ts +46 -0
  52. package/dist/squirrel/components/p-input/p-input.vue.d.ts +1 -1
  53. package/dist/squirrel/components/p-input-number/p-input-number.vue.d.ts +1 -1
  54. package/dist/squirrel/components/p-input-percent/p-input-percent.vue.d.ts +1 -1
  55. package/dist/squirrel/components/p-input-search/p-input-search.vue.d.ts +2 -2
  56. package/dist/squirrel/components/p-link/p-link.vue.d.ts +2 -1
  57. package/dist/squirrel/components/p-modal/p-modal.vue.d.ts +5 -4
  58. package/dist/squirrel/components/p-pagination-info/p-pagination-info.vue.d.ts +2 -1
  59. package/dist/squirrel/components/p-ring-loader/p-ring-loader.vue.d.ts +1 -1
  60. package/dist/squirrel/components/p-select/p-select.vue.d.ts +3 -2
  61. package/dist/squirrel/components/p-select-btn/p-select-btn.vue.d.ts +3 -2
  62. package/dist/squirrel/components/p-select-list/p-select-list.vue.d.ts +6 -5
  63. package/dist/squirrel/components/p-select-pill/p-select-pill.vue.d.ts +1 -1
  64. package/dist/squirrel/components/p-table/p-table.vue.d.ts +3 -2
  65. package/dist/squirrel/components/p-table-loader/p-table-loader.vue.d.ts +1 -1
  66. package/dist/squirrel/components/p-table-sort/p-table-sort.vue.d.ts +1 -1
  67. package/dist/squirrel/components/p-table-td/p-table-td.vue.d.ts +2 -1
  68. package/dist/squirrel/components/p-tabs/p-tabs.vue.d.ts +2 -2
  69. package/dist/squirrel/components/p-textarea/p-textarea.vue.d.ts +1 -1
  70. package/dist/squirrel/components/p-toggle/p-toggle.vue.d.ts +1 -1
  71. package/dist/squirrel/index.d.ts +1 -1
  72. package/dist/squirrel/utils/index.d.ts +8 -8
  73. package/dist/squirrel/utils/inputClassesMixin.d.ts +1 -1
  74. package/dist/style.css +98 -989
  75. package/package.json +30 -32
  76. package/squirrel/assets/squirrel.css +45 -6
  77. package/squirrel/components/index.ts +37 -37
  78. package/squirrel/components/p-action-bar/p-action-bar.spec.ts +1 -1
  79. package/squirrel/components/p-action-bar/p-action-bar.stories.js +2 -2
  80. package/squirrel/components/p-action-bar/p-action-bar.vue +1 -1
  81. package/squirrel/components/p-alert/p-alert.vue +1 -1
  82. package/squirrel/components/p-btn/p-btn.spec.js +2 -2
  83. package/squirrel/components/p-btn/p-btn.vue +4 -4
  84. package/squirrel/components/p-checkbox/p-checkbox.vue +1 -1
  85. package/squirrel/components/p-chips/p-chips.vue +1 -1
  86. package/squirrel/components/p-date-picker/p-date-picker.spec.js +292 -0
  87. package/squirrel/components/p-date-picker/p-date-picker.stories.js +3 -3
  88. package/squirrel/components/p-date-picker/p-date-picker.vue +45 -90
  89. package/squirrel/components/p-dropdown/p-dropdown.spec.js +1 -1
  90. package/squirrel/components/p-dropdown/p-dropdown.vue +1 -1
  91. package/squirrel/components/p-dropdown-select/p-dropdown-select.spec.js +4 -4
  92. package/squirrel/components/p-dropdown-select/p-dropdown-select.stories.js +2 -2
  93. package/squirrel/components/p-dropdown-select/p-dropdown-select.vue +8 -8
  94. package/squirrel/components/p-file-upload/p-file-upload.vue +2 -2
  95. package/squirrel/components/p-icon/p-icon.spec.js +1 -1
  96. package/squirrel/components/p-icon/p-icon.stories.js +1 -1
  97. package/squirrel/components/p-icon/p-icon.vue +2 -2
  98. package/squirrel/components/p-inline-date-picker/p-inline-date-picker.spec.js +21 -45
  99. package/squirrel/components/p-inline-date-picker/p-inline-date-picker.stories.js +3 -3
  100. package/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue +16 -85
  101. package/squirrel/components/p-input/p-input.stories.js +1 -1
  102. package/squirrel/components/p-input/p-input.vue +1 -1
  103. package/squirrel/components/p-input-number/p-input-number.stories.js +1 -1
  104. package/squirrel/components/p-input-number/p-input-number.vue +3 -3
  105. package/squirrel/components/p-input-percent/p-input-percent.stories.js +1 -1
  106. package/squirrel/components/p-input-percent/p-input-percent.vue +1 -1
  107. package/squirrel/components/p-input-search/p-input-search.stories.js +1 -1
  108. package/squirrel/components/p-input-search/p-input-search.vue +1 -1
  109. package/squirrel/components/p-link/p-link.spec.js +1 -1
  110. package/squirrel/components/p-link/p-link.vue +1 -1
  111. package/squirrel/components/p-loading/p-loading.spec.js +2 -2
  112. package/squirrel/components/p-loading/p-loading.stories.js +2 -2
  113. package/squirrel/components/p-loading/p-loading.vue +1 -1
  114. package/squirrel/components/p-loading/usePLoading.ts +1 -1
  115. package/squirrel/components/p-modal/p-modal-basic.spec.js +1 -1
  116. package/squirrel/components/p-modal/p-modal-events.spec.js +1 -1
  117. package/squirrel/components/p-modal/p-modal-features.spec.js +1 -1
  118. package/squirrel/components/p-modal/p-modal.vue +3 -3
  119. package/squirrel/components/p-pagination/p-pagination.vue +1 -1
  120. package/squirrel/components/p-progress-bar/p-progess-bar.spec.js +1 -1
  121. package/squirrel/components/p-progress-bar/p-progress-bar.vue +1 -1
  122. package/squirrel/components/p-select/p-select.spec.js +1 -1
  123. package/squirrel/components/p-select/p-select.stories.js +1 -1
  124. package/squirrel/components/p-select/p-select.vue +1 -1
  125. package/squirrel/components/p-select-btn/p-select-btn.spec.js +1 -1
  126. package/squirrel/components/p-select-btn/p-select-btn.stories.js +1 -1
  127. package/squirrel/components/p-select-btn/p-select-btn.vue +1 -1
  128. package/squirrel/components/p-select-list/p-select-list.spec.js +4 -4
  129. package/squirrel/components/p-select-list/p-select-list.vue +5 -5
  130. package/squirrel/components/p-select-list/useSelectList.ts +3 -3
  131. package/squirrel/components/p-select-pill/p-select-pill.spec.js +1 -1
  132. package/squirrel/components/p-select-pill/p-select-pill.stories.js +2 -2
  133. package/squirrel/components/p-select-pill/p-select-pill.vue +1 -1
  134. package/squirrel/components/p-skeleton-loader/p-skeleton-loader.vue +1 -1
  135. package/squirrel/components/p-table/p-table.spec.js +2 -2
  136. package/squirrel/components/p-table/p-table.vue +4 -4
  137. package/squirrel/components/p-table/usePTableColResize.spec.js +1 -1
  138. package/squirrel/components/p-table/usePTableColResize.ts +1 -1
  139. package/squirrel/components/p-table/usePTableRowVirtualizer.ts +1 -1
  140. package/squirrel/components/p-table-sort/p-table-sort.spec.js +1 -1
  141. package/squirrel/components/p-table-sort/p-table-sort.stories.js +1 -1
  142. package/squirrel/components/p-table-sort/p-table-sort.vue +1 -1
  143. package/squirrel/components/p-table-td/p-table-td.spec.js +3 -3
  144. package/squirrel/components/p-table-td/p-table-td.stories.js +1 -1
  145. package/squirrel/components/p-table-td/p-table-td.vue +2 -2
  146. package/squirrel/components/p-tabs/p-tabs.vue +1 -1
  147. package/squirrel/components/p-textarea/p-textarea.stories.js +1 -1
  148. package/squirrel/components/p-textarea/p-textarea.vue +1 -1
  149. package/squirrel/components/p-toggle/p-toggle.stories.js +1 -1
  150. package/squirrel/components/p-toggle/p-toggle.vue +1 -1
  151. package/squirrel/composables/useInputClasses.spec.js +1 -1
  152. package/squirrel/index.ts +1 -1
  153. package/squirrel/utils/component.ts +1 -1
  154. package/squirrel/utils/index.ts +18 -18
  155. package/squirrel/utils/inputClassesMixin.ts +1 -1
  156. package/squirrel/utils/pagination.spec.js +2 -2
  157. package/squirrel/utils/sanitization.spec.js +1 -1
  158. package/squirrel/utils/tailwind.ts +3 -2
package/README.md CHANGED
@@ -10,7 +10,7 @@ The library is built using [Vue 3](https://vuejs.org/) and [Tailwind CSS](https:
10
10
  Install the package and its dependencies using `pnpm`:
11
11
 
12
12
  ```bash
13
- pnpm i vue vue-router @pequity/squirrel @popperjs/core @tanstack/vue-virtual dayjs floating-vue lodash-es v-calendar vue-currency-input vue-toastification@2.0.0-rc.5
13
+ pnpm i vue vue-router @pequity/squirrel @tanstack/vue-virtual @vuepic/vue-datepicker dayjs floating-vue lodash-es vue-currency-input vue-toastification@2.0.0-rc.5
14
14
  ```
15
15
 
16
16
  Install Tailwind CSS:
@@ -1,107 +1,165 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
3
  const pInput = require("../p-input.js");
4
- const dayjs = require("dayjs");
5
- const vCalendar = require("v-calendar");
6
- const lodashEs = require("lodash-es");
7
- const useInputClasses = require("../useInputClasses.js");
8
- const _hoisted_1 = ["data-has-error"];
4
+ const VueDatePicker = require("@vuepic/vue-datepicker");
9
5
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
10
6
  ...{
11
7
  name: "PDatePicker",
12
8
  inheritAttrs: false
13
9
  },
14
10
  __name: "p-date-picker",
15
- props: {
16
- modelValue: { default: "" },
11
+ props: /* @__PURE__ */ vue.mergeModels({
17
12
  label: { default: "" },
18
13
  errorMsg: { default: "" },
19
14
  required: { type: Boolean, default: false },
20
- minDate: { default: null },
21
- maxDate: { default: null },
22
- timezone: { default: "" }
23
- },
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: { type: [String, Function], default: "dd-MMM-yyyy" },
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: false },
51
+ selectText: {},
52
+ cancelText: {},
53
+ weekNumName: {},
54
+ autoPosition: { type: [Boolean, String] },
55
+ monthPicker: { type: Boolean },
56
+ timePicker: { type: Boolean },
57
+ textInput: { type: [Boolean, Object], default: true },
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
+ }),
24
119
  emits: ["update:modelValue"],
25
- setup(__props, { emit: __emit }) {
26
- const selectAttribute = { highlight: { class: "bg-primary", contentClass: "text-white" } };
27
- const DEFAULT_MASKS = {
28
- // The mask for the input
29
- input: "DD-MMM-YYYY",
30
- // The mask for the model value
31
- data: "YYYY-MM-DD"
32
- };
120
+ setup(__props) {
33
121
  const props = __props;
34
- const emit = __emit;
35
- const { labelClasses, errorMsgClasses } = useInputClasses.useInputClasses(props);
122
+ const model = vue.useModel(__props, "modelValue");
36
123
  const attrs = vue.useAttrs();
37
- const innerValue = vue.ref(null);
38
- const stopWatch = vue.ref(false);
39
- const masks = vue.computed(() => {
40
- return Object.assign(DEFAULT_MASKS, attrs.masks);
41
- });
42
- const displayPlaceholder = vue.computed(() => {
43
- return lodashEs.isString(attrs.placeholder) ? attrs.placeholder : masks.value.input;
124
+ const datePickerProps = vue.computed(() => {
125
+ const { modelValue: _, ...propsWithoutModelValue } = props;
126
+ return propsWithoutModelValue;
44
127
  });
45
- const attrsWithoutClassAndStyle = vue.computed(() => {
46
- const { class: classes, style: style2, ...rest } = attrs;
47
- return rest;
48
- });
49
- const style = vue.computed(() => {
50
- return attrs.style;
51
- });
52
- vue.watch(
53
- () => props.modelValue,
54
- (nV) => {
55
- if (!stopWatch.value) {
56
- innerValue.value = nV ? dayjs(nV, masks.value.data).toDate() : null;
57
- }
58
- },
59
- { immediate: true }
60
- );
61
- vue.watch(innerValue, (nV) => {
62
- const toEmit = lodashEs.isDate(nV) && nV.toString() !== "Invalid Date" ? dayjs(nV).format(masks.value.data) : null;
63
- stopWatch.value = true;
64
- emit("update:modelValue", toEmit);
65
- vue.nextTick(() => {
66
- stopWatch.value = false;
67
- });
128
+ const inputPropsAndAttrs = vue.computed(() => {
129
+ const { class: classes, style, ...res } = attrs;
130
+ res.label = props.label;
131
+ res.errorMsg = props.errorMsg;
132
+ res.required = props.required;
133
+ res.disabled = props.disabled;
134
+ res.placeholder = props.placeholder ? props.placeholder : props.format;
135
+ return res;
68
136
  });
137
+ const handleInput = (e, onInputFn, onClearFn) => {
138
+ if (e.target instanceof HTMLInputElement && e.target.value === "") {
139
+ onClearFn(e);
140
+ return;
141
+ }
142
+ return onInputFn(e);
143
+ };
69
144
  return (_ctx, _cache) => {
70
- return vue.openBlock(), vue.createElementBlock("div", {
71
- class: vue.normalizeClass([{ hidden: _ctx.$attrs.hidden }, _ctx.$attrs.class]),
72
- "data-has-error": !!_ctx.errorMsg,
73
- style: vue.normalizeStyle(style.value)
74
- }, [
75
- vue.renderSlot(_ctx.$slots, "label", {
76
- label: _ctx.label,
77
- labelClasses: vue.unref(labelClasses)
78
- }, () => [
79
- _ctx.label ? (vue.openBlock(), vue.createElementBlock("label", {
80
- key: 0,
81
- class: vue.normalizeClass(vue.unref(labelClasses))
82
- }, vue.toDisplayString(_ctx.label), 3)) : vue.createCommentVNode("", true)
145
+ return vue.openBlock(), vue.createBlock(vue.unref(VueDatePicker), vue.mergeProps({
146
+ modelValue: model.value,
147
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
148
+ class: [{ hidden: _ctx.$attrs.hidden }, _ctx.$attrs.class]
149
+ }, datePickerProps.value), {
150
+ "dp-input": vue.withCtx(({ value, onInput, onEnter, onTab, onFocus, onBlur, onClear }) => [
151
+ vue.createVNode(pInput, vue.mergeProps({ "model-value": value }, inputPropsAndAttrs.value, {
152
+ onInput: ($event) => handleInput($event, onInput, onClear),
153
+ onKeydown: [
154
+ vue.withKeys(($event) => onEnter($event), ["enter"]),
155
+ vue.withKeys(($event) => onTab($event), ["tab"])
156
+ ],
157
+ onFocus,
158
+ onBlur
159
+ }), null, 16, ["model-value", "onInput", "onKeydown", "onFocus", "onBlur"])
83
160
  ]),
84
- vue.createVNode(vue.unref(vCalendar.DatePicker), {
85
- modelValue: innerValue.value,
86
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => innerValue.value = $event),
87
- "select-attribute": selectAttribute,
88
- popover: { visibility: "click", placement: "auto" },
89
- "min-date": _ctx.minDate || null,
90
- "max-date": _ctx.maxDate || null,
91
- masks: masks.value,
92
- timezone: _ctx.timezone
93
- }, {
94
- default: vue.withCtx(({ inputValue, inputEvents }) => [
95
- vue.createVNode(pInput, vue.mergeProps({ value: inputValue }, attrsWithoutClassAndStyle.value, { placeholder: displayPlaceholder.value }, vue.toHandlers(inputEvents)), null, 16, ["value", "placeholder"])
96
- ]),
97
- _: 1
98
- }, 8, ["modelValue", "min-date", "max-date", "masks", "timezone"]),
99
- vue.withDirectives(vue.createElementVNode("div", {
100
- class: vue.normalizeClass(vue.unref(errorMsgClasses))
101
- }, vue.toDisplayString(_ctx.errorMsg), 3), [
102
- [vue.vShow, _ctx.errorMsg]
103
- ])
104
- ], 14, _hoisted_1);
161
+ _: 1
162
+ }, 16, ["modelValue", "class"]);
105
163
  };
106
164
  }
107
165
  });
@@ -4,11 +4,11 @@ const pDropdown = require("../p-dropdown.js");
4
4
  const pIcon_vue_vue_type_script_setup_true_lang = require("./p-icon.js");
5
5
  const pInputSearch = require("../p-input-search.js");
6
6
  const pSelectList = require("../p-select-list.js");
7
- const lodashEs = require("lodash-es");
8
- const text = require("../text.js");
9
- const string = require("../string.js");
10
- const useInputClasses = require("../useInputClasses.js");
11
7
  const useSelectList = require("../useSelectList.js");
8
+ const useInputClasses = require("../useInputClasses.js");
9
+ const string = require("../string.js");
10
+ const text = require("../text.js");
11
+ const lodashEs = require("lodash-es");
12
12
  const _imports_0 = "data:image/svg+xml,%3csvg%20width='18'%20height='12'%20viewBox='0%200%2018%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M16.1383%200.166992L6.30411%209.83366L1.69828%205.27533L0.526611%206.46033L5.71578%2011.597C5.87174%2011.7509%206.08205%2011.8372%206.3012%2011.8372C6.52034%2011.8372%206.73065%2011.7509%206.88661%2011.597L17.3033%201.35366L16.1383%200.166992Z'%20fill='%231A123B'%20/%3e%3c/svg%3e";
13
13
  const _hoisted_1 = ["data-has-error"];
14
14
  const _hoisted_2 = {
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
- const dayjs = require("dayjs");
4
- const vCalendar = require("v-calendar");
5
3
  const useInputClasses = require("../useInputClasses.js");
4
+ const VueDatePicker = require("@vuepic/vue-datepicker");
6
5
  const _hoisted_1 = ["data-has-error"];
7
6
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
8
7
  ...{
@@ -10,69 +9,128 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
10
9
  inheritAttrs: false
11
10
  },
12
11
  __name: "p-inline-date-picker",
13
- props: {
14
- modelValue: { default: "" },
12
+ props: /* @__PURE__ */ vue.mergeModels({
15
13
  label: { default: "" },
16
14
  errorMsg: { default: "" },
17
15
  required: { type: Boolean, default: false },
18
- minDate: { default: null },
19
- maxDate: { default: null },
20
- timezone: { default: "" }
21
- },
16
+ uid: {},
17
+ name: {},
18
+ is24: { type: Boolean },
19
+ enableTimePicker: { type: Boolean, default: false },
20
+ range: { type: [Boolean, Object] },
21
+ multiCalendars: { type: [Boolean, Number, String, Object] },
22
+ modelValue: {},
23
+ locale: {},
24
+ position: {},
25
+ dark: { type: Boolean },
26
+ placeholder: {},
27
+ weekNumbers: {},
28
+ hoursIncrement: {},
29
+ hoursGridIncrement: {},
30
+ secondsGridIncrement: {},
31
+ minutesGridIncrement: {},
32
+ minutesIncrement: {},
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
+ autoApply: { type: Boolean, default: true },
47
+ filters: {},
48
+ disableMonthYearSelect: { type: Boolean },
49
+ yearRange: {},
50
+ disabledDates: {},
51
+ inline: { type: [Boolean, Object], default: true },
52
+ selectText: {},
53
+ cancelText: {},
54
+ weekNumName: {},
55
+ autoPosition: { type: [Boolean, String] },
56
+ monthPicker: { type: Boolean },
57
+ timePicker: { type: Boolean },
58
+ textInput: { type: [Boolean, Object] },
59
+ monthNameFormat: {},
60
+ startDate: {},
61
+ startTime: {},
62
+ hideOffsetDates: { type: Boolean, default: true },
63
+ noToday: { type: Boolean },
64
+ noHoursOverlay: { type: Boolean },
65
+ noMinutesOverlay: { type: Boolean },
66
+ noSecondsOverlay: { type: Boolean },
67
+ altPosition: {},
68
+ disabledWeekDays: {},
69
+ allowedDates: {},
70
+ nowButtonLabel: {},
71
+ monthChangeOnScroll: { type: [Boolean, String] },
72
+ markers: {},
73
+ transitions: { type: [Boolean, Object] },
74
+ enableSeconds: { type: Boolean },
75
+ escClose: { type: Boolean },
76
+ spaceConfirm: { type: Boolean },
77
+ monthChangeOnArrows: { type: Boolean },
78
+ formatLocale: {},
79
+ autocomplete: {},
80
+ multiDates: { type: [Boolean, Object] },
81
+ presetDates: {},
82
+ flow: {},
83
+ partialFlow: { type: Boolean },
84
+ preventMinMaxNavigation: { type: Boolean },
85
+ utc: { type: [Boolean, String] },
86
+ reverseYears: { type: Boolean },
87
+ weekPicker: { type: Boolean },
88
+ vertical: { type: Boolean },
89
+ ariaLabels: {},
90
+ arrowNavigation: { type: Boolean },
91
+ yearPicker: { type: Boolean },
92
+ dayNames: {},
93
+ modelType: { default: "yyyy-MM-dd" },
94
+ modelAuto: { type: Boolean },
95
+ highlight: {},
96
+ offset: {},
97
+ teleportCenter: { type: Boolean },
98
+ teleport: { type: [Boolean, String] },
99
+ ignoreTimeValidation: { type: Boolean },
100
+ dayClass: {},
101
+ hideNavigation: {},
102
+ sixWeeks: { type: [Boolean, String] },
103
+ timezone: {},
104
+ disableYearSelect: { type: Boolean },
105
+ focusStartDate: { type: Boolean },
106
+ disabledTimes: {},
107
+ timePickerInline: { type: Boolean },
108
+ calendar: {},
109
+ config: {},
110
+ quarterPicker: { type: Boolean },
111
+ yearFirst: { type: Boolean },
112
+ loading: { type: Boolean },
113
+ onInternalModelChange: {},
114
+ enableMinutes: { type: Boolean },
115
+ ui: {}
116
+ }, {
117
+ "modelValue": { default: "" },
118
+ "modelModifiers": {}
119
+ }),
22
120
  emits: ["update:modelValue"],
23
- setup(__props, { emit: __emit }) {
24
- const selectAttribute = {
25
- highlight: { class: "bg-primary", contentClass: "text-white" }
26
- };
27
- const DEFAULT_MASKS = {
28
- // The mask for the input
29
- input: "DD-MMM-YYYY",
30
- // The mask for the model value
31
- data: "YYYY-MM-DD"
32
- };
121
+ setup(__props) {
33
122
  const props = __props;
34
- const emit = __emit;
35
- const { labelClasses, errorMsgClasses } = useInputClasses.useInputClasses(props);
123
+ const model = vue.useModel(__props, "modelValue");
36
124
  const attrs = vue.useAttrs();
37
- const innerValue = vue.ref(null);
38
- const datepickerRef = vue.ref(null);
39
- const masks = vue.computed(() => {
40
- return Object.assign(DEFAULT_MASKS, attrs.masks);
41
- });
42
- const listeners = vue.computed(() => {
43
- return Object.keys(attrs).reduce((acc, curr) => {
44
- if (curr.startsWith("on")) {
45
- return { ...acc, [curr]: attrs[curr] };
46
- } else {
47
- return acc;
48
- }
49
- }, {});
125
+ const { labelClasses, errorMsgClasses } = useInputClasses.useInputClasses(props);
126
+ const datePickerProps = vue.computed(() => {
127
+ const { modelValue: _, ...propsWithoutModelValue } = props;
128
+ const { class: classes, style: style2, ...attrsWithoutClassAndStyle } = attrs;
129
+ return { ...propsWithoutModelValue, ...attrsWithoutClassAndStyle };
50
130
  });
51
131
  const style = vue.computed(() => {
52
132
  return attrs.style;
53
133
  });
54
- const styleDatepicker = vue.computed(() => {
55
- return props.errorMsg ? { border: "1px solid #f0453c" } : {};
56
- });
57
- const dayclick = (e) => {
58
- emit("update:modelValue", e.id);
59
- };
60
- vue.watch(
61
- () => props.modelValue,
62
- async (nV) => {
63
- const date = dayjs(nV, masks.value.data).toDate();
64
- if (nV && date.toString() === "Invalid Date") {
65
- emit("update:modelValue", null);
66
- return;
67
- }
68
- innerValue.value = nV ? dayjs(nV, masks.value.data).toDate() : null;
69
- const datepicker = datepickerRef.value;
70
- if (datepicker && typeof datepicker.move === "function" && innerValue.value) {
71
- await datepicker.move(innerValue.value);
72
- }
73
- },
74
- { immediate: true }
75
- );
76
134
  return (_ctx, _cache) => {
77
135
  return vue.openBlock(), vue.createElementBlock("div", {
78
136
  class: vue.normalizeClass([{ hidden: _ctx.$attrs.hidden }, _ctx.$attrs.class]),
@@ -88,18 +146,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
88
146
  class: vue.normalizeClass(vue.unref(labelClasses))
89
147
  }, vue.toDisplayString(_ctx.label), 3)) : vue.createCommentVNode("", true)
90
148
  ]),
91
- vue.createVNode(vue.unref(vCalendar.DatePicker), vue.mergeProps({
92
- ref_key: "datepickerRef",
93
- ref: datepickerRef,
94
- class: { "pointer-events-none opacity-70": _ctx.$attrs.disabled },
95
- "model-value": innerValue.value,
96
- "select-attribute": selectAttribute,
97
- "min-date": _ctx.minDate || null,
98
- "max-date": _ctx.maxDate || null,
99
- masks: masks.value,
100
- style: styleDatepicker.value,
101
- timezone: _ctx.timezone
102
- }, listeners.value, { onDayclick: dayclick }), null, 16, ["class", "model-value", "min-date", "max-date", "masks", "style", "timezone"]),
149
+ vue.createVNode(vue.unref(VueDatePicker), vue.mergeProps({
150
+ modelValue: model.value,
151
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event)
152
+ }, datePickerProps.value), null, 16, ["modelValue"]),
103
153
  vue.withDirectives(vue.createElementVNode("div", {
104
154
  class: vue.normalizeClass(vue.unref(errorMsgClasses))
105
155
  }, vue.toDisplayString(_ctx.errorMsg), 3), [
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
- const vueRouter = require("vue-router");
4
3
  const link = require("../link.js");
5
4
  const sanitization = require("../sanitization.js");
5
+ const vueRouter = require("vue-router");
6
6
  const _hoisted_1 = ["href"];
7
7
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
8
8
  ...{
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
- const inputClassesShared = require("../inputClassesShared.js");
4
3
  const useInputClasses = require("../useInputClasses.js");
4
+ const inputClassesShared = require("../inputClassesShared.js");
5
5
  const _hoisted_1 = ["data-has-error"];
6
6
  const _hoisted_2 = ["value"];
7
7
  const _hoisted_3 = ["value"];