@pequity/squirrel 6.0.11 → 6.0.13

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 (78) hide show
  1. package/dist/cjs/chunks/index.js +2645 -0
  2. package/dist/cjs/chunks/p-btn.types.js +3 -0
  3. package/dist/cjs/chunks/p-info-icon.js +37 -0
  4. package/dist/cjs/chunks/p-select.js +2 -2
  5. package/dist/cjs/index.js +25 -33
  6. package/dist/cjs/inputClasses.js +127 -0
  7. package/dist/cjs/inputClassesMixin.js +23 -19
  8. package/dist/cjs/p-btn.js +56 -57
  9. package/dist/cjs/p-icon.js +6 -1
  10. package/dist/cjs/p-info-icon.js +2 -33
  11. package/dist/cjs/p-input-number.js +2 -2
  12. package/dist/cjs/p-input-search.js +3 -3
  13. package/dist/cjs/p-table-header-cell.js +2 -2
  14. package/dist/cjs/useInputClasses.js +19 -18
  15. package/dist/es/chunks/index.js +2646 -0
  16. package/dist/es/chunks/p-btn.types.js +4 -0
  17. package/dist/es/chunks/p-info-icon.js +38 -0
  18. package/dist/es/chunks/p-select.js +2 -2
  19. package/dist/es/index.js +74 -82
  20. package/dist/es/inputClasses.js +127 -0
  21. package/dist/es/inputClassesMixin.js +23 -19
  22. package/dist/es/p-btn.js +56 -57
  23. package/dist/es/p-icon.js +6 -1
  24. package/dist/es/p-info-icon.js +2 -33
  25. package/dist/es/p-input-number.js +2 -2
  26. package/dist/es/p-input-search.js +3 -3
  27. package/dist/es/p-table-header-cell.js +2 -2
  28. package/dist/es/useInputClasses.js +23 -22
  29. package/dist/squirrel/components/p-alert/p-alert.vue.d.ts +1 -1
  30. package/dist/squirrel/components/p-btn/p-btn.types.d.ts +2 -1
  31. package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +395 -17
  32. package/dist/squirrel/components/p-drawer/p-drawer.vue.d.ts +5 -5
  33. package/dist/squirrel/components/p-dropdown-select/p-dropdown-select.vue.d.ts +30 -22
  34. package/dist/squirrel/components/p-icon/p-icon.types.d.ts +5 -0
  35. package/dist/squirrel/components/p-input/p-input.vue.d.ts +11 -7
  36. package/dist/squirrel/components/p-input-number/p-input-number.vue.d.ts +11 -7
  37. package/dist/squirrel/components/p-input-percent/p-input-percent.vue.d.ts +3 -3
  38. package/dist/squirrel/components/p-input-search/p-input-search.vue.d.ts +16 -12
  39. package/dist/squirrel/components/p-select/p-select.vue.d.ts +5 -5
  40. package/dist/squirrel/components/p-select-list/p-select-list.vue.d.ts +30 -22
  41. package/dist/squirrel/components/p-textarea/p-textarea.vue.d.ts +11 -7
  42. package/dist/squirrel/components/p-toggle/p-toggle.vue.d.ts +11 -7
  43. package/dist/squirrel/composables/useInputClasses.d.ts +3 -3
  44. package/dist/squirrel/index.d.ts +1 -0
  45. package/dist/squirrel/utils/index.d.ts +2 -2
  46. package/dist/squirrel/utils/inputClasses.d.ts +938 -0
  47. package/dist/squirrel/utils/inputClassesMixin.d.ts +12 -8
  48. package/dist/squirrel.css +23 -23
  49. package/package.json +24 -21
  50. package/squirrel/components/p-btn/p-btn.spec.js +1 -1
  51. package/squirrel/components/p-btn/p-btn.types.ts +3 -1
  52. package/squirrel/components/p-btn/p-btn.vue +60 -74
  53. package/squirrel/components/p-dropdown/p-dropdown.vue +2 -2
  54. package/squirrel/components/p-file-upload/p-file-upload.spec.js +3 -8
  55. package/squirrel/components/p-icon/p-icon.types.ts +5 -0
  56. package/squirrel/components/p-info-icon/p-info-icon.spec.js +3 -2
  57. package/squirrel/components/p-info-icon/p-info-icon.vue +3 -7
  58. package/squirrel/components/p-inline-date-picker/p-inline-date-picker.spec.js +3 -10
  59. package/squirrel/components/p-input/p-input.spec.js +3 -8
  60. package/squirrel/components/p-input-number/p-input-number.spec.js +15 -18
  61. package/squirrel/components/p-input-percent/p-input-percent.spec.js +3 -8
  62. package/squirrel/components/p-input-percent/p-input-percent.vue +3 -3
  63. package/squirrel/components/p-input-search/p-input-search.vue +4 -4
  64. package/squirrel/components/p-select/p-select.spec.js +27 -33
  65. package/squirrel/components/p-select/p-select.vue +4 -4
  66. package/squirrel/components/p-table-header-cell/p-table-header-cell.spec.js +6 -4
  67. package/squirrel/components/p-textarea/p-textarea.spec.js +3 -8
  68. package/squirrel/composables/useInputClasses.spec.js +138 -77
  69. package/squirrel/composables/useInputClasses.ts +25 -39
  70. package/squirrel/index.ts +1 -0
  71. package/squirrel/utils/index.ts +3 -36
  72. package/squirrel/utils/inputClasses.ts +128 -0
  73. package/squirrel/utils/inputClassesMixin.spec.js +153 -64
  74. package/squirrel/utils/inputClassesMixin.ts +26 -43
  75. package/dist/cjs/inputClassesShared.js +0 -76
  76. package/dist/es/inputClassesShared.js +0 -76
  77. package/dist/squirrel/utils/inputClassesShared.d.ts +0 -45
  78. package/squirrel/utils/inputClassesShared.ts +0 -75
