@pequity/squirrel 1.0.21-beta.1 → 1.0.22

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 (47) hide show
  1. package/dist/cjs/chunks/p-table-loader.js +13 -4
  2. package/dist/cjs/index.js +49 -16
  3. package/dist/cjs/inputClassesMixin.js +5 -1
  4. package/dist/cjs/p-chips.js +3 -3
  5. package/dist/cjs/p-input-search.js +2 -1
  6. package/dist/cjs/p-input.js +4 -0
  7. package/dist/cjs/p-table-header-cell.js +21 -8
  8. package/dist/cjs/p-table-td.js +6 -6
  9. package/dist/cjs/p-toggle.js +2 -2
  10. package/dist/cjs/useInputClasses.js +4 -3
  11. package/dist/es/chunks/p-table-loader.js +14 -5
  12. package/dist/es/index.js +49 -16
  13. package/dist/es/inputClassesMixin.js +5 -1
  14. package/dist/es/p-chips.js +3 -3
  15. package/dist/es/p-input-search.js +2 -1
  16. package/dist/es/p-input.js +4 -0
  17. package/dist/es/p-table-header-cell.js +22 -9
  18. package/dist/es/p-table-td.js +6 -6
  19. package/dist/es/p-toggle.js +2 -2
  20. package/dist/es/useInputClasses.js +4 -3
  21. package/dist/squirrel/components/p-date-picker/p-date-picker.vue.d.ts +9 -0
  22. package/dist/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue.d.ts +9 -0
  23. package/dist/squirrel/components/p-input/p-input.vue.d.ts +18 -0
  24. package/dist/squirrel/components/p-input-number/p-input-number.vue.d.ts +9 -0
  25. package/dist/squirrel/components/p-table/p-table.vue.d.ts +5 -1
  26. package/dist/squirrel/components/p-table-header-cell/p-table-header-cell.vue.d.ts +17 -1
  27. package/dist/squirrel/components/p-table-loader/p-table-loader.vue.d.ts +9 -0
  28. package/dist/squirrel/components/p-textarea/p-textarea.vue.d.ts +9 -0
  29. package/dist/squirrel/components/p-toggle/p-toggle.vue.d.ts +9 -0
  30. package/dist/squirrel/composables/useInputClasses.d.ts +1 -0
  31. package/dist/squirrel/utils/inputClassesMixin.d.ts +9 -0
  32. package/dist/style.css +25 -25
  33. package/package.json +14 -14
  34. package/squirrel/components/p-chips/p-chips.vue +1 -1
  35. package/squirrel/components/p-input/p-input.stories.js +1 -0
  36. package/squirrel/components/p-input/p-input.vue +4 -0
  37. package/squirrel/components/p-input-search/p-input-search.vue +1 -0
  38. package/squirrel/components/p-table/p-table.spec.js +0 -23
  39. package/squirrel/components/p-table/p-table.vue +48 -13
  40. package/squirrel/components/p-table-header-cell/p-table-header-cell.spec.js +2 -3
  41. package/squirrel/components/p-table-header-cell/p-table-header-cell.vue +20 -7
  42. package/squirrel/components/p-table-loader/p-table-loader.vue +6 -1
  43. package/squirrel/components/p-table-td/p-table-td.spec.js +13 -13
  44. package/squirrel/components/p-table-td/p-table-td.vue +4 -4
  45. package/squirrel/components/p-toggle/p-toggle.vue +1 -1
  46. package/squirrel/composables/useInputClasses.ts +4 -2
  47. package/squirrel/utils/inputClassesMixin.ts +5 -1
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
3
  const pSkeletonLoader = require("../p-skeleton-loader.js");
4
- const _hoisted_1 = { class: "block overflow-hidden border border-p-gray-30" };
4
+ const _hoisted_1 = { class: "block overflow-hidden border border-p-gray-30 bg-surface" };
5
5
  const _hoisted_2 = { class: "mb-0 w-full bg-surface" };
6
6
  const _hoisted_3 = { class: "relative border-b border-p-gray-30 px-4 py-2" };
7
- const _hoisted_4 = { class: "skeleton-fade" };
7
+ const _hoisted_4 = {
8
+ key: 0,
9
+ class: "h-4 w-full border-b border-b-p-gray-20 bg-p-gray-10"
10
+ };
11
+ const _hoisted_5 = { class: "skeleton-fade" };
8
12
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
9
13
  ...{
10
14
  name: "PTableLoader"
@@ -26,6 +30,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
26
30
  tdSkeletonClasses: {
27
31
  type: String,
28
32
  default: "h-5"
33
+ },
34
+ withSubheader: {
35
+ type: Boolean,
36
+ default: false
29
37
  }
30
38
  },
