hzzt-plus 0.0.1-dev-06 → 0.0.1-dev-08
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/dist/index.full.js +123 -25
- package/dist/index.full.min.js +13 -13
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +9 -9
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +117 -17
- package/es/directives/blur/index.d.ts +3 -0
- package/es/directives/blur/index.mjs +10 -0
- package/es/directives/blur/index.mjs.map +1 -0
- package/es/directives/height/index.mjs +1 -1
- package/es/directives/height/index.mjs.map +1 -1
- package/es/directives/index.d.ts +3 -1
- package/es/directives/index.mjs +3 -1
- package/es/directives/index.mjs.map +1 -1
- package/es/index.mjs +4 -1
- package/es/index.mjs.map +1 -1
- package/lib/directives/blur/index.d.ts +3 -0
- package/lib/directives/blur/index.js +14 -0
- package/lib/directives/blur/index.js.map +1 -0
- package/lib/directives/height/index.js +1 -1
- package/lib/directives/height/index.js.map +1 -1
- package/lib/directives/index.d.ts +3 -1
- package/lib/directives/index.js +5 -1
- package/lib/directives/index.js.map +1 -1
- package/lib/index.js +18 -18
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.full.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*! Hzzt Plus v0.0.1 */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')
|
|
5
|
-
typeof define === 'function' && define.amd ? define(['exports', 'vue'
|
|
6
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.HzztPlus = {}, global.Vue
|
|
7
|
-
})(this, (function (exports, vue
|
|
4
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
|
|
5
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue'], factory) :
|
|
6
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.HzztPlus = {}, global.Vue));
|
|
7
|
+
})(this, (function (exports, vue) { 'use strict';
|
|
8
8
|
|
|
9
9
|
var _a;
|
|
10
10
|
const isClient = typeof window !== "undefined";
|
|
@@ -4061,12 +4061,12 @@
|
|
|
4061
4061
|
}
|
|
4062
4062
|
|
|
4063
4063
|
var numberTag = "[object Number]";
|
|
4064
|
-
function isNumber(value) {
|
|
4064
|
+
function isNumber$1(value) {
|
|
4065
4065
|
return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
|
|
4066
4066
|
}
|
|
4067
4067
|
|
|
4068
4068
|
function isNaN(value) {
|
|
4069
|
-
return isNumber(value) && value != +value;
|
|
4069
|
+
return isNumber$1(value) && value != +value;
|
|
4070
4070
|
}
|
|
4071
4071
|
|
|
4072
4072
|
var isMaskable = coreJsData ? isFunction : stubFalse;
|
|
@@ -6057,7 +6057,7 @@
|
|
|
6057
6057
|
isNative,
|
|
6058
6058
|
isNil,
|
|
6059
6059
|
isNull,
|
|
6060
|
-
isNumber,
|
|
6060
|
+
isNumber: isNumber$1,
|
|
6061
6061
|
isObject,
|
|
6062
6062
|
isObjectLike,
|
|
6063
6063
|
isPlainObject,
|
|
@@ -6825,6 +6825,7 @@
|
|
|
6825
6825
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
6826
6826
|
*/
|
|
6827
6827
|
|
|
6828
|
+
const isNumber = (val) => typeof val === "number";
|
|
6828
6829
|
const isEmpty = (val) => !val && val !== 0 || isArray$1(val) && val.length === 0 || isObject$1(val) && !Object.keys(val).length;
|
|
6829
6830
|
|
|
6830
6831
|
const keysOf = (arr) => Object.keys(arr);
|
|
@@ -7113,19 +7114,19 @@
|
|
|
7113
7114
|
return e instanceof Element;
|
|
7114
7115
|
};
|
|
7115
7116
|
|
|
7116
|
-
const nodeList = /* @__PURE__ */ new Map();
|
|
7117
|
+
const nodeList$1 = /* @__PURE__ */ new Map();
|
|
7117
7118
|
let startClick;
|
|
7118
7119
|
if (isClient) {
|
|
7119
7120
|
document.addEventListener("mousedown", (e) => startClick = e);
|
|
7120
7121
|
document.addEventListener("mouseup", (e) => {
|
|
7121
|
-
for (const handlers of nodeList.values()) {
|
|
7122
|
+
for (const handlers of nodeList$1.values()) {
|
|
7122
7123
|
for (const { documentHandler } of handlers) {
|
|
7123
7124
|
documentHandler(e, startClick);
|
|
7124
7125
|
}
|
|
7125
7126
|
}
|
|
7126
7127
|
});
|
|
7127
7128
|
}
|
|
7128
|
-
function createDocumentHandler(el, binding) {
|
|
7129
|
+
function createDocumentHandler$1(el, binding) {
|
|
7129
7130
|
let excludes = [];
|
|
7130
7131
|
if (Array.isArray(binding.arg)) {
|
|
7131
7132
|
excludes = binding.arg;
|
|
@@ -7150,22 +7151,22 @@
|
|
|
7150
7151
|
}
|
|
7151
7152
|
const ClickOutside = {
|
|
7152
7153
|
beforeMount(el, binding) {
|
|
7153
|
-
if (!nodeList.has(el)) {
|
|
7154
|
-
nodeList.set(el, []);
|
|
7154
|
+
if (!nodeList$1.has(el)) {
|
|
7155
|
+
nodeList$1.set(el, []);
|
|
7155
7156
|
}
|
|
7156
|
-
nodeList.get(el).push({
|
|
7157
|
-
documentHandler: createDocumentHandler(el, binding),
|
|
7157
|
+
nodeList$1.get(el).push({
|
|
7158
|
+
documentHandler: createDocumentHandler$1(el, binding),
|
|
7158
7159
|
bindingFn: binding.value
|
|
7159
7160
|
});
|
|
7160
7161
|
},
|
|
7161
7162
|
updated(el, binding) {
|
|
7162
|
-
if (!nodeList.has(el)) {
|
|
7163
|
-
nodeList.set(el, []);
|
|
7163
|
+
if (!nodeList$1.has(el)) {
|
|
7164
|
+
nodeList$1.set(el, []);
|
|
7164
7165
|
}
|
|
7165
|
-
const handlers = nodeList.get(el);
|
|
7166
|
+
const handlers = nodeList$1.get(el);
|
|
7166
7167
|
const oldHandlerIndex = handlers.findIndex((item) => item.bindingFn === binding.oldValue);
|
|
7167
7168
|
const newHandler = {
|
|
7168
|
-
documentHandler: createDocumentHandler(el, binding),
|
|
7169
|
+
documentHandler: createDocumentHandler$1(el, binding),
|
|
7169
7170
|
bindingFn: binding.value
|
|
7170
7171
|
};
|
|
7171
7172
|
if (oldHandlerIndex >= 0) {
|
|
@@ -7175,7 +7176,7 @@
|
|
|
7175
7176
|
}
|
|
7176
7177
|
},
|
|
7177
7178
|
unmounted(el) {
|
|
7178
|
-
nodeList.delete(el);
|
|
7179
|
+
nodeList$1.delete(el);
|
|
7179
7180
|
}
|
|
7180
7181
|
};
|
|
7181
7182
|
|
|
@@ -7449,9 +7450,112 @@
|
|
|
7449
7450
|
|
|
7450
7451
|
var installer = makeInstaller([...Components, ...Plugins]);
|
|
7451
7452
|
|
|
7453
|
+
let handler$1;
|
|
7454
|
+
const Download = {
|
|
7455
|
+
mounted(el, binding) {
|
|
7456
|
+
const { path, name = "download" } = binding.value || {};
|
|
7457
|
+
handler$1 = function(e) {
|
|
7458
|
+
e.preventDefault();
|
|
7459
|
+
const a = document.createElement("a");
|
|
7460
|
+
a.href = path;
|
|
7461
|
+
a.download = name;
|
|
7462
|
+
a.click();
|
|
7463
|
+
a.remove();
|
|
7464
|
+
};
|
|
7465
|
+
el.addEventListener("click", handler$1);
|
|
7466
|
+
},
|
|
7467
|
+
unmounted(el) {
|
|
7468
|
+
el.removeEventListener("click", handler$1);
|
|
7469
|
+
}
|
|
7470
|
+
};
|
|
7471
|
+
|
|
7472
|
+
const nodeList = /* @__PURE__ */ new Map();
|
|
7473
|
+
if (isClient) {
|
|
7474
|
+
window.addEventListener("resize", handler);
|
|
7475
|
+
document.addEventListener("fullscreenchange", handler);
|
|
7476
|
+
}
|
|
7477
|
+
function handler() {
|
|
7478
|
+
for (const handlers of nodeList.values()) {
|
|
7479
|
+
for (const { documentHandler } of handlers) {
|
|
7480
|
+
documentHandler();
|
|
7481
|
+
}
|
|
7482
|
+
}
|
|
7483
|
+
}
|
|
7484
|
+
const Height = {
|
|
7485
|
+
mounted(el, binding) {
|
|
7486
|
+
const { element, distY, type } = getEffectiveValue(el, binding.value);
|
|
7487
|
+
if (!nodeList.has(element)) {
|
|
7488
|
+
nodeList.set(element, []);
|
|
7489
|
+
}
|
|
7490
|
+
nodeList.get(element).push({
|
|
7491
|
+
documentHandler: createDocumentHandler(element, distY, type),
|
|
7492
|
+
bindingFn: binding.value
|
|
7493
|
+
});
|
|
7494
|
+
},
|
|
7495
|
+
updated(el, binding) {
|
|
7496
|
+
const { element, distY, type } = getEffectiveValue(el, binding.value);
|
|
7497
|
+
if (!nodeList.has(element)) {
|
|
7498
|
+
nodeList.set(element, []);
|
|
7499
|
+
}
|
|
7500
|
+
const handlers = nodeList.get(element);
|
|
7501
|
+
const oldHandlerIndex = handlers.findIndex((item) => item.bindingFn === binding.oldValue);
|
|
7502
|
+
const newHandler = {
|
|
7503
|
+
documentHandler: createDocumentHandler(element, distY, type),
|
|
7504
|
+
bindingFn: binding.value
|
|
7505
|
+
};
|
|
7506
|
+
if (oldHandlerIndex >= 0) {
|
|
7507
|
+
handlers.splice(oldHandlerIndex, 1, newHandler);
|
|
7508
|
+
} else {
|
|
7509
|
+
handlers.push(newHandler);
|
|
7510
|
+
}
|
|
7511
|
+
},
|
|
7512
|
+
unmounted(el, binding) {
|
|
7513
|
+
const { element } = getEffectiveValue(el, binding.value);
|
|
7514
|
+
nodeList.delete(element);
|
|
7515
|
+
}
|
|
7516
|
+
};
|
|
7517
|
+
function createDocumentHandler(el, distY, type) {
|
|
7518
|
+
const cssProp = type ? type + "Height" : "height";
|
|
7519
|
+
el.style[cssProp] = el.clientHeight + distY + "px";
|
|
7520
|
+
return function() {
|
|
7521
|
+
el.style[cssProp] = el.clientHeight + distY + "px";
|
|
7522
|
+
};
|
|
7523
|
+
}
|
|
7524
|
+
function getEffectiveValue(el, val) {
|
|
7525
|
+
let element = el.parentElement;
|
|
7526
|
+
let distY = 0;
|
|
7527
|
+
let type = "";
|
|
7528
|
+
if (!val) {
|
|
7529
|
+
element = el.parentElement;
|
|
7530
|
+
distY = 0;
|
|
7531
|
+
} else if (val instanceof HTMLElement) {
|
|
7532
|
+
element = val;
|
|
7533
|
+
distY = 0;
|
|
7534
|
+
} else if (isNumber(val)) {
|
|
7535
|
+
element = el.parentElement;
|
|
7536
|
+
distY = val;
|
|
7537
|
+
} else if (isObject$1(val)) {
|
|
7538
|
+
element = (val == null ? void 0 : val.el) || el.parentElement;
|
|
7539
|
+
distY = (val == null ? void 0 : val.distY) || 0;
|
|
7540
|
+
type = (val == null ? void 0 : val.type) || "";
|
|
7541
|
+
}
|
|
7542
|
+
return { element, distY, type };
|
|
7543
|
+
}
|
|
7544
|
+
|
|
7545
|
+
const Blur = {
|
|
7546
|
+
beforeMount(el) {
|
|
7547
|
+
el.addEventListener("click", () => {
|
|
7548
|
+
el.blur();
|
|
7549
|
+
});
|
|
7550
|
+
}
|
|
7551
|
+
};
|
|
7552
|
+
|
|
7452
7553
|
const install = installer.install;
|
|
7453
7554
|
const version = installer.version;
|
|
7454
7555
|
|
|
7556
|
+
exports.Blur = Blur;
|
|
7557
|
+
exports.Download = Download;
|
|
7558
|
+
exports.Height = Height;
|
|
7455
7559
|
exports.HzztCollapse = HzztCollapse;
|
|
7456
7560
|
exports.HzztConfigProvider = HzztConfigProvider;
|
|
7457
7561
|
exports.HzztDropdown = HzztDropdown;
|
|
@@ -7479,12 +7583,6 @@
|
|
|
7479
7583
|
exports.useSizeProp = useSizeProp;
|
|
7480
7584
|
exports.useSizeProps = useSizeProps;
|
|
7481
7585
|
exports.version = version;
|
|
7482
|
-
Object.keys(directives).forEach(function (k) {
|
|
7483
|
-
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
7484
|
-
enumerable: true,
|
|
7485
|
-
get: function () { return directives[k]; }
|
|
7486
|
-
});
|
|
7487
|
-
});
|
|
7488
7586
|
|
|
7489
7587
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7490
7588
|
|