@@ -0,0 +1,4 @@
1
+ const SIZES = ["sm", "md", "lg"];
2
+ export {
3
+ SIZES as S
4
+ };
@@ -0,0 +1,38 @@
1
+ import { defineComponent, resolveComponent, createBlock, openBlock, withCtx, createVNode, renderSlot, createTextVNode, toDisplayString } from "vue";
2
+ import { _ as _sfc_main$1 } from "./p-icon.js";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ ...{
5
+ name: "PInfoIcon"
6
+ },
7
+ __name: "p-info-icon",
8
+ props: {
9
+ text: { default: null }
10
+ },
11
+ setup(__props) {
12
+ return (_ctx, _cache) => {
13
+ const _component_VTooltip = resolveComponent("VTooltip");
14
+ return openBlock(), createBlock(_component_VTooltip, {
15
+ "popper-triggers": ["hover"],
16
+ delay: { show: 750, hide: 0 },
17
+ disabled: !_ctx.$slots.default && !_ctx.text
18
+ }, {
19
+ popper: withCtx(() => [
20
+ renderSlot(_ctx.$slots, "default", {}, () => [
21
+ createTextVNode(toDisplayString(_ctx.text), 1)
22
+ ])
23
+ ]),
24
+ default: withCtx(() => [
25
+ createVNode(_sfc_main$1, {
26
+ icon: "info",
27
+ class: "block h-3 w-3",
28
+ width: "12"
29
+ })
30
+ ]),
31
+ _: 3
32
+ }, 8, ["disabled"]);
33
+ };
34
+ }
35
+ });
36
+ export {
37
+ _sfc_main as _
38
+ };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, useAttrs, computed, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, renderSlot, createElementVNode, withDirectives, createCommentVNode, toDisplayString, mergeProps, Fragment, renderList, vShow } from "vue";
2
+ import { S as SIZES } from "./p-btn.types.js";
2
3
  import { useInputClasses } from "../useInputClasses.js";
3
- import { INPUT_SIZES } from "../inputClassesShared.js";
4
4
  const _hoisted_1 = ["data-has-error"];
5
5
  const _hoisted_2 = ["value"];
6
6
  const _hoisted_3 = ["value"];
@@ -36,7 +36,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36
36
  type: String,
37
37
  default: "md",
38
38
  validator(value) {
39
- return Object.keys(INPUT_SIZES).includes(value);
39
+ return SIZES.includes(value);
40
40
  }