31
39
  setup(__props) {
@@ -41,12 +49,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
41
49
  }, [
42
50
  vue.createElementVNode("div", _hoisted_3, [
43
51
  vue.createVNode(pSkeletonLoader, { class: "h-5" })
44
- ])
52
+ ]),
53
+ __props.withSubheader ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4)) : vue.createCommentVNode("", true)
45
54
  ]);
46
55
  }), 128))
47
56
  ])
48
57
  ]),
49
- vue.createElementVNode("tbody", _hoisted_4, [
58
+ vue.createElementVNode("tbody", _hoisted_5, [
50
59
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Number(__props.rows), (i) => {
51
60
  return vue.openBlock(), vue.createElementBlock("tr", { key: i }, [
52
61
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Number(__props.columns), (col) => {
package/dist/cjs/index.js CHANGED
@@ -653,6 +653,7 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
653
653
  isFirstColFixed: { type: Boolean, default: false },
654
654
  isLastColFixed: { type: Boolean, default: false },
655
655
  lockScroll: { type: Boolean, default: false },
656
+ subheader: { type: Boolean, default: false },
656
657
  virtualizer: { default: () => ({
657
658
  paddingTop: 0,
658
659
  paddingBottom: 0
@@ -700,11 +701,9 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
700
701
  const emitScroll = (e) => {
701
702
  emit("scroll", e);
702
703
  };
703
- const thDivClasses = (i, col) => {
704
+ const thDivClasses = (i) => {
704
705
  const res = ["relative", "py-2"];
705
- if (!col.borderColor) {
706
- res.push("border-b border-p-gray-30");
707
- }
706
+ res.push("border-b border-p-gray-30");
708
707
  if (i === 0 && props.isFirstColFixed || i === props.cols.length - 1 && props.isLastColFixed) {
709
708
  res.push("th-shadow px-4");
710
709
  } else {
@@ -712,6 +711,36 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
712
711
  }
713
712
  return res;
714
713
  };
714
+ const thSubheaderClasses = (i) => {
715
+ const res = [
716
+ "flex",
717
+ "h-6",
718
+ "items-center",
719
+ "border-b",
720
+ "border-b-p-gray-20",
721
+ "bg-p-gray-10",
722
+ "px-2",
723
+ "text-xs",
724
+ "font-medium",
725
+ "text-p-gray-40"
726
+ ];
727
+ if (i === 0 && props.isFirstColFixed || i === props.cols.length - 1 && props.isLastColFixed) {
728
+ res.push("th-shadow");
729
+ }
730
+ return res;
731
+ };
732
+ const bgColorStyle = (col) => {
733
+ if (col.borderColor) {
734
+ return { backgroundColor: col.borderColor + "33" };
735
+ }
736
+ return {};
737
+ };
738
+ const headerCellTextColor = (col) => {
739
+ if (col.borderColor) {
740
+ return `color-mix(in srgb, ${col.borderColor} 100%, #000000 20%)`;
741
+ }
742
+ return "";
743
+ };
715
744
  vue.onMounted(() => {
716
745
  var _a;
717
746
  (_a = scrollWrapper.value) == null ? void 0 : _a.addEventListener("scroll", emitScroll, true);
@@ -730,7 +759,7 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
730
759
  return vue.openBlock(), vue.createElementBlock("div", {
731
760
  ref_key: "scrollWrapper",
732
761
  ref: scrollWrapper,
733
- class: vue.normalizeClass(["block border border-p-gray-30", _ctx.lockScroll ? "overflow-hidden" : "overflow-x-auto"])
762
+ class: vue.normalizeClass(["block rounded-xl border border-p-gray-30", _ctx.lockScroll ? "overflow-hidden" : "overflow-x-auto"])
734
763
  }, [
735
764
  vue.unref(isColResizing) ? (vue.openBlock(), vue.createElementBlock("div", {
736
765
  key: 0,
@@ -762,7 +791,8 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
762
791
  class: "bg-surface"
763
792
  }), [
764
793
  vue.createElementVNode("div", {
765
- class: vue.normalizeClass(thDivClasses(i, col))
794
+ class: vue.normalizeClass(thDivClasses(i)),
795
+ style: vue.normalizeStyle(bgColorStyle(col))
766
796
  }, [
767
797
  vue.createElementVNode("div", _hoisted_2$1, [
768
798
  vue.renderSlot(_ctx.$slots, `prepend-header-cell-${vue.unref(lodashEs.kebabCase)(col.name)}`, { col }, void 0, true),
@@ -771,23 +801,26 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
771
801
  "filter-active": col.filterActive,
772
802
  "show-filter-icon": col.filterable || col.sortable,
773
803
  "tooltip-text": col.tooltip,
774
- class: [{ "pl-2": i === 1 && _ctx.isFirstColFixed, "pr-2": i === _ctx.cols.length && _ctx.isLastColFixed }, "grow"]
804
+ class: [{ "pl-2": i === 1 && _ctx.isFirstColFixed, "pr-2": i === _ctx.cols.length && _ctx.isLastColFixed }, "grow"],
805
+ "text-color": headerCellTextColor(col)
775
806
  }, col.headerCellAttrs, {
776
807
  onClickFilterIcon: ($event) => _ctx.$emit("click-filter-icon", $event, col)
777
- }), null, 16, ["text", "filter-active", "show-filter-icon", "tooltip-text", "class", "onClickFilterIcon"])
808
+ }), null, 16, ["text", "filter-active", "show-filter-icon", "tooltip-text", "class", "text-color", "onClickFilterIcon"])
778
809
  ]),
779
810
  _ctx.colsResizable && i !== 0 && !(i === _ctx.cols.length - 1 && _ctx.isLastColFixed) ? (vue.openBlock(), vue.createElementBlock("div", {
780
811
  key: 0,
781
- class: vue.normalizeClass(["absolute bottom-0 right-0 h-full w-2 cursor-col-resize after:absolute after:bottom-2 after:z-20 after:block after:h-5 after:w-px after:cursor-col-resize after:bg-p-gray-30", i === _ctx.cols.length - 1 ? " after:right-0" : " after:right-1"]),
812
+ class: vue.normalizeClass(["absolute bottom-2 right-0 z-110 h-5 w-2 cursor-col-resize after:absolute after:bottom-0 after:z-110 after:block after:h-full after:w-2 after:cursor-col-resize after:border-r-2 after:border-dashed after:border-p-gray-30", i === _ctx.cols.length - 1 ? " after:right-0.5" : " after:right-0"]),
782
813
  "data-resize-handle": "",
783
814
  onMousedown: ($event) => vue.unref(colResizeStart)($event, i),
784
815
  onDblclick: ($event) => vue.unref(colResizeFitToData)(i)
785
- }, null, 42, _hoisted_3$1)) : vue.createCommentVNode("", true),
786
- vue.createElementVNode("div", {
787
- class: vue.normalizeClass(["absolute bottom-0 h-1 w-full", _ctx.colsResizable ? "-left-1" : "left-0"]),
788
- style: vue.normalizeStyle({ background: col.borderColor })
789
- }, null, 6)
790
- ], 2)
816
+ }, null, 42, _hoisted_3$1)) : vue.createCommentVNode("", true)
817
+ ], 6),
818
+ _ctx.subheader ? (vue.openBlock(), vue.createElementBlock("div", {
819
+ key: 0,
820
+ class: vue.normalizeClass(thSubheaderClasses(i))
821
+ }, [
822
+ vue.renderSlot(_ctx.$slots, `subheader-cell-${vue.unref(lodashEs.kebabCase)(col.name)}`, {}, void 0, true)
823
+ ], 2)) : vue.createCommentVNode("", true)
791
824
  ], 16, _hoisted_1$1);
792
825
  }), 128)),
793
826
  _ctx.colsResizable && !_ctx.isLastColFixed ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_4$1)) : vue.createCommentVNode("", true)
