@citruslime/ui 4.0.2 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,7 +9,7 @@ A Vue 3 library, written in TypeScript, which provides custom UI components.
9
9
  - 📖 [Documentation & API](https://uilibrary.citruslime.com)
10
10
  - 📌 [Citrus-Lime Ltd](https://www.citruslime.com)
11
11
 
12
- ## Install
12
+ ### Install
13
13
 
14
14
  `pnpm add @citruslime/ui`
15
15
 
@@ -1,5 +1,5 @@
1
1
  import { Icon } from "@iconify/vue";
2
- import { defineComponent, ref, createElementBlock, openBlock, renderSlot, normalizeProps, guardReactiveProps, Fragment, createElementVNode, normalizeClass, createVNode, unref, Transition, withCtx, withDirectives, mergeProps, vShow, createBlock, Teleport, renderList, toDisplayString, createCommentVNode, computed, createTextVNode, mergeModels, useModel, watch, createSlots, vModelDynamic, shallowRef, toValue, toRefs, withKeys, onMounted, onUnmounted, withModifiers, nextTick, useAttrs, resolveComponent, inject, vModelCheckbox, watchEffect, vModelText, useCssVars, toHandlers, normalizeStyle, isRef, useSlots, provide } from "vue";
2
+ import { defineComponent, ref, createElementBlock, openBlock, renderSlot, normalizeProps, guardReactiveProps, Fragment, createElementVNode, normalizeClass, createVNode, unref, Transition, withCtx, withDirectives, mergeProps, vShow, createBlock, Teleport, renderList, toDisplayString, createCommentVNode, computed, createTextVNode, mergeModels, useModel, watch, createSlots, vModelDynamic, shallowRef, toValue, toRefs, onBeforeUnmount, withKeys, onMounted, onUnmounted, withModifiers, nextTick, useAttrs, resolveComponent, inject, vModelCheckbox, watchEffect, vModelText, useCssVars, toHandlers, normalizeStyle, isRef, useSlots, provide } from "vue";
3
3
  import { generateStringId, highlightText, validateEmail as validateEmail$1, isTouchDevice, escapeStringForRegExp } from "@citruslime/utils";
4
4
  import { useFocusWithin, onKeyDown, toArray, unrefElement, tryOnScopeDispose, onClickOutside, useBreakpoints, breakpointsTailwind, useTimeoutFn, useMouseInElement, useMediaQuery, useThrottle, useDebounceFn, useMouse, useDraggable, defaultDocument, tryOnMounted, useThrottleFn, useWindowSize, useElementSize, useElementBounding } from "@vueuse/core";
5
5
  import { useI18n, createI18n } from "vue-i18n";
@@ -615,14 +615,22 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
615
615
  }
616
616
  });
617
617
  });
618
+ watch(visible, (isVisible) => {
619
+ if (isVisible) {
620
+ document.addEventListener("keydown", closeOnKeyPress);
621
+ } else {
622
+ document.removeEventListener("keydown", closeOnKeyPress);
623
+ }
624
+ });
625
+ onBeforeUnmount(() => {
626
+ document.removeEventListener("keydown", closeOnKeyPress);
627
+ });
618
628
  function open() {
619
629
  visible.value = true;
620
- document.addEventListener("keydown", closeOnKeyPress);
621
630
  }
622
631
  function close() {
623
632
  if (!props.preventClose) {
624
633
  visible.value = false;
625
- document.removeEventListener("keydown", closeOnKeyPress);
626
634
  }
627
635
  }
