@pequity/squirrel 5.4.0 → 5.4.2

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 (94) hide show
  1. package/dist/cjs/chunks/p-action-bar.js +10 -11
  2. package/dist/cjs/chunks/p-date-picker.js +108 -0
  3. package/dist/cjs/chunks/p-dropdown-select.js +7 -8
  4. package/dist/cjs/chunks/p-inline-date-picker.js +112 -0
  5. package/dist/cjs/chunks/p-input-percent.js +3 -5
  6. package/dist/cjs/chunks/p-pagination-info.js +1 -1
  7. package/dist/cjs/chunks/p-pagination.js +12 -16
  8. package/dist/cjs/config.js +54 -54
  9. package/dist/cjs/index.js +47 -52
  10. package/dist/cjs/p-btn.js +8 -5
  11. package/dist/cjs/p-chips.js +3 -5
  12. package/dist/cjs/p-date-picker.js +2 -138
  13. package/dist/cjs/p-drawer.js +3 -3
  14. package/dist/cjs/p-info-icon.js +1 -3
  15. package/dist/cjs/p-inline-date-picker.js +2 -143
  16. package/dist/cjs/p-modal.js +3 -3
  17. package/dist/cjs/p-table-td.js +3 -5
  18. package/dist/es/chunks/p-action-bar.js +10 -11
  19. package/dist/es/chunks/p-date-picker.js +109 -0
  20. package/dist/es/chunks/p-dropdown-select.js +7 -8
  21. package/dist/es/chunks/p-inline-date-picker.js +113 -0
  22. package/dist/es/chunks/p-input-percent.js +3 -5
  23. package/dist/es/chunks/p-pagination-info.js +1 -1
  24. package/dist/es/chunks/p-pagination.js +12 -16
  25. package/dist/es/config.js +54 -54
  26. package/dist/es/index.js +96 -101
  27. package/dist/es/p-btn.js +8 -5
  28. package/dist/es/p-chips.js +4 -6
  29. package/dist/es/p-date-picker.js +2 -138
  30. package/dist/es/p-drawer.js +3 -3
  31. package/dist/es/p-info-icon.js +2 -4
  32. package/dist/es/p-inline-date-picker.js +2 -143
  33. package/dist/es/p-modal.js +3 -3
  34. package/dist/es/p-table-td.js +4 -6
  35. package/dist/squirrel/components/p-action-bar/p-action-bar.vue.d.ts +5 -14
  36. package/dist/squirrel/components/p-alert/p-alert.vue.d.ts +4 -4
  37. package/dist/squirrel/components/p-avatar/p-avatar.vue.d.ts +5 -5
  38. package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +40 -5
  39. package/dist/squirrel/components/p-card/p-card.vue.d.ts +4 -4
  40. package/dist/squirrel/components/p-checkbox/p-checkbox.vue.d.ts +5 -5
  41. package/dist/squirrel/components/p-chips/p-chips.vue.d.ts +5 -5
  42. package/dist/squirrel/components/p-close-btn/p-close-btn.vue.d.ts +4 -4
  43. package/dist/squirrel/components/p-date-picker/p-date-picker.vue.d.ts +35 -128
  44. package/dist/squirrel/components/p-drawer/p-drawer.vue.d.ts +37 -5
  45. package/dist/squirrel/components/p-dropdown/p-dropdown.vue.d.ts +5 -5
  46. package/dist/squirrel/components/p-dropdown-select/p-dropdown-select.vue.d.ts +128 -29
  47. package/dist/squirrel/components/p-file-upload/p-file-upload.vue.d.ts +5 -5
  48. package/dist/squirrel/components/p-icon/p-icon.vue.d.ts +1 -10
  49. package/dist/squirrel/components/p-info-icon/p-info-icon.vue.d.ts +2 -23
  50. package/dist/squirrel/components/p-input/p-input.vue.d.ts +9 -9
  51. package/dist/squirrel/components/p-input-number/p-input-number.vue.d.ts +40 -10
  52. package/dist/squirrel/components/p-input-percent/p-input-percent.vue.d.ts +5 -5
  53. package/dist/squirrel/components/p-input-search/p-input-search.vue.d.ts +121 -5
  54. package/dist/squirrel/components/p-link/p-link.vue.d.ts +1 -10
  55. package/dist/squirrel/components/p-loading/p-loading.vue.d.ts +1 -1
  56. package/dist/squirrel/components/p-modal/p-modal.vue.d.ts +5 -5
  57. package/dist/squirrel/components/p-pagination/p-pagination.vue.d.ts +5 -5
  58. package/dist/squirrel/components/p-pagination-info/p-pagination-info.vue.d.ts +4 -4
  59. package/dist/squirrel/components/p-progress-bar/p-progress-bar.vue.d.ts +3 -3
  60. package/dist/squirrel/components/p-ring-loader/p-ring-loader.vue.d.ts +4 -4
  61. package/dist/squirrel/components/p-select/p-select.vue.d.ts +5 -5
  62. package/dist/squirrel/components/p-select-btn/p-select-btn.vue.d.ts +4 -45
  63. package/dist/squirrel/components/p-select-list/p-select-list.vue.d.ts +128 -29
  64. package/dist/squirrel/components/p-select-list/useSelectList.d.ts +4 -4
  65. package/dist/squirrel/components/p-select-pill/p-select-pill.vue.d.ts +5 -5
  66. package/dist/squirrel/components/p-skeleton-loader/p-skeleton-loader.vue.d.ts +4 -4
  67. package/dist/squirrel/components/p-table/p-table.vue.d.ts +10 -47
  68. package/dist/squirrel/components/p-table/usePTableColResize.d.ts +4 -4
  69. package/dist/squirrel/components/p-table/usePTableRowVirtualizer.d.ts +10 -4
  70. package/dist/squirrel/components/p-table-header-cell/p-table-filter-icon.vue.d.ts +4 -4
  71. package/dist/squirrel/components/p-table-header-cell/p-table-header-cell.vue.d.ts +48 -5
  72. package/dist/squirrel/components/p-table-loader/p-table-loader.vue.d.ts +4 -4
  73. package/dist/squirrel/components/p-table-sort/p-table-sort.vue.d.ts +5 -5
  74. package/dist/squirrel/components/p-table-td/p-table-td.vue.d.ts +2 -25
  75. package/dist/squirrel/components/p-tabs/p-tabs.vue.d.ts +5 -5
  76. package/dist/squirrel/components/p-textarea/p-textarea.vue.d.ts +9 -9
  77. package/dist/squirrel/components/p-toggle/p-toggle.vue.d.ts +9 -9
  78. package/dist/squirrel/composables/useInputClasses.d.ts +1 -1
  79. package/dist/squirrel/tailwind/config.d.ts +54 -54
  80. package/dist/squirrel/utils/inputClassesMixin.d.ts +4 -4
  81. package/dist/style.css +92 -92
  82. package/dist/tailwind/config.js +54 -54
  83. package/package.json +25 -25
  84. package/squirrel/assets/squirrel.css +41 -41
  85. package/squirrel/components/p-alert/p-alert.spec.js +1 -1
  86. package/squirrel/components/p-btn/p-btn.spec.js +33 -4
  87. package/squirrel/components/p-btn/p-btn.vue +5 -2
  88. package/squirrel/components/p-date-picker/p-date-picker.vue +79 -86
  89. package/squirrel/components/p-drawer/p-drawer.vue +1 -1
  90. package/squirrel/components/p-inline-date-picker/p-inline-date-picker.spec.js +12 -14
  91. package/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue +87 -99
  92. package/squirrel/components/p-modal/p-modal.vue +1 -1
  93. package/squirrel/tailwind/config.ts +54 -54
  94. package/dist/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue.d.ts +0 -154
