directix 1.6.0 → 1.8.0

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * directix v1.6.0
2
+ * directix v1.8.0
3
3
  * A comprehensive, easy-to-use, and high-performance Vue custom directives library supporting both Vue 2 and Vue 3
4
4
  * (c) 2021-present saqqdy <https://github.com/saqqdy>
5
5
  * Released under the MIT License.
@@ -18810,14 +18810,16 @@ var vFade = defineDirective({
18810
18810
  el.style.opacity = String(options.minOpacity || 0);
18811
18811
  el.style.display = "";
18812
18812
  String(el.offsetHeight);
18813
- requestAnimationFrame(() => {
18813
+ state.animationFrame = requestAnimationFrame(() => {
18814
+ state.animationFrame = null;
18814
18815
  el.style.opacity = String(options.maxOpacity || 1);
18815
18816
  state.currentOpacity = options.maxOpacity || 1;
18816
18817
  });
18817
18818
  } else if (options.direction === "out") {
18818
18819
  el.style.opacity = String(options.maxOpacity || 1);
18819
18820
  el.style.display = "";
18820
- requestAnimationFrame(() => {
18821
+ state.animationFrame = requestAnimationFrame(() => {
18822
+ state.animationFrame = null;
18821
18823
  el.style.opacity = String(options.minOpacity || 0);
18822
18824
  setTimeout(() => {
18823
18825
  el.style.display = "none";
@@ -22971,8 +22973,8 @@ var vSanitize = defineDirective({
22971
22973
  mounted(el, binding) {
22972
22974
  if (!isBrowser()) return;
22973
22975
  const options = normalizeOptions41(binding.value);
22974
- if (options.disabled) return;
22975
22976
  el.__sanitize = { options };
22977
+ if (options.disabled) return;
22976
22978
  const content2 = el.innerHTML;
22977
22979
  if (content2) {
22978
22980
  el.innerHTML = sanitizeHtml(content2, options);
@@ -22981,8 +22983,17 @@ var vSanitize = defineDirective({
22981
22983
  updated(el, binding) {
22982
22984
  const state = el.__sanitize;
22983
22985
  if (!state) return;
22986
+ const prevDisabled = state.options.disabled;
22984
22987
  state.options = normalizeOptions41(binding.value);
22985
- if (state.options.disabled || !state.options.sanitizeOnUpdate) return;
22988
+ if (state.options.disabled || !state.options.sanitizeOnUpdate) {
22989
+ if (prevDisabled && !state.options.disabled) {
22990
+ const content3 = el.innerHTML;
22991
+ if (content3) {
22992
+ el.innerHTML = sanitizeHtml(content3, state.options);
22993
+ }
22994
+ }
22995
+ return;
22996
+ }
22986
22997
  const content2 = el.innerHTML;
22987
22998
  if (content2) {
22988
22999
  el.innerHTML = sanitizeHtml(content2, state.options);
@@ -23643,12 +23654,13 @@ var TOOLTIP_STYLES = {
23643
23654
  };
23644
23655
  var tooltipContainer = null;
23645
23656
  function getTooltipContainer() {
23646
- if (!tooltipContainer && typeof document !== "undefined") {
23647
- tooltipContainer = document.createElement("div");
23648
- tooltipContainer.id = "directix-tooltip-container";
23649
- tooltipContainer.style.cssText = "position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999;";
23650
- document.body.appendChild(tooltipContainer);
23657
+ if (tooltipContainer && document.body.contains(tooltipContainer)) {
23658
+ return tooltipContainer;
23651
23659
  }
23660
+ tooltipContainer = document.createElement("div");
23661
+ tooltipContainer.id = "directix-tooltip-container";
23662
+ tooltipContainer.style.cssText = "position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999;";
23663
+ document.body.appendChild(tooltipContainer);
23652
23664
  return tooltipContainer;
23653
23665
  }
23654
23666
  function createTooltip(options) {
@@ -23874,6 +23886,7 @@ var vTooltip = defineDirective({
23874
23886
  const newState = createState(newOptions);
23875
23887
  el.__tooltip = newState;
23876
23888
  setupTriggerHandlers(el, newState);
23889
+ el.setAttribute("aria-describedby", "v-tooltip");
23877
23890
  if (newOptions.trigger === "manual") {
23878
23891
  showTooltip(el, newState);
23879
23892
  }