628
636
  function closeOnKeyPress(event) {
@@ -3066,7 +3074,10 @@ const _hoisted_18 = {
3066
3074
  key: 0,
3067
3075
  class: "cl:basis-full cl:bg-off-white cl:border cl:border-grey-1 cl:flex cl:gap-2 cl:items-center cl:justify-between cl:lg:basis-auto cl:lg:px-4 cl:lg:py-3 cl:mt-2 cl:px-2 cl:py-1 cl:rounded-lg cl:shadow cl:text-sm"
3068
3076
  };
3069
- const _hoisted_19 = { class: "cl:basis-full cl:bg-off-white cl:border cl:border-grey-1 cl:flex cl:gap-2 cl:items-center cl:justify-between cl:lg:basis-auto cl:lg:px-4 cl:lg:py-3 cl:mt-2 cl:px-2 cl:py-1 cl:rounded-lg cl:shadow cl:text-sm" };
3077
+ const _hoisted_19 = {
3078
+ key: 1,
3079
+ class: "cl:basis-full cl:bg-off-white cl:border cl:border-grey-1 cl:flex cl:gap-2 cl:items-center cl:justify-between cl:lg:basis-auto cl:lg:px-4 cl:lg:py-3 cl:mt-2 cl:px-2 cl:py-1 cl:rounded-lg cl:shadow cl:text-sm"
3080
+ };
3070
3081
  const _hoisted_20 = { class: "cl:flex cl:items-center" };
3071
3082
  const _hoisted_21 = { class: "cl:mr-2 cl:text-grey-3" };
3072
3083
  const _sfc_main$T = /* @__PURE__ */ defineComponent({
@@ -3236,7 +3247,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
3236
3247
  _ctx.$slots["totals-area"] ? (openBlock(), createElementBlock("div", _hoisted_18, [
3237
3248
  renderSlot(_ctx.$slots, "totals-area")
3238
3249
  ])) : createCommentVNode("", true),
3239
- createElementVNode("div", _hoisted_19, [
3250
+ _ctx.options.hidePageJumpToSection === false ? (openBlock(), createElementBlock("div", _hoisted_19, [
3240
3251
  createElementVNode("div", _hoisted_20, [
3241
3252
  createElementVNode("span", _hoisted_21, toDisplayString(unref(t2)("grid.jumpToPage")), 1),
3242
3253
  createVNode(_sfc_main$U, {
@@ -3254,7 +3265,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
3254
3265
  _: 1
3255
3266
  }, 8, ["model-value", "max", "disabled"])
3256
3267
  ])
3257
- ])
3268
+ ])) : createCommentVNode("", true)
3258
3269
  ], 10, _hoisted_4$f)) : createCommentVNode("", true);
3259
3270
  };
3260
3271
  }
@@ -5820,13 +5831,13 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5820
5831
  }, null, 8, ["id", "model-value", "time-zone", "date-format-locale", "type", "readonly"])
5821
5832
  ])) : isDateRangeColumn.value ? (openBlock(), createElementBlock("div", {
5822
5833
  key: 2,
5823
- class: "cl:w-full",
5834
+ class: "cl:[&_.icon]:text-base! cl:[&_.icon]:top-3.5! cl:w-full",
5824
5835
  inert: _ctx.loading
5825
5836
  }, [
5826
5837
  createVNode(_sfc_main$L, {
5827
5838
  id: `${unref(gridId)}-${_ctx.column.name}`,
5828
5839
  "model-value": currentDateRangeFilterValue.value,
5829
- class: "cl:[&_.clear-icon]:-pb-4 cl:[&_.icon]:text-sm cl:[&_.range-input]:h-[2rem] cl:border-none cl:h-[2rem] cl:mb-0 cl:w-full cl:z-50",
5840
+ class: "cl:[&_.clear-icon]:-pb-4 cl:[&_.range-input]:h-[2rem] cl:border-none cl:h-[2rem] cl:mb-0 cl:w-full cl:z-50",
5830
5841
  "time-zone": _ctx.headerDisplayTimezone,
5831
5842
  "quick-date-scope": _ctx.quickDateScope,
5832
5843
  "manual-date-selection": true,
@@ -5915,7 +5926,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5915
5926
  };
5916
5927
  }
5917
5928
  });
5918
- const clUiGridFilterInput = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-6d8e9d5c"]]);
5929
+ const clUiGridFilterInput = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-d9d94110"]]);
5919
5930
  const _hoisted_1$y = { key: 1 };
5920
5931
  const _sfc_main$F = /* @__PURE__ */ defineComponent({
5921
5932
  __name: "cl-ui-grid-filter",
@@ -8784,6 +8795,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
8784
8795
  forceEditMode: false,
8785
8796
  textSize: "small",
8786
8797
  hidePageSizeOptions: false,
8798
+ hidePageJumpToSection: false,
8787
8799
  groupByField: "",
8788
8800
  allowColumnResizing: true,
8789
8801
  ...props.options