hzzt-plus 0.0.1-dev-08 → 0.0.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.
@@ -7483,24 +7483,22 @@
7483
7483
  }
7484
7484
  const Height = {
7485
7485
  mounted(el, binding) {
7486
- const { element, distY, type } = getEffectiveValue(el, binding.value);
7487
- if (!nodeList.has(element)) {
7488
- nodeList.set(element, []);
7486
+ if (!nodeList.has(el)) {
7487
+ nodeList.set(el, []);
7489
7488
  }
7490
- nodeList.get(element).push({
7491
- documentHandler: createDocumentHandler(element, distY, type),
7489
+ nodeList.get(el).push({
7490
+ documentHandler: createDocumentHandler(el, binding),
7492
7491
  bindingFn: binding.value
7493
7492
  });
7494
7493
  },
7495
7494
  updated(el, binding) {
7496
- const { element, distY, type } = getEffectiveValue(el, binding.value);
7497
- if (!nodeList.has(element)) {
7498
- nodeList.set(element, []);
7495
+ if (!nodeList.has(el)) {
7496
+ nodeList.set(el, []);
7499
7497
  }
7500
- const handlers = nodeList.get(element);
7498
+ const handlers = nodeList.get(el);
7501
7499
  const oldHandlerIndex = handlers.findIndex((item) => item.bindingFn === binding.oldValue);
7502
7500
  const newHandler = {
7503
- documentHandler: createDocumentHandler(element, distY, type),
7501
+ documentHandler: createDocumentHandler(el, binding),
7504
7502
  bindingFn: binding.value
7505
7503
  };
7506
7504
  if (oldHandlerIndex >= 0) {
@@ -7509,16 +7507,16 @@
7509
7507
  handlers.push(newHandler);
7510
7508
  }
7511
7509
  },
7512
- unmounted(el, binding) {
7513
- const { element } = getEffectiveValue(el, binding.value);
7514
- nodeList.delete(element);
7510
+ unmounted(el) {
7511
+ nodeList.delete(el);
7515
7512
  }
7516
7513
  };
7517
- function createDocumentHandler(el, distY, type) {
7514
+ function createDocumentHandler(el, binding) {
7515
+ const { element, distY, type } = getEffectiveValue(el, binding.value);
7518
7516
  const cssProp = type ? type + "Height" : "height";
7519
- el.style[cssProp] = el.clientHeight + distY + "px";
7517
+ el.style[cssProp] = element.clientHeight + distY + "px";
7520
7518
  return function() {
7521
- el.style[cssProp] = el.clientHeight + distY + "px";
7519
+ el.style[cssProp] = element.clientHeight + distY + "px";
7522
7520
  };
7523
7521
  }
7524
7522
  function getEffectiveValue(el, val) {
@@ -7550,12 +7548,41 @@
7550
7548
  }
7551
7549
  };
7552
7550
 
7551
+ const Highlight = {
7552
+ beforeMount: handle,
7553
+ updated: handle
7554
+ };
7555
+ function handle(el, binding) {
7556
+ const { form = false } = binding.modifiers;
7557
+ const { color = "#ff0000", fontSize = "16px", show = true } = binding.value || {};
7558
+ el.style.color = show ? color : "";
7559
+ el.style.fontSize = show ? fontSize : "";
7560
+ if (form) {
7561
+ setCssText(el, show, "--el-text-color-regular", color);
7562
+ setCssText(el, show, "--font-size", fontSize);
7563
+ }
7564
+ }
7565
+ function setCssText(el, show, prop, value) {
7566
+ let cssText = el.style.cssText;
7567
+ if (show) {
7568
+ let cssText2 = el.style.cssText;
7569
+ if (!~cssText2.indexOf(prop)) {
7570
+ cssText2 = `${cssText2};${prop}: ${value}`;
7571
+ }
7572
+ el.style.cssText = cssText2;
7573
+ } else {
7574
+ cssText = cssText.replace(`${prop}: ${value};`, "");
7575
+ el.style.cssText = cssText;
7576
+ }
7577
+ }
7578
+
7553
7579
  const install = installer.install;
7554
7580
  const version = installer.version;
7555
7581
 
7556
7582
  exports.Blur = Blur;
7557
7583
  exports.Download = Download;
7558
7584
  exports.Height = Height;
7585
+ exports.Highlight = Highlight;
7559
7586
  exports.HzztCollapse = HzztCollapse;
7560
7587
  exports.HzztConfigProvider = HzztConfigProvider;
7561
7588
  exports.HzztDropdown = HzztDropdown;