Comparing version 0.1.0-alpha.6 to 0.1.0-alpha.7
@@ -6,11 +6,18 @@ declare const _default: import("vue").DefineComponent<{ | ||
}; | ||
initManually: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
}, unknown, { | ||
registered: boolean; | ||
}, {}, { | ||
init(): void; | ||
handleResize(entry: ResizeObserverEntry): void; | ||
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
onResize: Function; | ||
initManually: boolean; | ||
} & {}>, { | ||
onResize: Function; | ||
initManually: boolean; | ||
}>; | ||
export default _default; |
@@ -10,2 +10,6 @@ import { defineComponent, renderSlot } from 'vue'; | ||
default: undefined | ||
}, | ||
initManually: { | ||
type: Boolean, | ||
default: false | ||
} | ||
@@ -19,13 +23,5 @@ }, | ||
mounted() { | ||
const el = this.$el; | ||
if (el === undefined) { | ||
warn('resize-observer', '$el does not exist.'); | ||
} | ||
else if (el.nextElementSibling !== el.nextSibling) { | ||
warn('resize-observer', '$el can not be observed (it may be a text node).'); | ||
} | ||
else if (el.nextElementSibling !== null) { | ||
delegate.registerHandler(el.nextElementSibling, this.handleResize); | ||
this.registered = true; | ||
} | ||
if (this.initManually) | ||
return; | ||
this.init(); | ||
}, | ||
@@ -38,2 +34,15 @@ beforeUnmount() { | ||
methods: { | ||
init() { | ||
const el = this.$el; | ||
if (el === undefined || el === null) { | ||
warn('resize-observer', '$el does not exist.'); | ||
} | ||
else if (el.nextElementSibling !== el.nextSibling) { | ||
warn('resize-observer', '$el can not be observed (it may be a text node).'); | ||
} | ||
else if (el.nextElementSibling !== null) { | ||
delegate.registerHandler(el.nextElementSibling, this.handleResize); | ||
this.registered = true; | ||
} | ||
}, | ||
handleResize(entry) { | ||
@@ -40,0 +49,0 @@ const { onResize } = this; |
@@ -45,2 +45,3 @@ import { PropType } from 'vue'; | ||
listRef: import("vue").Ref<Element | null>; | ||
resizeObserverRef: any; | ||
itemsRef: import("vue").Ref<Element | null>; | ||
@@ -47,0 +48,0 @@ rafFlag: { |
@@ -53,2 +53,3 @@ import { computed, defineComponent, ref, onMounted, h, renderSlot, renderList, onBeforeMount } from 'vue'; | ||
onMounted(() => { | ||
resizeObserverRef.value.init(); | ||
const { defaultScrollIndex, defaultScrollKey } = props; | ||
@@ -72,2 +73,3 @@ if (defaultScrollIndex !== undefined && defaultScrollIndex !== null) { | ||
const preparedRef = computed(() => listHeightRef.value !== undefined); | ||
const resizeObserverRef = ref(null); | ||
const scrollTopRef = ref(0); | ||
@@ -169,2 +171,3 @@ const startIndexRef = computed(() => { | ||
listRef, | ||
resizeObserverRef, | ||
itemsRef: ref(null), | ||
@@ -201,3 +204,5 @@ rafFlag: { | ||
return h(VResizeObserver, { | ||
onResize: this.handleListResize | ||
onResize: this.handleListResize, | ||
initManually: true, | ||
ref: 'resizeObserverRef' | ||
}, { | ||
@@ -204,0 +209,0 @@ default: () => { |
@@ -6,11 +6,18 @@ declare const _default: import("vue").DefineComponent<{ | ||
}; | ||
initManually: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
}, unknown, { | ||
registered: boolean; | ||
}, {}, { | ||
init(): void; | ||
handleResize(entry: ResizeObserverEntry): void; | ||
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
onResize: Function; | ||
initManually: boolean; | ||
} & {}>, { | ||
onResize: Function; | ||
initManually: boolean; | ||
}>; | ||
export default _default; |
@@ -15,2 +15,6 @@ "use strict"; | ||
default: undefined | ||
}, | ||
initManually: { | ||
type: Boolean, | ||
default: false | ||
} | ||
@@ -24,13 +28,5 @@ }, | ||
mounted() { | ||
const el = this.$el; | ||
if (el === undefined) { | ||
shared_1.warn('resize-observer', '$el does not exist.'); | ||
} | ||
else if (el.nextElementSibling !== el.nextSibling) { | ||
shared_1.warn('resize-observer', '$el can not be observed (it may be a text node).'); | ||
} | ||
else if (el.nextElementSibling !== null) { | ||
delegate_1.default.registerHandler(el.nextElementSibling, this.handleResize); | ||
this.registered = true; | ||
} | ||
if (this.initManually) | ||
return; | ||
this.init(); | ||
}, | ||
@@ -43,2 +39,15 @@ beforeUnmount() { | ||
methods: { | ||
init() { | ||
const el = this.$el; | ||
if (el === undefined || el === null) { | ||
shared_1.warn('resize-observer', '$el does not exist.'); | ||
} | ||
else if (el.nextElementSibling !== el.nextSibling) { | ||
shared_1.warn('resize-observer', '$el can not be observed (it may be a text node).'); | ||
} | ||
else if (el.nextElementSibling !== null) { | ||
delegate_1.default.registerHandler(el.nextElementSibling, this.handleResize); | ||
this.registered = true; | ||
} | ||
}, | ||
handleResize(entry) { | ||
@@ -45,0 +54,0 @@ const { onResize } = this; |
@@ -45,2 +45,3 @@ import { PropType } from 'vue'; | ||
listRef: import("vue").Ref<Element | null>; | ||
resizeObserverRef: any; | ||
itemsRef: import("vue").Ref<Element | null>; | ||
@@ -47,0 +48,0 @@ rafFlag: { |
@@ -58,2 +58,3 @@ "use strict"; | ||
vue_1.onMounted(() => { | ||
resizeObserverRef.value.init(); | ||
const { defaultScrollIndex, defaultScrollKey } = props; | ||
@@ -77,2 +78,3 @@ if (defaultScrollIndex !== undefined && defaultScrollIndex !== null) { | ||
const preparedRef = vue_1.computed(() => listHeightRef.value !== undefined); | ||
const resizeObserverRef = vue_1.ref(null); | ||
const scrollTopRef = vue_1.ref(0); | ||
@@ -174,2 +176,3 @@ const startIndexRef = vue_1.computed(() => { | ||
listRef, | ||
resizeObserverRef, | ||
itemsRef: vue_1.ref(null), | ||
@@ -206,3 +209,5 @@ rafFlag: { | ||
return vue_1.h(src_1.default, { | ||
onResize: this.handleListResize | ||
onResize: this.handleListResize, | ||
initManually: true, | ||
ref: 'resizeObserverRef' | ||
}, { | ||
@@ -209,0 +214,0 @@ default: () => { |
{ | ||
"name": "vueuc", | ||
"version": "0.1.0-alpha.6", | ||
"version": "0.1.0-alpha.7", | ||
"description": "Util Components for Vue", | ||
@@ -24,5 +24,5 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@types/jasmine": "^3.5.14", | ||
"@typescript-eslint/eslint-plugin": "^4.4.0", | ||
"eslint": "^7.10.0", | ||
"@types/jasmine": "^3.6.0", | ||
"@typescript-eslint/eslint-plugin": "^4.6.0", | ||
"eslint": "^7.12.1", | ||
"eslint-config-standard-with-typescript": "^19.0.1", | ||
@@ -32,4 +32,4 @@ "eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-standard": "^4.0.1", | ||
"jasmine": "^3.6.1", | ||
"eslint-plugin-standard": "^4.0.2", | ||
"jasmine": "^3.6.3", | ||
"karma": "^5.2.3", | ||
@@ -40,6 +40,6 @@ "karma-chrome-launcher": "^3.1.0", | ||
"karma-typescript": "^5.2.0", | ||
"puppeteer": "^5.3.1", | ||
"typescript": "^4.0.3", | ||
"vite": "^1.0.0-rc.4", | ||
"vue-router": "^4.0.0-beta.13" | ||
"puppeteer": "^5.4.1", | ||
"typescript": "^4.0.5", | ||
"vite": "^1.0.0-rc.8", | ||
"vue-router": "^4.0.0-rc.1" | ||
}, | ||
@@ -50,4 +50,4 @@ "dependencies": { | ||
"vooks": "0.0.1-alpha.1", | ||
"vue": "^3.0.0" | ||
"vue": "^3.0.2" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62210
1062
Updatedvue@^3.0.2