@@ -811,7 +844,7 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
811
844
  };
812
845
  }
813
846
  });
814
- const pTable = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$1, [["__scopeId", "data-v-170d774b"]]);
847
+ const pTable = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$1, [["__scopeId", "data-v-6b61498d"]]);
815
848
  const _sfc_main = vue.defineComponent({
816
849
  name: "PTableSort",
817
850
  props: {
@@ -17,6 +17,10 @@ const inputClassesMixin = vue.defineComponent({
17
17
  required: {
18
18
  type: Boolean,
19
19
  default: false
20
+ },
21
+ rounded: {
22
+ type: Boolean,
23
+ default: false
20
24
  }
21
25
  },
22
26
  data() {
@@ -29,7 +33,7 @@ const inputClassesMixin = vue.defineComponent({
29
33
  const base = `${inputClassesShared.INPUT_BASE} ${inputClassesShared.INPUT_SIZES[this.size]}`;
30
34
  const spacingLeft = this.$slots.prefix ? inputClassesShared.SPACING_PREFIX[this.size] : inputClassesShared.SPACING_LEFT[this.size];
31
35
  const spacingRight = this.$slots.suffix ? inputClassesShared.SPACING_SUFFIX[this.size] : inputClassesShared.SPACING_RIGHT[this.size];
32
- const res = `${base} ${spacingLeft} ${spacingRight} ${this.errorMsg ? inputClassesShared.INPUT_ERROR : inputClassesShared.INPUT_NORMAL}`;
36
+ const res = `${base} ${spacingLeft} ${spacingRight} ${this.errorMsg ? inputClassesShared.INPUT_ERROR : inputClassesShared.INPUT_NORMAL}${this.rounded ? " rounded-full" : ""}`;
33
37
  return res;
34
38
  },
35
39
  labelClasses() {
@@ -64,7 +64,7 @@ const _sfc_main = vue.defineComponent({
64
64
  }
65
65
  }
66
66
  });
67
- const _withScopeId = (n) => (vue.pushScopeId("data-v-40bc335f"), n = n(), vue.popScopeId(), n);
67
+ const _withScopeId = (n) => (vue.pushScopeId("data-v-cb511035"), n = n(), vue.popScopeId(), n);
68
68
  const _hoisted_1 = {
69
69
  ref: "filterChipsRow",
70
70
  class: "flex w-full items-center"
@@ -72,7 +72,7 @@ const _hoisted_1 = {
72
72
  const _hoisted_2 = { ref: "beforeSlotContainer" };
73
73
  const _hoisted_3 = {
74
74
  ref: "filterChipsRowInner",
75
- class: "flex divide-x divide-p-blue-30 overflow-hidden rounded-md border border-p-blue-30 text-xs font-medium text-p-purple-60"
75
+ class: "flex divide-x divide-p-blue-30 overflow-hidden rounded-md border border-p-blue-30 bg-transparent text-xs font-medium leading-4 text-p-purple-60"
76
76
  };
77
77
  const _hoisted_4 = ["onClick"];
78
78
  const _hoisted_5 = { class: "inline-block truncate" };
@@ -106,5 +106,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
106
106
  ], 512)
107
107
  ], 512);
108
108
  }
109
- const pChips = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-40bc335f"]]);
109
+ const pChips = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-cb511035"]]);
110
110
  module.exports = pChips;
@@ -74,6 +74,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
74
74
  size: _ctx.size
75
75
  }, _ctx.$attrs, {
76
76
  role: "searchbox",
77
+ rounded: "",
77
78
  onFocus: _cache[2] || (_cache[2] = ($event) => _ctx.showEnterIconOnFocus = true),
78
79
  onFocusout: _cache[3] || (_cache[3] = ($event) => _ctx.showEnterIconOnFocus = false),
79
80
  onKeydown: vue.withKeys(_ctx.keydownEnter, ["enter"])
@@ -106,5 +107,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
106
107
  _: 1
107
108
  }, 16, ["modelValue", "size", "onKeydown"]);