@@ -37,7 +37,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
37
37
  },
38
38
  bgClass: {
39
39
  type: [String, Object, Array],
40
- default: "fixed bottom-0 left-0 right-0 top-0 bg-black bg-opacity-20"
40
+ default: "fixed bottom-0 left-0 right-0 top-0 bg-black/20"
41
41
  },
42
42
  wrapperClass: {
43
43
  type: [String, Object, Array],
@@ -111,7 +111,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
111
111
  ],
112
112
  setup(__props, { emit: __emit }) {
113
113
  vue.useCssVars((_ctx) => ({
114
- "4046568f": __props.maxWidth
114
+ "6f065855": __props.maxWidth
115
115
  }));
116
116
  let animatingZIndex = 0;
117
117
  const emit = __emit;
@@ -368,5 +368,5 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
368
368
  };
369
369
  }
370
370
  });
371
- const pModal = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-7e6a0b8d"]]);
371
+ const pModal = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-dd6e68e1"]]);
372
372
  module.exports = pModal;
@@ -2,9 +2,7 @@
2
2
  const vue = require("vue");
3
3
  const pTable = require("./p-table.js");
4
4
  const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
5
- const _withScopeId = (n) => (vue.pushScopeId("data-v-09e6d191"), n = n(), vue.popScopeId(), n);
6
- const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "dropdown-anchor" }, null, -1));
7
- const _hoisted_2 = {
5
+ const _hoisted_1 = {
8
6
  key: 0,
9
7
  class: "min-w-[80px] border-l border-p-gray-30 bg-gradient-to-r from-white via-p-gray-10 to-p-gray-10"
10
8
  };
@@ -72,14 +70,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
72
70
  return (_ctx, _cache) => {
73
71
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
74
72
  vue.createElementVNode("td", vue.mergeProps({ class: tdClass.value }, _ctx.$attrs), [
75
- _hoisted_1,
73
+ _cache[0] || (_cache[0] = vue.createElementVNode("div", { class: "dropdown-anchor" }, null, -1)),
76
74
  vue.createElementVNode("div", {
77
75
  class: vue.normalizeClass(innerDivClass.value)
78
76
  }, [
79
77
  vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
80
78
  ], 2)
81
79
  ], 16),
82
- vue.unref(isColsResizable) && isLastCol.value && !vue.unref(isLastColFixed) ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_2)) : vue.createCommentVNode("", true)
80
+ vue.unref(isColsResizable) && isLastCol.value && !vue.unref(isLastColFixed) ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_1)) : vue.createCommentVNode("", true)
83
81
  ], 64);
