vft 0.0.375 → 0.0.378
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/es/component.js +3 -3
- package/es/components/carousel/use-carousel.js +1 -1
- package/es/components/index.d.ts +1 -1
- package/es/components/index.js +3 -3
- package/es/components/input/input.vue2.js +1 -1
- package/es/components/input-tag/composables/use-input-tag.js +1 -1
- package/es/components/select/select.vue2.js +1 -1
- package/es/components/super-form/super-form-item.vue2.js +2 -2
- package/es/components/super-form/use/helper.js +1 -1
- package/es/hooks/use-delayed-toggle/index.d.ts +7 -11
- package/es/hooks/use-delayed-toggle/index.js +2 -29
- package/es/index.js +3 -3
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/es/utils/click-out-side.d.ts +3 -0
- package/es/utils/click-out-side.js +72 -0
- package/es/utils/vue/props/runtime.js +3 -1
- package/es/utils/vue/vnode.js +1 -1
- package/lib/component.cjs +202 -202
- package/lib/components/index.cjs +47 -47
- package/lib/components/index.d.ts +1 -1
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/select/select.vue2.cjs +2 -2
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/hooks/use-delayed-toggle/index.cjs +1 -28
- package/lib/hooks/use-delayed-toggle/index.d.ts +7 -11
- package/lib/index.cjs +47 -47
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/lib/utils/click-out-side.cjs +72 -0
- package/lib/utils/click-out-side.d.ts +3 -0
- package/lib/utils/vue/props/runtime.cjs +4 -2
- package/package.json +4 -4
- package/web-types.json +1 -1
|
@@ -1,34 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const vue = require("vue");
|
|
4
|
-
require("@vueuse/core");
|
|
5
3
|
const utils = require("@vft/utils");
|
|
6
|
-
require("
|
|
7
|
-
const runtime = require("../../utils/vue/props/runtime.cjs");
|
|
4
|
+
const vue = require("vue");
|
|
8
5
|
const index = require("../use-timeout/index.cjs");
|
|
9
|
-
const useDelayedToggleProps = runtime.buildProps({
|
|
10
|
-
/**
|
|
11
|
-
* @description delay of appearance, in millisecond
|
|
12
|
-
*/
|
|
13
|
-
showAfter: {
|
|
14
|
-
type: Number,
|
|
15
|
-
default: 0
|
|
16
|
-
},
|
|
17
|
-
/**
|
|
18
|
-
* @description delay of disappear, in millisecond
|
|
19
|
-
*/
|
|
20
|
-
hideAfter: {
|
|
21
|
-
type: Number,
|
|
22
|
-
default: 200
|
|
23
|
-
},
|
|
24
|
-
/**
|
|
25
|
-
* @description disappear automatically, in millisecond
|
|
26
|
-
*/
|
|
27
|
-
autoClose: {
|
|
28
|
-
type: Number,
|
|
29
|
-
default: 0
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
6
|
const useDelayedToggle = ({
|
|
33
7
|
showAfter,
|
|
34
8
|
hideAfter,
|
|
@@ -64,4 +38,3 @@ const useDelayedToggle = ({
|
|
|
64
38
|
};
|
|
65
39
|
};
|
|
66
40
|
exports.useDelayedToggle = useDelayedToggle;
|
|
67
|
-
exports.useDelayedToggleProps = useDelayedToggleProps;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
open: (event?: Event) => void;
|
|
9
|
-
close: (event?: Event) => void;
|
|
10
|
-
} & ToRefs<ExtractPropTypes<typeof useDelayedToggleProps>>;
|
|
11
|
-
export declare const useDelayedToggle: ({ showAfter, hideAfter, autoClose, open, close, }: UseDelayedToggleProps) => {
|
|
1
|
+
export declare const useDelayedToggle: ({ showAfter, hideAfter, autoClose, open, close, }: {
|
|
2
|
+
showAfter: any;
|
|
3
|
+
hideAfter: any;
|
|
4
|
+
autoClose: any;
|
|
5
|
+
open: any;
|
|
6
|
+
close: any;
|
|
7
|
+
}) => {
|
|
12
8
|
onOpen: (event?: Event) => void;
|
|
13
9
|
onClose: (event?: Event) => void;
|
|
14
10
|
};
|
package/lib/index.cjs
CHANGED
|
@@ -90,21 +90,21 @@ const index$1d = require("./components/modal/index.cjs");
|
|
|
90
90
|
const index$1e = require("./components/progress/index.cjs");
|
|
91
91
|
const index$1f = require("./components/segmented/index.cjs");
|
|
92
92
|
const index$1g = require("./components/statistic/index.cjs");
|
|
93
|
-
const index$1h = require("./components/
|
|
94
|
-
const index$1i = require("./components/
|
|
95
|
-
const index$1j = require("./components/
|
|
96
|
-
const index$1k = require("./components/
|
|
97
|
-
const index$1l = require("./components/
|
|
98
|
-
const index$1m = require("./components/md-code-
|
|
99
|
-
const index$1n = require("./components/md-
|
|
100
|
-
const index$1o = require("./components/md-
|
|
101
|
-
const index$1p = require("./components/md-
|
|
102
|
-
const index$1q = require("./components/md-
|
|
103
|
-
const index$1r = require("./components/
|
|
104
|
-
const index$1s = require("./components/
|
|
105
|
-
const index$1t = require("./components/
|
|
106
|
-
const index$1u = require("./components/
|
|
107
|
-
const index$1v = require("./components/
|
|
93
|
+
const index$1h = require("./components/timeline/index.cjs");
|
|
94
|
+
const index$1i = require("./components/transfer/index.cjs");
|
|
95
|
+
const index$1j = require("./components/upload/index.cjs");
|
|
96
|
+
const index$1k = require("./components/watermark/index.cjs");
|
|
97
|
+
const index$1l = require("./components/md-code-demo/index.cjs");
|
|
98
|
+
const index$1m = require("./components/md-code-tabs/index.cjs");
|
|
99
|
+
const index$1n = require("./components/md-comment/index.cjs");
|
|
100
|
+
const index$1o = require("./components/md-container/index.cjs");
|
|
101
|
+
const index$1p = require("./components/md-tabs/index.cjs");
|
|
102
|
+
const index$1q = require("./components/md-vue-playground/index.cjs");
|
|
103
|
+
const index$1r = require("./components/infinite-scroll/index.cjs");
|
|
104
|
+
const index$1s = require("./components/loading/index.cjs");
|
|
105
|
+
const index$1t = require("./components/message/index.cjs");
|
|
106
|
+
const index$1u = require("./components/progress-i/index.cjs");
|
|
107
|
+
const index$1v = require("./components/super-form/index.cjs");
|
|
108
108
|
const aria = require("./constants/aria.cjs");
|
|
109
109
|
const date = require("./constants/date.cjs");
|
|
110
110
|
const event = require("./constants/event.cjs");
|
|
@@ -199,14 +199,14 @@ const countdown = require("./components/countdown/countdown.cjs");
|
|
|
199
199
|
const inputTag = require("./components/input-tag/input-tag.cjs");
|
|
200
200
|
const useModal = require("./components/modal/use/use-modal.cjs");
|
|
201
201
|
const segmented = require("./components/segmented/segmented.cjs");
|
|
202
|
-
const componentMap = require("./components/super-form/component-map.cjs");
|
|
203
|
-
const useForm = require("./components/super-form/use/use-form.cjs");
|
|
204
202
|
const transfer = require("./components/transfer/transfer.cjs");
|
|
205
203
|
const constants$h = require("./components/upload/constants.cjs");
|
|
206
204
|
const watermark = require("./components/watermark/watermark.cjs");
|
|
207
205
|
const directive = require("./components/loading/directive.cjs");
|
|
208
206
|
const service = require("./components/loading/service.cjs");
|
|
209
207
|
const types$2 = require("./components/message/types.cjs");
|
|
208
|
+
const componentMap = require("./components/super-form/component-map.cjs");
|
|
209
|
+
const useForm = require("./components/super-form/use/use-form.cjs");
|
|
210
210
|
const install = defaults.default.install;
|
|
211
211
|
const version = defaults.default.version;
|
|
212
212
|
exports.default = defaults.default;
|
|
@@ -324,23 +324,23 @@ exports.VftModal = index$1d.VftModal;
|
|
|
324
324
|
exports.VftProgress = index$1e.VftProgress;
|
|
325
325
|
exports.VftSegmented = index$1f.VftSegmented;
|
|
326
326
|
exports.VftStatistic = index$1g.VftStatistic;
|
|
327
|
-
exports.
|
|
328
|
-
exports.
|
|
329
|
-
exports.
|
|
330
|
-
exports.
|
|
331
|
-
exports.
|
|
332
|
-
exports.
|
|
333
|
-
exports.
|
|
334
|
-
exports.
|
|
335
|
-
exports.
|
|
336
|
-
exports.
|
|
337
|
-
exports.
|
|
338
|
-
exports.
|
|
339
|
-
exports.
|
|
340
|
-
exports.
|
|
341
|
-
exports.
|
|
342
|
-
exports.
|
|
343
|
-
exports.
|
|
327
|
+
exports.VftTimeline = index$1h.VftTimeline;
|
|
328
|
+
exports.VftTimelineItem = index$1h.VftTimelineItem;
|
|
329
|
+
exports.VftTransfer = index$1i.VftTransfer;
|
|
330
|
+
exports.VftUpload = index$1j.VftUpload;
|
|
331
|
+
exports.VftWatermark = index$1k.VftWatermark;
|
|
332
|
+
exports.VftMdCodeDemo = index$1l.VftMdCodeDemo;
|
|
333
|
+
exports.VftMdCodeTabs = index$1m.VftMdCodeTabs;
|
|
334
|
+
exports.VftMdComment = index$1n.VftMdComment;
|
|
335
|
+
exports.VftMdContainer = index$1o.VftMdContainer;
|
|
336
|
+
exports.VftMdTabs = index$1p.VftMdTabs;
|
|
337
|
+
exports.VftMdVuePlayground = index$1q.VftMdVuePlayground;
|
|
338
|
+
exports.VftInfiniteScroll = index$1r.VftInfiniteScroll;
|
|
339
|
+
exports.VftLoading = index$1s.VftLoading;
|
|
340
|
+
exports.Message = index$1t.VftMessage;
|
|
341
|
+
exports.VftMessage = index$1t.VftMessage;
|
|
342
|
+
exports.VftProgressI = index$1u.VftProgressI;
|
|
343
|
+
exports.VftSuperForm = index$1v.VftSuperForm;
|
|
344
344
|
exports.EVENT_CODE = aria.EVENT_CODE;
|
|
345
345
|
exports.WEEK_DAYS = date.WEEK_DAYS;
|
|
346
346
|
exports.datePickTypes = date.datePickTypes;
|
|
@@ -552,19 +552,6 @@ exports.useModalInner = useModal.useModalInner;
|
|
|
552
552
|
exports.defaultProps = segmented.defaultProps;
|
|
553
553
|
exports.segmentedEmits = segmented.segmentedEmits;
|
|
554
554
|
exports.segmentedProps = segmented.segmentedProps;
|
|
555
|
-
exports.FormCompEnum = componentMap.FormCompEnum;
|
|
556
|
-
exports.clearComponents = componentMap.clearComponents;
|
|
557
|
-
exports.getComponent = componentMap.getComponent;
|
|
558
|
-
exports.getRegisteredComponents = componentMap.getRegisteredComponents;
|
|
559
|
-
exports.hasComponent = componentMap.hasComponent;
|
|
560
|
-
exports.isDatePicker = componentMap.isDatePicker;
|
|
561
|
-
exports.isInput = componentMap.isInput;
|
|
562
|
-
exports.isRangePicker = componentMap.isRangePicker;
|
|
563
|
-
exports.registerComponent = componentMap.registerComponent;
|
|
564
|
-
exports.registerComponents = componentMap.registerComponents;
|
|
565
|
-
exports.removeComponent = componentMap.removeComponent;
|
|
566
|
-
exports.getDynamicProps = useForm.getDynamicProps;
|
|
567
|
-
exports.useForm = useForm.useForm;
|
|
568
555
|
exports.LEFT_CHECK_CHANGE_EVENT = transfer.LEFT_CHECK_CHANGE_EVENT;
|
|
569
556
|
exports.RIGHT_CHECK_CHANGE_EVENT = transfer.RIGHT_CHECK_CHANGE_EVENT;
|
|
570
557
|
exports.transferCheckedChangeFn = transfer.transferCheckedChangeFn;
|
|
@@ -579,5 +566,18 @@ exports.vLoading = directive.vLoading;
|
|
|
579
566
|
exports.VftLoadingService = service.Loading;
|
|
580
567
|
exports.messageDefaults = types$2.messageDefaults;
|
|
581
568
|
exports.messageTypes = types$2.messageTypes;
|
|
569
|
+
exports.FormCompEnum = componentMap.FormCompEnum;
|
|
570
|
+
exports.clearComponents = componentMap.clearComponents;
|
|
571
|
+
exports.getComponent = componentMap.getComponent;
|
|
572
|
+
exports.getRegisteredComponents = componentMap.getRegisteredComponents;
|
|
573
|
+
exports.hasComponent = componentMap.hasComponent;
|
|
574
|
+
exports.isDatePicker = componentMap.isDatePicker;
|
|
575
|
+
exports.isInput = componentMap.isInput;
|
|
576
|
+
exports.isRangePicker = componentMap.isRangePicker;
|
|
577
|
+
exports.registerComponent = componentMap.registerComponent;
|
|
578
|
+
exports.registerComponents = componentMap.registerComponents;
|
|
579
|
+
exports.removeComponent = componentMap.removeComponent;
|
|
580
|
+
exports.getDynamicProps = useForm.getDynamicProps;
|
|
581
|
+
exports.useForm = useForm.useForm;
|
|
582
582
|
exports.install = install;
|
|
583
583
|
exports.version = version;
|
package/lib/package.json.cjs
CHANGED
package/lib/package.json.d.ts
CHANGED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const utils = require("@vft/utils");
|
|
4
|
+
const nodeList = /* @__PURE__ */ new Map();
|
|
5
|
+
let startClick;
|
|
6
|
+
document.addEventListener("mousedown", (e) => startClick = e);
|
|
7
|
+
document.addEventListener("mouseup", (e) => {
|
|
8
|
+
if (startClick) {
|
|
9
|
+
for (const handlers of nodeList.values()) {
|
|
10
|
+
for (const { documentHandler } of handlers) {
|
|
11
|
+
documentHandler(e, startClick);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
startClick = void 0;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
function createDocumentHandler(el, binding) {
|
|
18
|
+
let excludes = [];
|
|
19
|
+
if (utils.isArray(binding.arg)) {
|
|
20
|
+
excludes = binding.arg;
|
|
21
|
+
} else if (utils.isElement(binding.arg)) {
|
|
22
|
+
excludes.push(binding.arg);
|
|
23
|
+
}
|
|
24
|
+
return function(mouseup, mousedown) {
|
|
25
|
+
const popperRef = binding.instance.popperRef;
|
|
26
|
+
const mouseUpTarget = mouseup.target;
|
|
27
|
+
const mouseDownTarget = mousedown?.target;
|
|
28
|
+
const isBound = !binding || !binding.instance;
|
|
29
|
+
const isTargetExists = !mouseUpTarget || !mouseDownTarget;
|
|
30
|
+
const isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget);
|
|
31
|
+
const isSelf = el === mouseUpTarget;
|
|
32
|
+
const isTargetExcluded = excludes.length && excludes.some((item) => item?.contains(mouseUpTarget)) || excludes.length && excludes.includes(mouseDownTarget);
|
|
33
|
+
const isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget));
|
|
34
|
+
if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
binding.value(mouseup, mousedown);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const ClickOutside = {
|
|
41
|
+
beforeMount(el, binding) {
|
|
42
|
+
if (!nodeList.has(el)) {
|
|
43
|
+
nodeList.set(el, []);
|
|
44
|
+
}
|
|
45
|
+
nodeList.get(el).push({
|
|
46
|
+
documentHandler: createDocumentHandler(el, binding),
|
|
47
|
+
bindingFn: binding.value
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
updated(el, binding) {
|
|
51
|
+
if (!nodeList.has(el)) {
|
|
52
|
+
nodeList.set(el, []);
|
|
53
|
+
}
|
|
54
|
+
const handlers = nodeList.get(el);
|
|
55
|
+
const oldHandlerIndex = handlers.findIndex(
|
|
56
|
+
(item) => item.bindingFn === binding.oldValue
|
|
57
|
+
);
|
|
58
|
+
const newHandler = {
|
|
59
|
+
documentHandler: createDocumentHandler(el, binding),
|
|
60
|
+
bindingFn: binding.value
|
|
61
|
+
};
|
|
62
|
+
if (oldHandlerIndex >= 0) {
|
|
63
|
+
handlers.splice(oldHandlerIndex, 1, newHandler);
|
|
64
|
+
} else {
|
|
65
|
+
handlers.push(newHandler);
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
unmounted(el) {
|
|
69
|
+
nodeList.delete(el);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
exports.default = ClickOutside;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const utils = require("@vft/utils");
|
|
4
4
|
const lodashEs = require("lodash-es");
|
|
5
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
6
|
+
const hasOwn = (val, key) => hasOwnProperty.call(val, key);
|
|
5
7
|
const epPropKey = "__epPropKey";
|
|
6
8
|
const definePropType = (val) => val;
|
|
7
9
|
const isEpProp = (val) => utils.isObject(val) && !!val[epPropKey];
|
|
@@ -13,7 +15,7 @@ const buildProp = (prop, key) => {
|
|
|
13
15
|
let allowedValues = [];
|
|
14
16
|
if (values) {
|
|
15
17
|
allowedValues = Array.from(values);
|
|
16
|
-
if (
|
|
18
|
+
if (hasOwn(prop, "default")) {
|
|
17
19
|
allowedValues.push(defaultValue);
|
|
18
20
|
}
|
|
19
21
|
valid ||= allowedValues.includes(val);
|
|
@@ -35,7 +37,7 @@ const buildProp = (prop, key) => {
|
|
|
35
37
|
validator: _validator,
|
|
36
38
|
[epPropKey]: true
|
|
37
39
|
};
|
|
38
|
-
if (
|
|
40
|
+
if (hasOwn(prop, "default")) epProp.default = defaultValue;
|
|
39
41
|
return epProp;
|
|
40
42
|
};
|
|
41
43
|
const buildProps = (props) => lodashEs.fromPairs(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.378",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"sortablejs": "1.15.0",
|
|
57
57
|
"photoswipe": "5.4.4",
|
|
58
58
|
"@vft/constants": "0.0.72",
|
|
59
|
-
"@vft/store": "0.0.54",
|
|
60
|
-
"@vft/router": "0.0.65",
|
|
61
59
|
"@vft/utils": "0.0.131",
|
|
62
60
|
"@vft/use": "0.0.77",
|
|
63
|
-
"@vft/
|
|
61
|
+
"@vft/router": "0.0.65",
|
|
62
|
+
"@vft/directives": "0.0.34",
|
|
63
|
+
"@vft/store": "0.0.54"
|
|
64
64
|
},
|
|
65
65
|
"vetur": {
|
|
66
66
|
"tags": "tags.json",
|
package/web-types.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"http://json.schemastore.org/web-types","framework":"vue","name":"vft","version":"0.0.
|
|
1
|
+
{"$schema":"http://json.schemastore.org/web-types","framework":"vue","name":"vft","version":"0.0.378","js-types-syntax":"typescript","description-markup":"markdown","contributions":{"html":{}}}
|