108
109
  }
109
- const PInputSearch = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-3de99c69"]]);
110
+ const PInputSearch = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-7a1e1e82"]]);
110
111
  module.exports = PInputSearch;
@@ -30,6 +30,10 @@ const _sfc_main = vue.defineComponent({
30
30
  required: {
31
31
  type: Boolean,
32
32
  default: false
33
+ },
34
+ rounded: {
35
+ type: Boolean,
36
+ default: false
33
37
  }
34
38
  },
35
39
  emits: ["update:modelValue"],
@@ -3,7 +3,7 @@ const pInfoIcon = require("./p-info-icon.js");
3
3
  const pTableFilterIcon = require("./p-table-filter-icon.js");
4
4
  const vue = require("vue");
5
5
  const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
6
- const DEFAULT_CLASSES = `text-xs leading-5 font-bold uppercase truncate shrink`;
6
+ const DEFAULT_CLASSES = `text-xs leading-5 font-semibold truncate shrink`;
7
7
  const _sfc_main = vue.defineComponent({
8
8
  name: "PTableHeaderCell",
9
9
  components: {
@@ -30,6 +30,10 @@ const _sfc_main = vue.defineComponent({
30
30
  tooltipText: {
31
31
  type: String,
32
32
  default: ""
33
+ },
34
+ textColor: {
35
+ type: String,
36
+ default: ""
33
37
  }
34
38
  },
35
39
  emits: ["click-filter-icon"],
@@ -37,6 +41,19 @@ const _sfc_main = vue.defineComponent({
37
41
  return {
38
42
  DEFAULT_CLASSES
39
43
  };
44
+ },
45
+ computed: {
46
+ textColorClass() {
47
+ return this.filterActive ? "text-active-blue" : this.textColor ? "" : "text-p-gray-60";
48
+ },
49
+ style() {
50
+ if (this.filterActive) {
51
+ return {};
52
+ }
53
+ return {
54
+ color: this.textColor
55
+ };
56
+ }
40
57
  }
41
58
  });
42
59
  const _hoisted_1 = { class: "flex items-center overflow-hidden" };
@@ -50,14 +67,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
50
67
  const _component_PTableFilterIcon = vue.resolveComponent("PTableFilterIcon");
51
68
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
52
69
  vue.createElementVNode("div", {
53
- class: vue.normalizeClass([
54
- _ctx.DEFAULT_CLASSES,
55
- _ctx.textClass,
56
- _ctx.filterActive ? "text-active-blue" : "text-p-purple-60",
57
- { "mr-auto": !_ctx.tooltipText }
58
- ]),
70
+ class: vue.normalizeClass([_ctx.DEFAULT_CLASSES, _ctx.textClass, _ctx.textColorClass, { "mr-auto": !_ctx.tooltipText }]),
71
+ style: vue.normalizeStyle(_ctx.style),
59
72
  title: _ctx.text
60
- }, vue.toDisplayString(_ctx.text), 11, _hoisted_2),
73
+ }, vue.toDisplayString(_ctx.text), 15, _hoisted_2),
61
74
  _ctx.tooltipText ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
62
75
  _ctx.tooltipText ? (vue.openBlock(), vue.createBlock(_component_PInfoIcon, {
63
76
  key: 0,
@@ -2,7 +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-50608a90"), n = n(), vue.popScopeId(), n);
5
+ const _withScopeId = (n) => (vue.pushScopeId("data-v-09e6d191"), n = n(), vue.popScopeId(), n);
6
6
  const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "dropdown-anchor" }, null, -1));
7
7
  const _hoisted_2 = {
8
8
  key: 0,
@@ -29,7 +29,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
29
29
  const tdClass = vue.computed(() => {
30
30
  const res = [
31
31
  // Common classes for all cells
32
- "p-0 h-full text-sm"
32
+ "p-0 h-full font-normal text-p-gray-60 text-sm "
33
33
  ];
34
34
  if (props.isEditable) {
35
35
  res.push("cursor-pointer");
@@ -40,17 +40,17 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
40
40
  } else if (isLastColFixed.value && isLastCol.value) {
41
41
  res.push("td-col-fixed-border-b", "last:sticky last:right-0 last:z-10");
42
42
  } else {
43
- res.push("border-b border-p-gray-30");
43
+ res.push("border-b border-p-gray-30 border-r border-r-p-blue-10");
44
44
  }
45
45
  if (props.isSelected) {
46
46
  res.push("bg-p-blue-15 group-hover/row:bg-p-blue-15");
47
47
  } else {
48
- res.push("bg-white group-hover/row:bg-p-blue-10");
48
+ res.push("bg-white group-hover/row:bg-p-gray-10");
49
49
  }
50
50
  return res;
51
51
  });
52
52
  const innerDivClass = vue.computed(() => {
53
- const res = ["py-2"];
53
+ const res = [];
54
54
  const currentColIsFirstColFixed = isFirstColFixed.value && isFirstCol.value;
55
55
  const currentColIsLastColFixed = isLastColFixed.value && isLastCol.value;
56
56
  if (!currentColIsFirstColFixed && !currentColIsLastColFixed) {
@@ -84,5 +84,5 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
84
84
  };
85
85
  }
86
86
  });
87
- const pTableTd = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-50608a90"]]);
87
+ const pTableTd = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-09e6d191"]]);
88
88
  module.exports = pTableTd;
@@ -3,7 +3,7 @@ const inputClassesMixin = require("./inputClassesMixin.js");
3
3
  const vue = require("vue");
4
4
  const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
5
5
  const TOGGLE_SIZES = {
6
- sm: `w-9 h-5 after:top-[2px] after:left-[2px] after:h-4 after:w-4`,
6
+ sm: `w-7 h-4 after:top-[2px] after:left-[2px] after:h-3 after:w-3`,
7
7
  md: `w-11 h-6 after:top-[2px] after:left-[2px] after:h-5 after:w-5`,
8
8
  lg: `w-[52px] h-7 after:top-0.5 after:left-[2px] after:h-6 after:w-6`
9
9
  };
@@ -110,5 +110,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
110
110
  ])