41
41
  },
42
42
  itemText: {
package/dist/es/index.js CHANGED
@@ -19,52 +19,53 @@ import { useToast } from "vue-toastification";
19
19
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
20
20
  import { P_ICON_ALIASES } from "./p-icon.js";
21
21
  import { _ as _4 } from "./chunks/p-icon.js";
22
- import { default as default10 } from "./p-info-icon.js";
23
- import { _ as _5 } from "./chunks/p-inline-date-picker.js";
24
- import { default as default11 } from "./p-input.js";
25
- import { default as default12 } from "./p-input-number.js";
26
- import { _ as _6 } from "./chunks/p-input-percent.js";
22
+ import { _ as _5 } from "./chunks/p-info-icon.js";
23
+ import { _ as _6 } from "./chunks/p-inline-date-picker.js";
24
+ import { default as default10 } from "./p-input.js";
25
+ import { default as default11 } from "./p-input-number.js";
26
+ import { _ as _7 } from "./chunks/p-input-percent.js";
27
27
  import PInputSearch from "./p-input-search.js";
28
- import { _ as _7 } from "./chunks/p-link.js";
29
- import { default as default13 } from "./p-loading.js";
28
+ import { _ as _8 } from "./chunks/p-link.js";
29
+ import { default as default12 } from "./p-loading.js";
30
30
  import { usePLoading } from "./usePLoading.js";
31
- import { default as default14 } from "./p-modal.js";
31
+ import { default as default13 } from "./p-modal.js";
32
32
  import { usePModal } from "./usePModal.js";
33
- import { _ as _8 } from "./chunks/p-pagination.js";
34
- import { _ as _9 } from "./chunks/p-pagination-info.js";
35
- import { default as default15 } from "./p-progress-bar.js";
36
- import { _ as _10 } from "./chunks/p-ring-loader.js";
37
- import { _ as _11 } from "./chunks/p-select.js";
38
- import { _ as _12 } from "./chunks/p-select-btn.js";
33
+ import { _ as _9 } from "./chunks/p-pagination.js";
34
+ import { _ as _10 } from "./chunks/p-pagination-info.js";
35
+ import { default as default14 } from "./p-progress-bar.js";
36
+ import { _ as _11 } from "./chunks/p-ring-loader.js";
37
+ import { _ as _12 } from "./chunks/p-select.js";
38
+ import { _ as _13 } from "./chunks/p-select-btn.js";
39
39
  import { SIZES } from "./p-select-list.js";
40
40
  import { useSelectList } from "./useSelectList.js";
41
41
  import { toString } from "./string.js";
42
42
  import { splitStringForHighlight } from "./text.js";
43
- import { default as default16 } from "./p-select-pill.js";
44
- import { default as default17 } from "./p-skeleton-loader.js";
43
+ import { default as default15 } from "./p-select-pill.js";
44
+ import { default as default16 } from "./p-skeleton-loader.js";
45
45
  import { colsInjectionKey, isFirstColFixedInjectionKey, isLastColFixedInjectionKey, isColsResizableInjectionKey } from "./p-table.js";
46
46
  import { MIN_WIDTH_COL_RESIZE } from "./p-table.js";
47
47
  import { usePTableColResize } from "./usePTableColResize.js";
48
48
  import PTableHeaderCell from "./p-table-header-cell.js";
49
49
  import { usePTableRowVirtualizer } from "./usePTableRowVirtualizer.js";
50
- import { default as default18 } from "./p-table-filter-icon.js";
51
- import { _ as _13 } from "./chunks/p-table-loader.js";
50
+ import { default as default17 } from "./p-table-filter-icon.js";
51
+ import { _ as _14 } from "./chunks/p-table-loader.js";
52
52
  import { SORTING_TYPES } from "./p-table-sort.js";
53
- import { default as default19 } from "./p-table-td.js";
54
- import { _ as _14 } from "./chunks/p-tabs.js";
55
- import { default as default20 } from "./p-textarea.js";
56
- import { default as default21 } from "./p-toggle.js";
53
+ import { default as default18 } from "./p-table-td.js";
54
+ import { _ as _15 } from "./chunks/p-tabs.js";
55
+ import { default as default19 } from "./p-textarea.js";
56
+ import { default as default20 } from "./p-toggle.js";
57
57
  import { squirrelTailwindConfig } from "./config.js";
58
+ import { S } from "./chunks/p-btn.types.js";
58
59
  import { CURRENCY_INPUT_DEFAULTS } from "./currency.js";
59
60
  import { getNextActiveElement, isElement, isVisible } from "./dom.js";
60
- import { default as default22 } from "./inputClassesMixin.js";
61
- import { ERROR_MSG, INPUT_BASE, INPUT_ERROR, INPUT_NORMAL, INPUT_SIZES, LABEL_BASE, LABEL_REQUIRED, LABEL_SIZES, SELECT_ARROW, SELECT_BASE, SELECT_SIZES, SPACING_LEFT, SPACING_PREFIX, SPACING_RIGHT, SPACING_SUFFIX, TEXTAREA_BASE } from "./inputClassesShared.js";
61
+ import { default as default21 } from "./inputClassesMixin.js";
62
62
  import { setupListKeyboardNavigation } from "./listKeyboardNavigation.js";
63
63
  import { toNumberOrNull } from "./number.js";
64
64
  import { isObject } from "./object.js";
65
65
  import { createPagingRange } from "./pagination.js";
66
66
  import { sanitizeUrl } from "./sanitization.js";
67
67
  import { getColor, getColorDeep, getScreen } from "./tailwind.js";
68
+ import { M, N, f, i, c, x } from "./chunks/index.js";
68
69
  const _imports_0$1 = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.8335%206.25016L10.0002%202.0835L14.1668%206.25016'%20stroke='%23767189'%20stroke-width='1.25'%20/%3e%3cpath%20d='M10%202.0835V13.7502'%20stroke='%23767189'%20stroke-width='1.25'%20/%3e%3cpath%20d='M2.91675%2015V18.3333H17.0834V15'%20stroke='%23767189'%20stroke-width='1.25'%20/%3e%3c/svg%3e";
69
70
  const _imports_1$1 = "data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M33%2012H14V44H42V21L33%2012Z'%20stroke='%231A123B'%20stroke-width='3'%20/%3e%3cpath%20d='M9%2036H6V4H25L28%207'%20stroke='%231A123B'%20stroke-width='3'%20/%3e%3cpath%20d='M37%2030H19M28%2021V39'%20stroke='%231A123B'%20stroke-width='3'%20/%3e%3c/svg%3e";
70
71
  const _hoisted_1$3 = ["data-has-error"];
@@ -165,8 +166,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
165
166
  });