84
82
  };
85
83
  }
@@ -2183,12 +2183,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2183
2183
  });
2184
2184
  const _hoisted_1 = { class: "flex h-12 w-max select-none items-center rounded-lg bg-p-purple-60 px-2 text-sm font-medium text-white" };
2185
2185
  const _hoisted_2 = { class: "whitespace-nowrap px-3" };
2186
- const _hoisted_3 = /* @__PURE__ */ createElementVNode("div", { class: "mx-4 h-9 w-0.5 shrink-0 rounded bg-p-purple-50" }, null, -1);
2187
- const _hoisted_4 = { class: "flex" };
2186
+ const _hoisted_3 = { class: "flex" };
2187
+ const _hoisted_4 = { class: "flex items-center gap-2 px-1 py-0.5" };
2188
2188
  const _hoisted_5 = { class: "flex items-center gap-2 px-1 py-0.5" };
2189
- const _hoisted_6 = { class: "flex items-center gap-2 px-1 py-0.5" };
2190
- const _hoisted_7 = { class: "flex flex-col bg-p-purple-60" };
2191
- const _hoisted_8 = { class: "flex items-center gap-2 px-1 py-0.5" };
2189
+ const _hoisted_6 = { class: "flex flex-col bg-p-purple-60" };
2190
+ const _hoisted_7 = { class: "flex items-center gap-2 px-1 py-0.5" };
2192
2191
  const _sfc_main = /* @__PURE__ */ defineComponent({
2193
2192
  ...{
2194
2193
  name: "PActionBar",
@@ -2215,8 +2214,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2215
2214
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click:dismiss"))
2216
2215
  }),
2217
2216
  createElementVNode("p", _hoisted_2, toDisplayString(_ctx.label), 1),
2218
- _hoisted_3,
2219
- createElementVNode("div", _hoisted_4, [
2217
+ _cache[1] || (_cache[1] = createElementVNode("div", { class: "mx-4 h-9 w-0.5 shrink-0 rounded bg-p-purple-50" }, null, -1)),
2218
+ createElementVNode("div", _hoisted_3, [
2220
2219
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.actions, (actionOrMenu) => {
2221
2220
  return openBlock(), createElementBlock(Fragment, {
2222
2221
  key: `action-${actionOrMenu.label}`
@@ -2228,7 +2227,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2228
2227
  onClick: ($event) => _ctx.$emit("click:action", actionOrMenu.name)
2229
2228
  }, {
2230
2229
  default: withCtx(() => [
2231
- createElementVNode("div", _hoisted_5, [
2230
+ createElementVNode("div", _hoisted_4, [
2232
2231
  unref(isComponent)(actionOrMenu.icon) ? (openBlock(), createBlock(resolveDynamicComponent(actionOrMenu.icon), {
2233
2232
  key: 0,
2234
2233
  class: "h-4 w-4"
@@ -2249,7 +2248,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2249
2248
  strategy: "fixed"
2250
2249
  }, {
2251
2250
  popper: withCtx(() => [
2252
- createElementVNode("div", _hoisted_7, [
2251
+ createElementVNode("div", _hoisted_6, [
2253
2252
  (openBlock(true), createElementBlock(Fragment, null, renderList(actionOrMenu.subActions, (subaction) => {
2254
2253
  return openBlock(), createElementBlock("div", {
2255
2254
  key: `subaction-${subaction.name}`
@@ -2261,7 +2260,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2261
2260
  onClick: ($event) => _ctx.$emit("click:action", subaction.name)
2262
2261
  }, {
2263
2262
  default: withCtx(() => [
2264
- createElementVNode("div", _hoisted_8, [
2263
+ createElementVNode("div", _hoisted_7, [
2265
2264
  unref(isComponent)(subaction.icon) ? (openBlock(), createBlock(resolveDynamicComponent(subaction.icon), {
2266
2265
  key: 0,
2267
2266
  class: "h-4 w-4"
@@ -2287,7 +2286,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2287
2286
  type: "secondary-ghost-dark"
2288
2287
  }, {
2289
2288
  default: withCtx(() => [
2290
- createElementVNode("div", _hoisted_6, [
2289
+ createElementVNode("div", _hoisted_5, [
2291
2290
  unref(isComponent)(actionOrMenu.icon) ? (openBlock(), createBlock(resolveDynamicComponent(actionOrMenu.icon), {
2292
2291
  key: 0,
2293
2292
  class: "h-4 w-4"
@@ -0,0 +1,109 @@
1
+ import { defineComponent, useAttrs, ref, computed, watch, nextTick, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, unref, toDisplayString, createCommentVNode, createVNode, withCtx, mergeProps, toHandlers, withDirectives, createElementVNode, vShow } from "vue";
2
+ import PInput from "../p-input.js";
3
+ import dayjs from "dayjs";
4
+ import { DatePicker } from "v-calendar";
5
+ import { isString, isDate } from "lodash-es";
6
+ import { useInputClasses } from "../useInputClasses.js";
7
+ const _hoisted_1 = ["data-has-error"];
8
+ const _sfc_main = /* @__PURE__ */ defineComponent({
9
+ ...{
10
+ name: "PDatePicker",
11
+ inheritAttrs: false
12
+ },
13
+ __name: "p-date-picker",
14
+ props: {
15
+ modelValue: { default: "" },
16
+ label: { default: "" },
17
+ errorMsg: { default: "" },
18
+ required: { type: Boolean, default: false },
19
+ minDate: { default: null },
20
+ maxDate: { default: null },
21
+ timezone: { default: "" }
22
+ },
23
+ emits: ["update:modelValue"],
24
+ setup(__props, { emit: __emit }) {
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
+ };
32
+ const props = __props;
33
+ const emit = __emit;
34
+ const { labelClasses, errorMsgClasses } = useInputClasses(props);
35
+ const attrs = useAttrs();
36
+ const innerValue = ref(null);
37
+ const stopWatch = ref(false);
38
+ const masks = computed(() => {
39
+ return Object.assign(DEFAULT_MASKS, attrs.masks);
40
+ });
41
+ const displayPlaceholder = computed(() => {
42
+ return isString(attrs.placeholder) ? attrs.placeholder : masks.value.input;
43
+ });
44
+ const attrsWithoutClassAndStyle = computed(() => {
45
+ const { class: classes, style: style2, ...rest } = attrs;
46
+ return rest;
47
+ });
48
+ const style = computed(() => {
49
+ return attrs.style;
50
+ });
51
+ watch(
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
+ });
67
+ });
68
+ return (_ctx, _cache) => {
69
+ return openBlock(), createElementBlock("div", {
70
+ class: normalizeClass([{ hidden: _ctx.$attrs.hidden }, _ctx.$attrs.class]),
71
+ "data-has-error": !!_ctx.errorMsg,
72
+ style: normalizeStyle(style.value)
73
+ }, [
74
+ renderSlot(_ctx.$slots, "label", {
75
+ label: _ctx.label,
76
+ labelClasses: unref(labelClasses)
77
+ }, () => [
78
+ _ctx.label ? (openBlock(), createElementBlock("label", {
79
+ key: 0,
80
+ class: normalizeClass(unref(labelClasses))
81
+ }, toDisplayString(_ctx.label), 3)) : createCommentVNode("", true)
82
+ ]),
83
+ createVNode(unref(DatePicker), {
84
+ modelValue: innerValue.value,
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);
104
+ };
105
+ }
106
+ });
107
+ export {
108
+ _sfc_main as _
109
+ };
@@ -20,10 +20,9 @@ const _hoisted_4 = {
20
20
  };
21
21
  const _hoisted_5 = { class: "text-p-purple-60" };
22
22
  const _hoisted_6 = { class: "flex flex-row" };
23
- const _hoisted_7 = /* @__PURE__ */ createElementVNode("span", { class: "px-1 leading-none" }, ".", -1);
24
- const _hoisted_8 = ["onClick"];
25
- const _hoisted_9 = ["title"];
26
- const _hoisted_10 = {
23
+ const _hoisted_7 = ["onClick"];
24
+ const _hoisted_8 = ["title"];
25
+ const _hoisted_9 = {
27
26
  key: 0,
28
27
  class: "ml-auto fill-p-purple-60 pl-2",
29
28
  src: _imports_0
@@ -296,7 +295,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
296
295
  onClick: _cache[2] || (_cache[2] = //@ts-ignore
297
296
  (...args) => unref(selectAll) && unref(selectAll)(...args))
298
297
  }, " Select all filtered ", 2)),
299
- _hoisted_7,
298
+ _cache[6] || (_cache[6] = createElementVNode("span", { class: "px-1 leading-none" }, ".", -1)),
300
299
  createElementVNode("a", {
301
300
  class: normalizeClass([unref(selectedItems).length ? "cursor-pointer" : "pointer-events-none opacity-50"]),
302
301
  onClick: _cache[3] || (_cache[3] = //@ts-ignore
@@ -363,11 +362,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
363
362
  class: normalizeClass({ "bg-p-blue-20": index === 1 })
364
363
  }, toDisplayString(str), 3);
365
364
  }), 128))
366
- ], 8, _hoisted_9)
365
+ ], 8, _hoisted_8)
367
366
  ]),
368
- unref(isSelected)(unref(getValue)(row.index)) ? (openBlock(), createElementBlock("img", _hoisted_10)) : createCommentVNode("", true)
367
+ unref(isSelected)(unref(getValue)(row.index)) ? (openBlock(), createElementBlock("img", _hoisted_9)) : createCommentVNode("", true)
369
368
  ], 2)
370
- ], 14, _hoisted_8)), [
369
+ ], 14, _hoisted_7)), [
371
370
  [_directive_close_popper, !__props.multiple]
372
371
  ])
373
372
  ], 4);
@@ -0,0 +1,113 @@
1
+ import { defineComponent, useAttrs, ref, computed, watch, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, unref, toDisplayString, createCommentVNode, createVNode, mergeProps, withDirectives, createElementVNode, vShow } from "vue";
2
+ import dayjs from "dayjs";
3
+ import { DatePicker } from "v-calendar";
4
+ import { useInputClasses } from "../useInputClasses.js";
5
+ const _hoisted_1 = ["data-has-error"];
6
+ const _sfc_main = /* @__PURE__ */ defineComponent({
7
+ ...{
8
+ name: "PInlineDatePicker",
9
+ inheritAttrs: false
10
+ },
11
+ __name: "p-inline-date-picker",
12
+ props: {
13
+ modelValue: { default: "" },
14
+ label: { default: "" },
15
+ errorMsg: { default: "" },
16
+ required: { type: Boolean, default: false },
17
+ minDate: { default: null },
18
+ maxDate: { default: null },
19
+ timezone: { default: "" }
20
+ },
21
+ emits: ["update:modelValue"],
22
+ setup(__props, { emit: __emit }) {
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
+ };
32
+ const props = __props;
33
+ const emit = __emit;
34
+ const { labelClasses, errorMsgClasses } = useInputClasses(props);
35
+ const attrs = useAttrs();
36
+ const innerValue = ref(null);
37
+ const datepickerRef = ref(null);
38
+ const masks = computed(() => {
39
+ return Object.assign(DEFAULT_MASKS, attrs.masks);
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
+ }, {});
49
+ });
50
+ const style = computed(() => {
51
+ return attrs.style;
52
+ });
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
+ return (_ctx, _cache) => {
76
+ return openBlock(), createElementBlock("div", {
77
+ class: normalizeClass([{ hidden: _ctx.$attrs.hidden }, _ctx.$attrs.class]),
78
+ "data-has-error": !!_ctx.errorMsg,
79
+ style: normalizeStyle(style.value)
80
+ }, [
81
+ renderSlot(_ctx.$slots, "label", {
82
+ label: _ctx.label,
83
+ labelClasses: unref(labelClasses)
84
+ }, () => [
85
+ _ctx.label ? (openBlock(), createElementBlock("label", {
86
+ key: 0,
87
+ class: normalizeClass(unref(labelClasses))
88
+ }, toDisplayString(_ctx.label), 3)) : createCommentVNode("", true)
89
+ ]),
90
+ createVNode(unref(DatePicker), mergeProps({
91
+ ref_key: "datepickerRef",
92
+ ref: datepickerRef,
93
+ class: { "pointer-events-none opacity-70": _ctx.$attrs.disabled },
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"]),
102
+ withDirectives(createElementVNode("div", {
103
+ class: normalizeClass(unref(errorMsgClasses))
104
+ }, toDisplayString(_ctx.errorMsg), 3), [
105
+ [vShow, _ctx.errorMsg]
106
+ ])
107
+ ], 14, _hoisted_1);
108
+ };
109
+ }
110
+ });
111
+ export {
112
+ _sfc_main as _
113
+ };
@@ -1,10 +1,6 @@
1
1
  import { defineComponent, computed, openBlock, createBlock, withCtx, createElementVNode, normalizeClass } from "vue";
2
2
  import PInputNumber from "../p-input-number.js";
3
3
  import { isNumber } from "lodash-es";
4
- const _hoisted_1 = /* @__PURE__ */ createElementVNode("div", null, "%", -1);
5
- const _hoisted_2 = [
6
- _hoisted_1
7
- ];
8
4
  const _sfc_main = /* @__PURE__ */ defineComponent({
9
5
  ...{
10
6
  name: "PInputPercent"
@@ -42,7 +38,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
42
38
  prefix: withCtx(() => [
43
39
  createElementVNode("div", {
44
40
  class: normalizeClass(["absolute flex items-center", prefixClasses[__props.size]])
45
- }, _hoisted_2, 2)
41
+ }, _cache[1] || (_cache[1] = [
42
+ createElementVNode("div", null, "%", -1)
43
+ ]), 2)
46
44
  ]),
47
45
  _: 1
48
46
  }, 8, ["modelValue", "size"]);
@@ -56,7 +56,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
56
56
  __props.count ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
57
57
  createTextVNode("Showing " + toDisplayString(from.value) + " to " + toDisplayString(to.value) + " of " + toDisplayString(__props.count) + " results", 1)
58
58
  ], 64)) : renderSlot(_ctx.$slots, "no-results", { key: 1 }, () => [
59
- createTextVNode("No results found")
59
+ _cache[0] || (_cache[0] = createTextVNode("No results found"))
60
60
  ])
61
61
  ]));
62
62
  };
@@ -7,17 +7,9 @@ const _hoisted_1 = {
7
7
  key: 1,
8
8
  class: "flex text-p-gray-40"
9
9
  };
10
- const _hoisted_2 = /* @__PURE__ */ createElementVNode("img", { src: _imports_0 }, null, -1);
11
- const _hoisted_3 = [
12
- _hoisted_2
13
- ];
14
- const _hoisted_4 = ["onClick"];
15
- const _hoisted_5 = { class: "flex" };
16
- const _hoisted_6 = ["aria-label"];
17
- const _hoisted_7 = /* @__PURE__ */ createElementVNode("img", { src: _imports_1 }, null, -1);
18
- const _hoisted_8 = [
19
- _hoisted_7
20
- ];
10
+ const _hoisted_2 = ["onClick"];
11
+ const _hoisted_3 = { class: "flex" };
12
+ const _hoisted_4 = ["aria-label"];
21
13
  const DOTS = "...";
22
14
  const BTN_CLASS = "w-6 h-6 flex justify-center items-center mx-1 font-semibold text-sm leading-none";
23
15
  const BTN_ACTIVE_CLASS = "text-p-purple-60 bg-p-gray-30 rounded-lg";
@@ -90,29 +82,33 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
90
82
  class: normalizeClass([BTN_CLASS, Number(__props.modelValue) <= 1 ? ARROW_INACTIVE_CLASS : ARROW_ACTIVE_CLASS]),
91
83
  "aria-label": "go to the previous page",
92
84
  onClick: _cache[0] || (_cache[0] = ($event) => setPage(Number(__props.modelValue) - 1))
93
- }, _hoisted_3, 2),
85
+ }, _cache[2] || (_cache[2] = [
86
+ createElementVNode("img", { src: _imports_0 }, null, -1)
87
+ ]), 2),
94
88
  (openBlock(true), createElementBlock(Fragment, null, renderList(pages.value, (page, index) => {
95
89
  return openBlock(), createElementBlock("div", {
96
90
  key: index,
97
91
  onClick: ($event) => setPage(Number(page))
98
92
  }, [
99
- createElementVNode("div", _hoisted_5, [
93
+ createElementVNode("div", _hoisted_3, [
100
94
  page !== DOTS ? (openBlock(), createElementBlock("div", {
101
95
  key: 0,
102
96
  class: normalizeClass([BTN_CLASS, page === __props.modelValue ? BTN_ACTIVE_CLASS : BTN_INACTIVE_CLASS]),
103
97
  "aria-label": `go to page ${page}`
104
- }, toDisplayString(page), 11, _hoisted_6)) : (openBlock(), createElementBlock("div", {
98
+ }, toDisplayString(page), 11, _hoisted_4)) : (openBlock(), createElementBlock("div", {
105
99
  key: 1,
106
100
  class: normalizeClass(BTN_CLASS)
107
101
  }, toDisplayString(DOTS)))
108
102
  ])
109
- ], 8, _hoisted_4);
103
+ ], 8, _hoisted_2);
110
104
  }), 128)),
111
105
  createElementVNode("div", {
112
106
  class: normalizeClass([BTN_CLASS, __props.modelValue === pageCount.value ? ARROW_INACTIVE_CLASS : ARROW_ACTIVE_CLASS]),
113
107
  "aria-label": "go to the next page",
114
108
  onClick: _cache[1] || (_cache[1] = ($event) => setPage(Number(__props.modelValue) + 1))
115
- }, _hoisted_8, 2)
109
+ }, _cache[3] || (_cache[3] = [
110
+ createElementVNode("img", { src: _imports_1 }, null, -1)
111
+ ]), 2)
116
112
  ])) : createCommentVNode("", true)
117
113
  ], 64);
118
114
  };
package/dist/es/config.js CHANGED
@@ -5,71 +5,71 @@ const config = {
5
5
  transparent: "transparent",
6
6
  current: "currentColor",
7
7
  /* Design system colors */
8
- white: "#fff",
9
- black: "#000",
10
- night: "var(--color-night)",
11
- "barley-white": "var(--color-barley-white)",
12
- "horses-neck": "var(--color-horses-neck)",
13
- "active-blue": "var(--color-active-blue)",
8
+ white: "rgb(var(--color-white))",
9
+ black: "rgb(var(--color-black))",
10
+ night: "rgb(var(--color-night))",
11
+ "barley-white": "rgb(var(--color-barley-white))",
12
+ "horses-neck": "rgb(var(--color-horses-neck))",
13
+ "active-blue": "rgb(var(--color-active-blue))",
14
14
  /* Pequity colors */
15
15
  "p-gray": {
16
- 10: "var(--color-p-gray-10)",
17
- 20: "var(--color-p-gray-20)",
18
- 30: "var(--color-p-gray-30)",
19
- 40: "var(--color-p-gray-40)",
20
- 50: "var(--color-p-gray-50)",
21
- 60: "var(--color-p-gray-60)",
22
- 70: "var(--color-p-gray-70)",
23
- 80: "var(--color-p-gray-80)",
24
- 90: "var(--color-p-gray-90)",
25
- 100: "var(--color-p-gray-100)"
16
+ 10: "rgb(var(--color-p-gray-10))",
17
+ 20: "rgb(var(--color-p-gray-20))",
18
+ 30: "rgb(var(--color-p-gray-30))",
19
+ 40: "rgb(var(--color-p-gray-40))",
20
+ 50: "rgb(var(--color-p-gray-50))",
21
+ 60: "rgb(var(--color-p-gray-60))",
22
+ 70: "rgb(var(--color-p-gray-70))",
23
+ 80: "rgb(var(--color-p-gray-80))",
24
+ 90: "rgb(var(--color-p-gray-90))",
25
+ 100: "rgb(var(--color-p-gray-100))"
26
26
  },
27
27
  "p-blue": {
28
- 10: "var(--color-p-blue-10)",
29
- 15: "var(--color-p-blue-15)",
30
- 20: "var(--color-p-blue-20)",
31
- 30: "var(--color-p-blue-30)",
32
- 40: "var(--color-p-blue-40)",
33
- 50: "var(--color-p-blue-50)",
34
- 60: "var(--color-p-blue-60)",
35
- 70: "var(--color-p-blue-70)",
36
- 80: "var(--color-p-blue-80)"
28
+ 10: "rgb(var(--color-p-blue-10))",
29
+ 15: "rgb(var(--color-p-blue-15))",
30
+ 20: "rgb(var(--color-p-blue-20))",
31
+ 30: "rgb(var(--color-p-blue-30))",
32
+ 40: "rgb(var(--color-p-blue-40))",
33
+ 50: "rgb(var(--color-p-blue-50))",
34
+ 60: "rgb(var(--color-p-blue-60))",
35
+ 70: "rgb(var(--color-p-blue-70))",
36
+ 80: "rgb(var(--color-p-blue-80))"
37
37
  },
38
38
  "p-purple": {
39
- 10: "var(--color-p-purple-10)",
40
- 20: "var(--color-p-purple-20)",
41
- 30: "var(--color-p-purple-30)",
42
- 40: "var(--color-p-purple-40)",
43
- 50: "var(--color-p-purple-50)",
44
- 60: "var(--color-p-purple-60)"
39
+ 10: "rgb(var(--color-p-purple-10))",
40
+ 20: "rgb(var(--color-p-purple-20))",
41
+ 30: "rgb(var(--color-p-purple-30))",
42
+ 40: "rgb(var(--color-p-purple-40))",
43
+ 50: "rgb(var(--color-p-purple-50))",
44
+ 60: "rgb(var(--color-p-purple-60))"
45
45
  },
46
46
  "p-green": {
47
- 10: "var(--color-p-green-10)",
48
- 20: "var(--color-p-green-20)",
49
- 30: "var(--color-p-green-30)",
50
- 40: "var(--color-p-green-40)",
51
- 50: "var(--color-p-green-50)"
47
+ 10: "rgb(var(--color-p-green-10))",
48
+ 20: "rgb(var(--color-p-green-20))",
49
+ 30: "rgb(var(--color-p-green-30))",
50
+ 40: "rgb(var(--color-p-green-40))",
51
+ 50: "rgb(var(--color-p-green-50))"
52
52
  },
53
53
  "p-red": {
54
- 10: "var(--color-p-red-10)",
55
- 20: "var(--color-p-red-20)",
56
- 30: "var(--color-p-red-30)",
57
- 40: "var(--color-p-red-40)",
58
- 50: "var(--color-p-red-50)"
54
+ 10: "rgb(var(--color-p-red-10))",
55
+ 20: "rgb(var(--color-p-red-20))",
56
+ 30: "rgb(var(--color-p-red-30))",
57
+ 40: "rgb(var(--color-p-red-40))",
58
+ 50: "rgb(var(--color-p-red-50))"
59
59
  },
60
60
  /* Aliases */
61
- primary: "var(--color-primary)",
62
- accent: "var(--color-accent)",
63
- surface: "var(--color-surface)",
64
- "on-surface": "var(--color-on-surface)",
65
- error: "var(--color-error)",
66
- "on-error": "var(--color-on-error)",
67
- info: "var(--color-info)",
68
- "on-info": "var(--color-on-info)",
69
- success: "var(--color-success)",
70
- "on-success": "var(--color-on-success)",
71
- warning: "var(--color-warning)",
72
- "on-warning": "var(--color-on-warning)"
61
+ primary: "rgb(var(--color-primary))",
62
+ accent: "rgb(var(--color-accent))",
63
+ surface: "rgb(var(--color-surface))",
64
+ "on-surface": "rgb(var(--color-on-surface))",
65
+ error: "rgb(var(--color-error))",
66
+ "on-error": "rgb(var(--color-on-error))",
67
+ info: "rgb(var(--color-info))",
68
+ "on-info": "rgb(var(--color-on-info))",
69
+ success: "rgb(var(--color-success))",
70
+ "on-success": "rgb(var(--color-on-success))",
71
+ warning: "rgb(var(--color-warning))",
72
+ "on-warning": "rgb(var(--color-on-warning))"
73
73
  },
74
74
  fontFamily: {
75
75
  sans: ["Inter", "Helvetica", "Arial", "sans-serif"]
@@ -88,7 +88,7 @@ const config = {
88
88
  },
89
89
  extend: {
90
90
  borderColor: {
91
- DEFAULT: "var(--color-p-gray-30)"
91
+ DEFAULT: "rgb(var(--color-p-gray-30))"
92
92
  },
93
93
  spacing: {
94
94
  7.5: "1.875rem"