111
111
  ], 14, _hoisted_1);
112
112
  }
113
- const pToggle = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-e222188e"]]);
113
+ const pToggle = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-3a6de4eb"]]);
114
114
  module.exports = pToggle;
@@ -7,16 +7,17 @@ const defaults = {
7
7
  errorMsg: vue.ref(""),
8
8
  required: vue.ref(false),
9
9
  prefix: vue.ref(false),
10
- suffix: vue.ref(false)
10
+ suffix: vue.ref(false),
11
+ rounded: vue.ref(false)
11
12
  };
12
13
  function useInputClasses(props) {
13
14
  const opts = { ...defaults, ...vue.toRefs(props) };
14
- const { size, errorMsg, required, prefix, suffix } = opts;
15
+ const { size, errorMsg, required, rounded, prefix, suffix } = opts;
15
16
  const inputClasses = vue.computed(() => {
16
17
  const base = `${inputClassesShared.INPUT_BASE} ${inputClassesShared.INPUT_SIZES[size.value]}`;
17
18
  const spacingLeft = prefix.value ? inputClassesShared.SPACING_PREFIX[size.value] : inputClassesShared.SPACING_LEFT[size.value];
18
19
  const spacingRight = suffix.value ? inputClassesShared.SPACING_SUFFIX[size.value] : inputClassesShared.SPACING_RIGHT[size.value];
19
- const res = `${base} ${spacingLeft} ${spacingRight} ${errorMsg.value ? inputClassesShared.INPUT_ERROR : inputClassesShared.INPUT_NORMAL}`;
20
+ const res = `${base} ${spacingLeft} ${spacingRight} ${errorMsg.value ? inputClassesShared.INPUT_ERROR : inputClassesShared.INPUT_NORMAL}${rounded.value ? " rounded-full" : ""}`;
20
21
  return res;
21
22
  });
22
23
  const labelClasses = vue.computed(() => {
@@ -1,9 +1,13 @@
1
- import { defineComponent, openBlock, createElementBlock, createElementVNode, Fragment, renderList, createVNode, normalizeClass } from "vue";
1
+ import { defineComponent, openBlock, createElementBlock, createElementVNode, Fragment, renderList, createVNode, createCommentVNode, normalizeClass } from "vue";
2
2
  import PSkeletonLoader from "../p-skeleton-loader.js";
3
- const _hoisted_1 = { class: "block overflow-hidden border border-p-gray-30" };
3
+ const _hoisted_1 = { class: "block overflow-hidden border border-p-gray-30 bg-surface" };
4
4
  const _hoisted_2 = { class: "mb-0 w-full bg-surface" };
5
5
  const _hoisted_3 = { class: "relative border-b border-p-gray-30 px-4 py-2" };
6
- const _hoisted_4 = { class: "skeleton-fade" };
6
+ const _hoisted_4 = {
7
+ key: 0,
8
+ class: "h-4 w-full border-b border-b-p-gray-20 bg-p-gray-10"
9
+ };
10
+ const _hoisted_5 = { class: "skeleton-fade" };
7
11
  const _sfc_main = /* @__PURE__ */ defineComponent({
8
12
  ...{
9
13
  name: "PTableLoader"
@@ -25,6 +29,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
25
29
  tdSkeletonClasses: {
26
30
  type: String,
27
31
  default: "h-5"
32
+ },
33
+ withSubheader: {
34
+ type: Boolean,
35
+ default: false
28
36
  }
29
37
  },
30
38
  setup(__props) {
@@ -40,12 +48,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
40
48
  }, [
41
49
  createElementVNode("div", _hoisted_3, [
42
50
  createVNode(PSkeletonLoader, { class: "h-5" })
43
- ])
51
+ ]),
52
+ __props.withSubheader ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("", true)
44
53
  ]);
45
54
  }), 128))