166
167
  const validateFiles = (filesToUpload) => {
167
168
  const res = [];
168
- for (let i = 0; i < filesToUpload.length; i++) {
169
- const file = filesToUpload[i];
169
+ for (let i2 = 0; i2 < filesToUpload.length; i2++) {
170
+ const file = filesToUpload[i2];
170
171
  const fileName = file.name || file.url;
171
172
  if (res.length + files.value.length >= props.maxNumberOfFiles) {
172
173
  toast.error(`You can only upload a maximum of ${props.maxNumberOfFiles} ${fileWord.value}.`);
@@ -198,11 +199,11 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
198
199
  };
199
200
  const uploadFile = (e) => {
200
201
  var _a, _b;
201
- const f = ((_a = e.target) == null ? void 0 : _a.files) || ((_b = e.dataTransfer) == null ? void 0 : _b.files);
202
- if (!f) {
202
+ const f2 = ((_a = e.target) == null ? void 0 : _a.files) || ((_b = e.dataTransfer) == null ? void 0 : _b.files);
203
+ if (!f2) {
203
204
  return;
204
205
  }
205
- const validatedFiles = props.fileTypes ? validateFiles(Array.from(f)) : f;
206
+ const validatedFiles = props.fileTypes ? validateFiles(Array.from(f2)) : f2;
206
207
  files.value = props.multiple ? [...files.value, ...validatedFiles] : validatedFiles;
207
208
  emit("file-added", validatedFiles);
208
209
  };
@@ -723,17 +724,17 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
723
724
  const emitScroll = (e) => {
724
725
  emit("scroll", e);
725
726
  };
726
- const thDivClasses = (i) => {
727
+ const thDivClasses = (i2) => {
727
728
  const res = ["relative", "py-2"];
728
729
  res.push("border-b border-p-gray-30");
729
- if (i === 0 && props.isFirstColFixed || i === props.cols.length - 1 && props.isLastColFixed) {
730
+ if (i2 === 0 && props.isFirstColFixed || i2 === props.cols.length - 1 && props.isLastColFixed) {
730
731
  res.push("th-shadow px-4");
731
732
  } else {
732
733
  !props.colsResizable ? res.push("px-2") : res.push("pl-2 pr-4");
733
734
  }
734
735
  return res;
735
736
  };
736
- const thSubheaderClasses = (i) => {
737
+ const thSubheaderClasses = (i2) => {
737
738
  const res = [
738
739
  "flex",
739
740
  "h-6",
@@ -746,7 +747,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
746
747
  "font-medium",
747
748
  "text-p-gray-40"
748
749
  ];
749
- if (i === 0 && props.isFirstColFixed || i === props.cols.length - 1 && props.isLastColFixed) {
750
+ if (i2 === 0 && props.isFirstColFixed || i2 === props.cols.length - 1 && props.isLastColFixed) {
750
751
  res.push("th-shadow");
751
752
  }
752
753
  return res;
@@ -805,10 +806,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
805
806
  }, toHandlers(_ctx.colsResizable ? { mousemove: unref(colResize) } : {}, true)), [
806
807
  createElementVNode("thead", null, [
807
808
  createElementVNode("tr", null, [
808
- (openBlock(true), createElementBlock(Fragment, null, renderList(props.cols, (col, i) => {
809
+ (openBlock(true), createElementBlock(Fragment, null, renderList(props.cols, (col, i2) => {
809
810
  return openBlock(), createElementBlock("th", mergeProps({
810
811
  ref_for: true,
811
- ref: (el) => updateThsRefs(el, i),
812
+ ref: (el) => updateThsRefs(el, i2),
812
813
  key: col.id,
813
814
  "data-col-id": col.id
814
815
  }, col.thAttrs, {
@@ -816,7 +817,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
816
817
  class: "bg-surface"
817
818
  }), [
818
819
  createElementVNode("div", {
819
- class: normalizeClass(thDivClasses(i)),
820
+ class: normalizeClass(thDivClasses(i2)),
820
821
  style: normalizeStyle(bgColorStyle(col))
821
822
  }, [
822
823
  createElementVNode("div", _hoisted_2$1, [
@@ -826,24 +827,24 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
826
827
  "filter-active": col.filterActive,
827
828
  "show-filter-icon": col.filterable || col.sortable,
828
829
  "tooltip-text": col.tooltip,
829
- class: [{ "pl-2": i === 1 && _ctx.isFirstColFixed, "pr-2": i === _ctx.cols.length && _ctx.isLastColFixed }, "grow"],
830
+ class: [{ "pl-2": i2 === 1 && _ctx.isFirstColFixed, "pr-2": i2 === _ctx.cols.length && _ctx.isLastColFixed }, "grow"],
830
831
  "text-color": headerCellTextColor(col),
831
832
  ref_for: true
832
833
  }, col.headerCellAttrs, {
833
834
  onClickFilterIcon: ($event) => _ctx.$emit("click-filter-icon", $event, col)
834
835
  }), null, 16, ["text", "filter-active", "show-filter-icon", "tooltip-text", "class", "text-color", "onClickFilterIcon"])
835
836
  ]),
836
- _ctx.colsResizable && i !== 0 && !(i === _ctx.cols.length - 1 && _ctx.isLastColFixed) ? (openBlock(), createElementBlock("div", {
837
+ _ctx.colsResizable && i2 !== 0 && !(i2 === _ctx.cols.length - 1 && _ctx.isLastColFixed) ? (openBlock(), createElementBlock("div", {
837
838
  key: 0,
838
- 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"]),
839
+ 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", i2 === _ctx.cols.length - 1 ? "after:right-0.5" : "after:right-0"]),
839
840
  "data-resize-handle": "",
840
- onMousedown: ($event) => unref(colResizeStart)($event, i),
841
- onDblclick: ($event) => unref(colResizeFitToData)(i)
841
+ onMousedown: ($event) => unref(colResizeStart)($event, i2),
842
+ onDblclick: ($event) => unref(colResizeFitToData)(i2)
842
843
  }, null, 42, _hoisted_3$1)) : createCommentVNode("", true)
843
844
  ], 6),
844
845
  _ctx.subheader ? (openBlock(), createElementBlock("div", {
845
846
  key: 0,
846
- class: normalizeClass(thSubheaderClasses(i))
847
+ class: normalizeClass(thSubheaderClasses(i2))
847
848
  }, [
848
849
  renderSlot(_ctx.$slots, `subheader-cell-${unref(kebabCase)(col.name)}`, {}, void 0, true)
849
850
  ], 2)) : createCommentVNode("", true)
@@ -955,14 +956,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
955
956
  const pTableSort = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
956
957
  export {
957
958
  CURRENCY_INPUT_DEFAULTS,
958
- ERROR_MSG,
959
- INPUT_BASE,
960
- INPUT_ERROR,
961
- INPUT_NORMAL,
962
- INPUT_SIZES,
963
- LABEL_BASE,
964
- LABEL_REQUIRED,
965
- LABEL_SIZES,
966
959
  MIN_WIDTH_COL_RESIZE,
967
960
  _ as PActionBar,
968
961
  default2 as PAlert,
@@ -977,51 +970,48 @@ export {
977
970
  default9 as PDropdown,
978
971
  a as PDropdownSelect,
979
972
  pFileUpload as PFileUpload,
980
- default18 as PFilterIcon,
973
+ default17 as PFilterIcon,
981
974
  _4 as PIcon,
982
- default10 as PInfoIcon,
983
- _5 as PInlineDatePicker,
984
- default11 as PInput,
985
- default12 as PInputNumber,
986
- _6 as PInputPercent,
975
+ _5 as PInfoIcon,
976
+ _6 as PInlineDatePicker,
977
+ default10 as PInput,
978
+ default11 as PInputNumber,
979
+ _7 as PInputPercent,
987
980
  PInputSearch,
988
- _7 as PLink,
989
- default13 as PLoading,
990
- default14 as PModal,
991
- _8 as PPagination,
992
- _9 as PPaginationInfo,
993
- default15 as PProgressBar,
994
- _10 as PRingLoader,
995
- _11 as PSelect,
996
- _12 as PSelectBtn,
981
+ _8 as PLink,
982
+ default12 as PLoading,
983
+ default13 as PModal,
984
+ _9 as PPagination,
985
+ _10 as PPaginationInfo,
986
+ default14 as PProgressBar,
987
+ _11 as PRingLoader,
988
+ _12 as PSelect,
989
+ _13 as PSelectBtn,
997
990
  _sfc_main$2 as PSelectList,
998
- default16 as PSelectPill,
999
- default17 as PSkeletonLoader,
991
+ default15 as PSelectPill,
992
+ default16 as PSkeletonLoader,
1000
993
  pTable as PTable,
1001
994
  PTableHeaderCell,
1002
- _13 as PTableLoader,
995
+ _14 as PTableLoader,
1003
996
  pTableSort as PTableSort,
1004
- default19 as PTableTd,
1005
- _14 as PTabs,
1006
- default20 as PTextarea,
1007
- default21 as PToggle,
997
+ default18 as PTableTd,
998
+ _15 as PTabs,
999
+ default19 as PTextarea,
1000
+ default20 as PToggle,
1008
1001
  P_ICON_ALIASES,
1009
- SELECT_ARROW,
1010
- SELECT_BASE,
1011
- SELECT_SIZES,
1002
+ S as SIZES,
1012
1003
  SORTING_TYPES,
1013
- SPACING_LEFT,
1014
- SPACING_PREFIX,
1015
- SPACING_RIGHT,
1016
- SPACING_SUFFIX,
1017
- TEXTAREA_BASE,
1004
+ M as cn,
1005
+ N as cnBase,
1018
1006
  colsInjectionKey,
1019
1007
  createPagingRange,
1008
+ f as createTV,
1009
+ i as defaultConfig,
1020
1010
  getColor,
1021
1011
  getColorDeep,
1022
1012
  getNextActiveElement,
1023
1013
  getScreen,
1024
- default22 as inputClassesMixin,
1014
+ default21 as inputClassesMixin,
1025
1015
  isColsResizableInjectionKey,
1026
1016
  isElement,
1027
1017
  isFirstColFixedInjectionKey,
@@ -1034,10 +1024,12 @@ export {
1034
1024
  squirrelTailwindConfig,
1035
1025
  toNumberOrNull,
1036
1026
  toString,
1027
+ c as tv,
1037
1028
  useInputClasses,
1038
1029
  usePLoading,
1039
1030
  usePModal,
1040
1031
  usePTableColResize,
1041
1032
  usePTableRowVirtualizer,
1042
- useSelectList
1033
+ useSelectList,
1034
+ x as voidEmpty
1043
1035
  };
@@ -0,0 +1,127 @@
1
+ import { c as ce } from "./chunks/index.js";
2
+ const inputClasses = ce({
3
+ slots: {
4
+ input: "w-full rounded border-0 bg-surface text-night ring-1 ring-inset ring-p-gray-30 placeholder:text-p-gray-40 hover:ring-primary focus:outline-none focus:ring-2 focus:ring-primary disabled:cursor-default disabled:bg-p-blue-10 disabled:ring-p-gray-30 disabled:hover:ring-p-gray-30",
5
+ label: "mb-1 block font-medium",
6
+ errorMessage: "mt-1 text-xs text-on-error"
7
+ },
8
+ variants: {
9
+ size: {
10
+ sm: {
11
+ input: "h-8 pl-3 pr-3 text-sm",
12
+ label: "text-xs"
13
+ },
14
+ md: {
15
+ input: "h-10 pl-4 pr-4 text-base",
16
+ label: "text-sm"
17
+ },
18
+ lg: {
19
+ input: "h-12 pl-5 pr-5 text-lg",
20
+ label: "text-base"
21
+ }
22
+ },
23
+ prefix: {
24
+ true: "pl-8"
25
+ },
26
+ suffix: {
27
+ true: "pr-6"
28
+ },
29
+ required: {
30
+ true: {
31
+ label: `after:text-on-error after:content-["_*"]`
32
+ }
33
+ },
34
+ error: {
35
+ true: {
36
+ input: "ring-on-error hover:ring-on-error focus:ring-on-error"
37
+ }
38
+ },
39
+ rounded: {
40
+ true: "rounded-full"
41
+ }
42
+ },
43
+ compoundVariants: [
44
+ {
45
+ size: "sm",
46
+ prefix: true,
47
+ class: {
48
+ input: "pl-6"
49
+ }
50
+ },
51
+ {
52
+ size: "md",
53
+ prefix: true,
54
+ class: {
55
+ input: "pl-8"
56
+ }
57
+ },
58
+ {
59
+ size: "lg",
60
+ prefix: true,
61
+ class: {
62
+ input: "pl-12"
63
+ }
64
+ },
65
+ {
66
+ size: "sm",
67
+ suffix: true,
68
+ class: {
69
+ input: "pr-6"
70
+ }
71
+ },
72
+ {
73
+ size: "md",
74
+ suffix: true,
75
+ class: {
76
+ input: "pr-8"
77
+ }
78
+ },
79
+ {
80
+ size: "lg",
81
+ suffix: true,
82
+ class: {
83
+ input: "pr-12"
84
+ }
85
+ }
86
+ ],
87
+ defaultVariants: {
88
+ size: "md"
89
+ }
90
+ });
91
+ const textareaClasses = ce({
92
+ extend: inputClasses,
93
+ slots: {
94
+ input: "resize-y overflow-auto px-3 py-3"
95
+ },
96
+ variants: {
97
+ size: {
98
+ md: {
99
+ input: "h-auto"
100
+ }
101
+ }
102
+ }
103
+ });
104
+ const selectClasses = ce({
105
+ extend: inputClasses,
106
+ slots: {
107
+ input: "squirrel-bg-chevron-down appearance-none truncate bg-no-repeat"
108
+ },
109
+ variants: {
110
+ size: {
111
+ sm: {
112
+ input: "bg-[right_0.675rem_center] pr-8"
113
+ },
114
+ md: {
115
+ input: "bg-[right_1rem_center] pr-10"
116
+ },
117
+ lg: {
118
+ input: "bg-[right_1.25rem_center] pr-12"
119
+ }
120
+ }
121
+ }
122
+ });
123
+ export {
124
+ inputClasses,
125
+ selectClasses,
126
+ textareaClasses
127
+ };
@@ -1,4 +1,5 @@
1
- import { TEXTAREA_BASE, SELECT_BASE, SELECT_ARROW, SELECT_SIZES, SPACING_RIGHT, LABEL_BASE, LABEL_SIZES, LABEL_REQUIRED, INPUT_BASE, INPUT_SIZES, SPACING_PREFIX, SPACING_LEFT, SPACING_SUFFIX, INPUT_ERROR, INPUT_NORMAL, ERROR_MSG } from "./inputClassesShared.js";
1
+ import { S as SIZES } from "./chunks/p-btn.types.js";
2
+ import { textareaClasses, selectClasses, inputClasses } from "./inputClasses.js";
2
3
  import { defineComponent } from "vue";
3
4
  const inputClassesMixin = defineComponent({
4
5
  props: {
@@ -6,7 +7,7 @@ const inputClassesMixin = defineComponent({
6
7
  type: String,
7
8
  default: "md",
8
9
  validator(value) {
9
- return Object.keys(INPUT_SIZES).includes(value);
10
+ return SIZES.includes(value);
10
11
  }
11
12
  },
12
13
  errorMsg: {
@@ -22,31 +23,34 @@ const inputClassesMixin = defineComponent({
22
23
  default: false
23
24
  }
24
25
  },
25
- data() {
26
- return {
27
- errorMsgClasses: ERROR_MSG
28
- };
29
- },
30
26
  computed: {
27
+ allClasses() {
28
+ const { input, label, errorMessage } = inputClasses({
29
+ size: this.size,
30
+ prefix: !!this.$slots.prefix,
31
+ suffix: !!this.$slots.suffix,
32
+ required: this.required,
33
+ error: !!this.errorMsg,
34
+ rounded: this.rounded
35
+ });
36
+ return { input: input(), label: label(), errorMessage: errorMessage() };
37
+ },
31
38
  inputClasses() {
32
- const base = `${INPUT_BASE} ${INPUT_SIZES[this.size]}`;
33
- const spacingLeft = this.$slots.prefix ? SPACING_PREFIX[this.size] : SPACING_LEFT[this.size];
34
- const spacingRight = this.$slots.suffix ? SPACING_SUFFIX[this.size] : SPACING_RIGHT[this.size];
35
- const res = `${base} ${spacingLeft} ${spacingRight} ${this.errorMsg ? INPUT_ERROR : INPUT_NORMAL}${this.rounded ? " rounded-full" : ""}`;
36
- return res;
39
+ return this.allClasses.input;
37
40
  },
38
41
  labelClasses() {
39
- const base = `${LABEL_BASE} ${LABEL_SIZES[this.size]}`;
40
- const res = this.required ? `${base} ${LABEL_REQUIRED}` : base;
41
- return res;
42
+ return this.allClasses.label;
43
+ },
44
+ errorMsgClasses() {
45
+ return this.allClasses.errorMessage;
42
46
  },
43
47
  selectClasses() {
44
- const res = `${this.inputClasses.replace(` ${SPACING_RIGHT[this.size]}`, "")} ${SELECT_BASE} ${SELECT_ARROW} ${SELECT_SIZES[this.size]}`;
45
- return res;
48
+ const { input } = selectClasses({ size: this.size, required: this.required, error: !!this.errorMsg });
49
+ return input();
46
50
  },
47
51
  textareaClasses() {
48
- const res = `${this.inputClasses} ${TEXTAREA_BASE}`;
49
- return res;
52
+ const { input } = textareaClasses({ required: this.required, error: !!this.errorMsg });
53
+ return input();
50
54
  }
51
55
  }
52
56
  });