46
55
  ])
47
56
  ]),
48
- createElementVNode("tbody", _hoisted_4, [
57
+ createElementVNode("tbody", _hoisted_5, [
49
58
  (openBlock(true), createElementBlock(Fragment, null, renderList(Number(__props.rows), (i) => {
50
59
  return openBlock(), createElementBlock("tr", { key: i }, [
51
60
  (openBlock(true), createElementBlock(Fragment, null, renderList(Number(__props.columns), (col) => {
package/dist/es/index.js CHANGED
@@ -653,6 +653,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
653
653
  isFirstColFixed: { type: Boolean, default: false },
654
654
  isLastColFixed: { type: Boolean, default: false },
655
655
  lockScroll: { type: Boolean, default: false },
656
+ subheader: { type: Boolean, default: false },
656
657
  virtualizer: { default: () => ({
657
658
  paddingTop: 0,
658
659
  paddingBottom: 0
@@ -700,11 +701,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
700
701
  const emitScroll = (e) => {
701
702
  emit("scroll", e);
702
703
  };
703
- const thDivClasses = (i, col) => {
704
+ const thDivClasses = (i) => {
704
705
  const res = ["relative", "py-2"];
705
- if (!col.borderColor) {
706
- res.push("border-b border-p-gray-30");
707
- }
706
+ res.push("border-b border-p-gray-30");
708
707
  if (i === 0 && props.isFirstColFixed || i === props.cols.length - 1 && props.isLastColFixed) {
709
708
  res.push("th-shadow px-4");
710
709
  } else {
@@ -712,6 +711,36 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
712
711
  }
713
712
  return res;
714
713
  };
714
+ const thSubheaderClasses = (i) => {
715
+ const res = [
716
+ "flex",
717
+ "h-6",
718
+ "items-center",
719
+ "border-b",
720
+ "border-b-p-gray-20",
721
+ "bg-p-gray-10",
722
+ "px-2",
723
+ "text-xs",
724
+ "font-medium",
725
+ "text-p-gray-40"
726
+ ];
727
+ if (i === 0 && props.isFirstColFixed || i === props.cols.length - 1 && props.isLastColFixed) {
728
+ res.push("th-shadow");
729
+ }
730
+ return res;
731
+ };
732
+ const bgColorStyle = (col) => {
733
+ if (col.borderColor) {
734
+ return { backgroundColor: col.borderColor + "33" };
735
+ }
736
+ return {};
737
+ };
738
+ const headerCellTextColor = (col) => {
739
+ if (col.borderColor) {
740
+ return `color-mix(in srgb, ${col.borderColor} 100%, #000000 20%)`;
741
+ }
742
+ return "";
743
+ };
715
744
  onMounted(() => {
716
745
  var _a;
717
746
  (_a = scrollWrapper.value) == null ? void 0 : _a.addEventListener("scroll", emitScroll, true);
@@ -730,7 +759,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
730
759
  return openBlock(), createElementBlock("div", {
731
760
  ref_key: "scrollWrapper",
732
761
  ref: scrollWrapper,
733
- class: normalizeClass(["block border border-p-gray-30", _ctx.lockScroll ? "overflow-hidden" : "overflow-x-auto"])
762
+ class: normalizeClass(["block rounded-xl border border-p-gray-30", _ctx.lockScroll ? "overflow-hidden" : "overflow-x-auto"])
734
763
  }, [
735
764
  unref(isColResizing) ? (openBlock(), createElementBlock("div", {
736
765
  key: 0,
@@ -762,7 +791,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
762
791
  class: "bg-surface"
763
792
  }), [
764
793
  createElementVNode("div", {
765
- class: normalizeClass(thDivClasses(i, col))
794
+ class: normalizeClass(thDivClasses(i)),
795
+ style: normalizeStyle(bgColorStyle(col))
766
796
  }, [
767
797
  createElementVNode("div", _hoisted_2$1, [
768
798
  renderSlot(_ctx.$slots, `prepend-header-cell-${unref(kebabCase)(col.name)}`, { col }, void 0, true),
@@ -771,23 +801,26 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
771
801
  "filter-active": col.filterActive,
772
802
  "show-filter-icon": col.filterable || col.sortable,
773
803
  "tooltip-text": col.tooltip,
774
- class: [{ "pl-2": i === 1 && _ctx.isFirstColFixed, "pr-2": i === _ctx.cols.length && _ctx.isLastColFixed }, "grow"]
804
+ class: [{ "pl-2": i === 1 && _ctx.isFirstColFixed, "pr-2": i === _ctx.cols.length && _ctx.isLastColFixed }, "grow"],
805
+ "text-color": headerCellTextColor(col)
775
806
  }, col.headerCellAttrs, {
776
807
  onClickFilterIcon: ($event) => _ctx.$emit("click-filter-icon", $event, col)
777
- }), null, 16, ["text", "filter-active", "show-filter-icon", "tooltip-text", "class", "onClickFilterIcon"])
808
+ }), null, 16, ["text", "filter-active", "show-filter-icon", "tooltip-text", "class", "text-color", "onClickFilterIcon"])
778
809
  ]),
779
810
  _ctx.colsResizable && i !== 0 && !(i === _ctx.cols.length - 1 && _ctx.isLastColFixed) ? (openBlock(), createElementBlock("div", {
780
811
  key: 0,
781
- class: normalizeClass(["absolute bottom-0 right-0 h-full w-2 cursor-col-resize after:absolute after:bottom-2 after:z-20 after:block after:h-5 after:w-px after:cursor-col-resize after:bg-p-gray-30", i === _ctx.cols.length - 1 ? " after:right-0" : " after:right-1"]),
812
+ class: normalizeClass(["absolute bottom-2 right-0 z-110 h-5 w-2 cursor-col-resize after:absolute after:bottom-0 after:z-110 after:block after:h-full after:w-2 after:cursor-col-resize after:border-r-2 after:border-dashed after:border-p-gray-30", i === _ctx.cols.length - 1 ? " after:right-0.5" : " after:right-0"]),
782
813
  "data-resize-handle": "",
783
814
  onMousedown: ($event) => unref(colResizeStart)($event, i),
784
815
  onDblclick: ($event) => unref(colResizeFitToData)(i)
785
- }, null, 42, _hoisted_3$1)) : createCommentVNode("", true),
786
- createElementVNode("div", {
787
- class: normalizeClass(["absolute bottom-0 h-1 w-full", _ctx.colsResizable ? "-left-1" : "left-0"]),
788
- style: normalizeStyle({ background: col.borderColor })
789
- }, null, 6)
790
- ], 2)
816
+ }, null, 42, _hoisted_3$1)) : createCommentVNode("", true)
817
+ ], 6),
818
+ _ctx.subheader ? (openBlock(), createElementBlock("div", {
819
+ key: 0,
820
+ class: normalizeClass(thSubheaderClasses(i))
821
+ }, [
822
+ renderSlot(_ctx.$slots, `subheader-cell-${unref(kebabCase)(col.name)}`, {}, void 0, true)
823
+ ], 2)) : createCommentVNode("", true)
791
824
  ], 16, _hoisted_1$1);
792
825
  }), 128)),
793
826
  _ctx.colsResizable && !_ctx.isLastColFixed ? (openBlock(), createElementBlock("th", _hoisted_4$1)) : createCommentVNode("", true)
@@ -811,7 +844,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
811
844
  };
812
845
  }
813
846
  });
814
- const pTable = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-170d774b"]]);
847
+ const pTable = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-6b61498d"]]);
815
848
  const _sfc_main = defineComponent({
816
849
  name: "PTableSort",
817
850
  props: {
@@ -16,6 +16,10 @@ const inputClassesMixin = defineComponent({
16
16
  required: {
17
17
  type: Boolean,
18
18
  default: false
19
+ },
20
+ rounded: {
21
+ type: Boolean,
22
+ default: false
19
23
  }
20
24
  },
21
25
  data() {
@@ -28,7 +32,7 @@ const inputClassesMixin = defineComponent({
28
32
  const base = `${INPUT_BASE} ${INPUT_SIZES[this.size]}`;
29
33
  const spacingLeft = this.$slots.prefix ? SPACING_PREFIX[this.size] : SPACING_LEFT[this.size];
30
34
  const spacingRight = this.$slots.suffix ? SPACING_SUFFIX[this.size] : SPACING_RIGHT[this.size];
31
- const res = `${base} ${spacingLeft} ${spacingRight} ${this.errorMsg ? INPUT_ERROR : INPUT_NORMAL}`;
35
+ const res = `${base} ${spacingLeft} ${spacingRight} ${this.errorMsg ? INPUT_ERROR : INPUT_NORMAL}${this.rounded ? " rounded-full" : ""}`;
32
36
  return res;
33
37
  },
34
38
  labelClasses() {
@@ -63,7 +63,7 @@ const _sfc_main = defineComponent({
63
63
  }
64
64
  }
65
65
  });
66
- const _withScopeId = (n) => (pushScopeId("data-v-40bc335f"), n = n(), popScopeId(), n);
66
+ const _withScopeId = (n) => (pushScopeId("data-v-cb511035"), n = n(), popScopeId(), n);
67
67
  const _hoisted_1 = {
68
68
  ref: "filterChipsRow",
69
69
  class: "flex w-full items-center"
@@ -71,7 +71,7 @@ const _hoisted_1 = {
71
71
  const _hoisted_2 = { ref: "beforeSlotContainer" };
72
72
  const _hoisted_3 = {
73
73
  ref: "filterChipsRowInner",
74
- class: "flex divide-x divide-p-blue-30 overflow-hidden rounded-md border border-p-blue-30 text-xs font-medium text-p-purple-60"
74
+ class: "flex divide-x divide-p-blue-30 overflow-hidden rounded-md border border-p-blue-30 bg-transparent text-xs font-medium leading-4 text-p-purple-60"
75
75
  };
76
76
  const _hoisted_4 = ["onClick"];
77
77
  const _hoisted_5 = { class: "inline-block truncate" };
@@ -105,7 +105,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
105
105
  ], 512)
106
106
  ], 512);
107
107
  }
108
- const pChips = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-40bc335f"]]);
108
+ const pChips = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-cb511035"]]);
109
109
  export {
110
110
  pChips as default
111
111
  };
@@ -73,6 +73,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
73
73
  size: _ctx.size
74
74
  }, _ctx.$attrs, {
75
75
  role: "searchbox",
76
+ rounded: "",
76
77
  onFocus: _cache[2] || (_cache[2] = ($event) => _ctx.showEnterIconOnFocus = true),
77
78
  onFocusout: _cache[3] || (_cache[3] = ($event) => _ctx.showEnterIconOnFocus = false),
78
79
  onKeydown: withKeys(_ctx.keydownEnter, ["enter"])
@@ -105,7 +106,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
105
106
  _: 1
106
107
  }, 16, ["modelValue", "size", "onKeydown"]);
107
108
  }
108
- const PInputSearch = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-3de99c69"]]);
109
+ const PInputSearch = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-7a1e1e82"]]);
109
110
  export {
110
111
  PInputSearch as default
111
112
  };
@@ -29,6 +29,10 @@ const _sfc_main = defineComponent({
29
29
  required: {
30
30
  type: Boolean,
31
31
  default: false
32
+ },
33
+ rounded: {
34
+ type: Boolean,
35
+ default: false
32
36
  }
33
37
  },
34
38
  emits: ["update:modelValue"],