@iframe-resizer/vue 5.5.9 → 6.0.0-beta.1
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/LICENSE +2 -2
- package/README.md +1 -1
- package/iframe-resizer.vue +85 -102
- package/iframe-resizer.vue.d.ts +39 -0
- package/index.cjs.js +2 -160
- package/index.cjs.js.map +1 -0
- package/index.d.ts +5 -0
- package/index.esm.js +82 -152
- package/index.esm.js.map +1 -0
- package/index.umd.js +2 -20
- package/index.umd.js.map +1 -0
- package/package.json +5 -4
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Iframe Resizer Version
|
|
1
|
+
Iframe Resizer Version 6
|
|
2
2
|
|
|
3
|
-
This JavaScript library is Copyright © 2013-
|
|
3
|
+
This JavaScript library is Copyright © 2013-2026 David J. Bradshaw and is dual-licensed, either under GPL V3 for compliant sites (Fully published front and backend source code). Or alternatively it is available under a commercial license for sites that do not wish to use the GPL.
|
|
4
4
|
|
|
5
5
|
For more information on commercial licensing see https://iframe-resizer.com/pricing/
|
|
6
6
|
|
package/README.md
CHANGED
package/iframe-resizer.vue
CHANGED
|
@@ -1,130 +1,113 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<iframe ref="
|
|
2
|
+
<iframe ref="iframeRef" v-bind="$attrs"></iframe>
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
|
-
<script>
|
|
5
|
+
<script setup lang="ts">
|
|
6
|
+
import { onBeforeUnmount, onMounted, ref, toRaw } from 'vue'
|
|
7
|
+
import type { PropType } from 'vue'
|
|
6
8
|
import connectResizer from '@iframe-resizer/core'
|
|
9
|
+
import type { IFrameObject, LogOption } from '@iframe-resizer/core'
|
|
7
10
|
import acg from 'auto-console-group'
|
|
8
11
|
|
|
9
12
|
const EXPAND = 'expanded'
|
|
10
13
|
const COLLAPSE = 'collapsed'
|
|
11
14
|
|
|
12
|
-
const esModuleInterop = (mod) =>
|
|
15
|
+
const esModuleInterop = (mod: any) =>
|
|
13
16
|
// eslint-disable-next-line no-underscore-dangle
|
|
14
17
|
mod?.__esModule ? mod.default : mod
|
|
15
18
|
|
|
16
19
|
// Deal with UMD not converting default exports to named exports
|
|
17
20
|
const createAutoConsoleGroup = esModuleInterop(acg)
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
name: 'IframeResizer',
|
|
22
|
+
defineOptions({ name: 'IframeResizer' })
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
case -1:
|
|
52
|
-
return true
|
|
53
|
-
default:
|
|
54
|
-
return false
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
default: undefined,
|
|
58
|
-
},
|
|
59
|
-
inPageLinks: {
|
|
60
|
-
type: Boolean,
|
|
61
|
-
},
|
|
62
|
-
offset: {
|
|
63
|
-
type: Number,
|
|
64
|
-
},
|
|
65
|
-
scrolling: {
|
|
66
|
-
type: Boolean,
|
|
67
|
-
},
|
|
68
|
-
tolerance: {
|
|
69
|
-
type: Number,
|
|
70
|
-
},
|
|
71
|
-
warningTimeout: {
|
|
72
|
-
type: Number,
|
|
24
|
+
const props = defineProps({
|
|
25
|
+
license: {
|
|
26
|
+
type: String,
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
bodyBackground: String,
|
|
30
|
+
bodyMargin: String,
|
|
31
|
+
bodyPadding: String,
|
|
32
|
+
checkOrigin: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: true,
|
|
35
|
+
},
|
|
36
|
+
direction: String,
|
|
37
|
+
log: {
|
|
38
|
+
type: [String, Boolean, Number] as PropType<LogOption>,
|
|
39
|
+
validator: (value: LogOption) => {
|
|
40
|
+
switch (value) {
|
|
41
|
+
case COLLAPSE:
|
|
42
|
+
case EXPAND:
|
|
43
|
+
case false:
|
|
44
|
+
case true:
|
|
45
|
+
case -1:
|
|
46
|
+
case 0:
|
|
47
|
+
case 1:
|
|
48
|
+
case 2:
|
|
49
|
+
return true
|
|
50
|
+
default:
|
|
51
|
+
return false
|
|
52
|
+
}
|
|
73
53
|
},
|
|
54
|
+
default: undefined,
|
|
74
55
|
},
|
|
56
|
+
inPageLinks: Boolean,
|
|
57
|
+
offset: Number,
|
|
58
|
+
scrolling: Boolean,
|
|
59
|
+
tolerance: Number,
|
|
60
|
+
warningTimeout: Number,
|
|
61
|
+
})
|
|
75
62
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
Object
|
|
82
|
-
.entries(this.$props)
|
|
83
|
-
.filter(([key, value]) => value !== undefined)
|
|
84
|
-
),
|
|
85
|
-
waitForLoad: true,
|
|
63
|
+
const emit = defineEmits<{
|
|
64
|
+
onReady: [...args: any[]]
|
|
65
|
+
onMessage: [...args: any[]]
|
|
66
|
+
onResized: [...args: any[]]
|
|
67
|
+
}>()
|
|
86
68
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
consoleGroup.warn('Close method is disabled, use Vue to remove iframe')
|
|
90
|
-
return false
|
|
91
|
-
},
|
|
92
|
-
onReady: (...args) => self.$emit('onReady', ...args),
|
|
93
|
-
onMessage: (...args) => self.$emit('onMessage', ...args),
|
|
94
|
-
onResized: (...args) => self.$emit('onResized', ...args),
|
|
95
|
-
}
|
|
69
|
+
const iframeRef = ref<HTMLIFrameElement | null>(null)
|
|
70
|
+
const resizer = ref<IFrameObject | null>(null)
|
|
96
71
|
|
|
97
|
-
|
|
98
|
-
|
|
72
|
+
onMounted(() => {
|
|
73
|
+
const consoleGroup = createAutoConsoleGroup()
|
|
74
|
+
// Template refs are guaranteed populated before onMounted fires
|
|
75
|
+
const iframe = iframeRef.value!
|
|
76
|
+
const options: any = {
|
|
77
|
+
...Object.fromEntries(
|
|
78
|
+
Object.entries(toRaw(props)).filter(([, value]) => value !== undefined),
|
|
79
|
+
),
|
|
80
|
+
waitForLoad: true,
|
|
99
81
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
82
|
+
onBeforeClose: () => {
|
|
83
|
+
consoleGroup.event('Blocked Close Event')
|
|
84
|
+
consoleGroup.warn('Close method is disabled, use Vue to remove iframe')
|
|
85
|
+
return false
|
|
86
|
+
},
|
|
87
|
+
onReady: (...args: any[]) => emit('onReady', ...args),
|
|
88
|
+
onMessage: (...args: any[]) => emit('onMessage', ...args),
|
|
89
|
+
onResized: (...args: any[]) => emit('onResized', ...args),
|
|
90
|
+
}
|
|
104
91
|
|
|
105
|
-
|
|
106
|
-
|
|
92
|
+
consoleGroup.label(`vue(${iframe.id})`)
|
|
93
|
+
consoleGroup.event('setup')
|
|
107
94
|
|
|
108
|
-
|
|
109
|
-
consoleGroup.log('Created Vue component')
|
|
110
|
-
}
|
|
111
|
-
},
|
|
95
|
+
resizer.value = connectResizer(options)(iframe)
|
|
112
96
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
97
|
+
consoleGroup.expand(options.logExpand)
|
|
98
|
+
if ([COLLAPSE, EXPAND, true].includes(options.log as any)) {
|
|
99
|
+
consoleGroup.log('Created Vue component')
|
|
100
|
+
}
|
|
101
|
+
})
|
|
116
102
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
},
|
|
121
|
-
resize() {
|
|
122
|
-
this.resizer.resize()
|
|
123
|
-
},
|
|
124
|
-
sendMessage(msg, target) {
|
|
125
|
-
this.resizer.sendMessage(msg, target)
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
}
|
|
103
|
+
onBeforeUnmount(() => {
|
|
104
|
+
resizer.value?.disconnect()
|
|
105
|
+
})
|
|
129
106
|
|
|
107
|
+
defineExpose({
|
|
108
|
+
moveToAnchor: (anchor: string) => resizer.value?.moveToAnchor(anchor),
|
|
109
|
+
resize: () => resizer.value?.resize(),
|
|
110
|
+
sendMessage: (msg: any, target?: string) =>
|
|
111
|
+
resizer.value?.sendMessage(msg, target),
|
|
112
|
+
})
|
|
130
113
|
</script>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { DefineComponent } from 'vue'
|
|
2
|
+
import type { IFrameObject } from '@iframe-resizer/core'
|
|
3
|
+
|
|
4
|
+
export interface IframeResizerProps {
|
|
5
|
+
license: string
|
|
6
|
+
bodyBackground?: string
|
|
7
|
+
bodyMargin?: string
|
|
8
|
+
bodyPadding?: string
|
|
9
|
+
checkOrigin?: boolean
|
|
10
|
+
direction?: string
|
|
11
|
+
log?: 'expanded' | 'collapsed' | boolean | number
|
|
12
|
+
inPageLinks?: boolean
|
|
13
|
+
offset?: number
|
|
14
|
+
scrolling?: boolean
|
|
15
|
+
tolerance?: number
|
|
16
|
+
warningTimeout?: number
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Methods exposed via defineExpose, accessible on template refs */
|
|
20
|
+
export type IframeResizerMethods = Pick<IFrameObject, 'moveToAnchor' | 'resize' | 'sendMessage'>
|
|
21
|
+
|
|
22
|
+
export interface IframeResizerEmits {
|
|
23
|
+
onReady: (...args: any[]) => void
|
|
24
|
+
onMessage: (...args: any[]) => void
|
|
25
|
+
onResized: (...args: any[]) => void
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare const IframeResizer: DefineComponent<
|
|
29
|
+
IframeResizerProps,
|
|
30
|
+
IframeResizerMethods,
|
|
31
|
+
{},
|
|
32
|
+
{},
|
|
33
|
+
{},
|
|
34
|
+
{},
|
|
35
|
+
{},
|
|
36
|
+
IframeResizerEmits
|
|
37
|
+
>
|
|
38
|
+
|
|
39
|
+
export default IframeResizer
|
package/index.cjs.js
CHANGED
|
@@ -1,160 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* @module iframe-resizer/vue 5.5.9 (cjs) - 2026-02-06
|
|
5
|
-
*
|
|
6
|
-
* @license GPL-3.0 for non-commercial use only.
|
|
7
|
-
* For commercial use, you must purchase a license from
|
|
8
|
-
* https://iframe-resizer.com/pricing
|
|
9
|
-
*
|
|
10
|
-
* @description Keep same and cross domain iFrames sized to their content
|
|
11
|
-
*
|
|
12
|
-
* @author David J. Bradshaw <info@iframe-resizer.com>
|
|
13
|
-
*
|
|
14
|
-
* @see {@link https://iframe-resizer.com}
|
|
15
|
-
*
|
|
16
|
-
* @copyright (c) 2013 - 2026, David J. Bradshaw. All rights reserved.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
'use strict';
|
|
21
|
-
|
|
22
|
-
const connectResizer = require('@iframe-resizer/core');
|
|
23
|
-
const acg = require('auto-console-group');
|
|
24
|
-
const vue = require('vue');
|
|
25
|
-
|
|
26
|
-
const EXPAND = 'expanded';
|
|
27
|
-
const COLLAPSE = 'collapsed';
|
|
28
|
-
|
|
29
|
-
const esModuleInterop = (mod) =>
|
|
30
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
31
|
-
mod?.__esModule ? mod.default : mod;
|
|
32
|
-
|
|
33
|
-
// Deal with UMD not converting default exports to named exports
|
|
34
|
-
const createAutoConsoleGroup = esModuleInterop(acg);
|
|
35
|
-
|
|
36
|
-
const script = {
|
|
37
|
-
name: 'IframeResizer',
|
|
38
|
-
|
|
39
|
-
props: {
|
|
40
|
-
license: {
|
|
41
|
-
type: String,
|
|
42
|
-
required: true
|
|
43
|
-
},
|
|
44
|
-
bodyBackground: {
|
|
45
|
-
type: String,
|
|
46
|
-
},
|
|
47
|
-
bodyMargin: {
|
|
48
|
-
type: String,
|
|
49
|
-
},
|
|
50
|
-
bodyPadding: {
|
|
51
|
-
type: String,
|
|
52
|
-
},
|
|
53
|
-
checkOrigin: {
|
|
54
|
-
type: Boolean,
|
|
55
|
-
default: true,
|
|
56
|
-
},
|
|
57
|
-
direction: {
|
|
58
|
-
type: String,
|
|
59
|
-
},
|
|
60
|
-
log: {
|
|
61
|
-
type: [String, Boolean, Number],
|
|
62
|
-
validator: (value) => {
|
|
63
|
-
switch (value) {
|
|
64
|
-
case COLLAPSE:
|
|
65
|
-
case EXPAND:
|
|
66
|
-
case false:
|
|
67
|
-
case true:
|
|
68
|
-
case -1:
|
|
69
|
-
return true
|
|
70
|
-
default:
|
|
71
|
-
return false
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
default: undefined,
|
|
75
|
-
},
|
|
76
|
-
inPageLinks: {
|
|
77
|
-
type: Boolean,
|
|
78
|
-
},
|
|
79
|
-
offset: {
|
|
80
|
-
type: Number,
|
|
81
|
-
},
|
|
82
|
-
scrolling: {
|
|
83
|
-
type: Boolean,
|
|
84
|
-
},
|
|
85
|
-
tolerance: {
|
|
86
|
-
type: Number,
|
|
87
|
-
},
|
|
88
|
-
warningTimeout: {
|
|
89
|
-
type: Number,
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
mounted() {
|
|
94
|
-
const self = this;
|
|
95
|
-
const { iframe } = this.$refs;
|
|
96
|
-
const options = {
|
|
97
|
-
...Object.fromEntries(
|
|
98
|
-
Object
|
|
99
|
-
.entries(this.$props)
|
|
100
|
-
.filter(([key, value]) => value !== undefined)
|
|
101
|
-
),
|
|
102
|
-
waitForLoad: true,
|
|
103
|
-
|
|
104
|
-
onBeforeClose: () => {
|
|
105
|
-
consoleGroup.event('Blocked Close Event');
|
|
106
|
-
consoleGroup.warn('Close method is disabled, use Vue to remove iframe');
|
|
107
|
-
return false
|
|
108
|
-
},
|
|
109
|
-
onReady: (...args) => self.$emit('onReady', ...args),
|
|
110
|
-
onMessage: (...args) => self.$emit('onMessage', ...args),
|
|
111
|
-
onResized: (...args) => self.$emit('onResized', ...args),
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
const connectWithOptions = connectResizer(options);
|
|
115
|
-
self.resizer = connectWithOptions(iframe);
|
|
116
|
-
|
|
117
|
-
const consoleOptions = {
|
|
118
|
-
label: `vue(${iframe.id})`,
|
|
119
|
-
expand: options.logExpand, // set inside connectResizer
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const consoleGroup = createAutoConsoleGroup(consoleOptions);
|
|
123
|
-
consoleGroup.event('setup');
|
|
124
|
-
|
|
125
|
-
if ([COLLAPSE, EXPAND, true].includes(options.log)) {
|
|
126
|
-
consoleGroup.log('Created Vue component');
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
|
|
130
|
-
beforeUnmount() {
|
|
131
|
-
this.resizer?.disconnect();
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
methods: {
|
|
135
|
-
moveToAnchor(anchor) {
|
|
136
|
-
this.resizer.moveToAnchor(anchor);
|
|
137
|
-
},
|
|
138
|
-
resize() {
|
|
139
|
-
this.resizer.resize();
|
|
140
|
-
},
|
|
141
|
-
sendMessage(msg, target) {
|
|
142
|
-
this.resizer.sendMessage(msg, target);
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
148
|
-
return (vue.openBlock(), vue.createElementBlock("iframe", vue.mergeProps({ ref: "iframe" }, _ctx.$attrs), null, 16 /* FULL_PROPS */))
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
script.render = render;
|
|
152
|
-
script.__file = "./iframe-resizer.vue";
|
|
153
|
-
|
|
154
|
-
const index = {
|
|
155
|
-
install(Vue) {
|
|
156
|
-
Vue.component('IframeResizer', script);
|
|
157
|
-
},
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
module.exports = index;
|
|
1
|
+
"use strict";const o=require("vue"),g=require("@iframe-resizer/core"),v=require("auto-console-group"),l="expanded",u="collapsed",R=o.defineComponent({name:"IframeResizer",__name:"iframe-resizer",props:{license:{type:String,required:!0},bodyBackground:String,bodyMargin:String,bodyPadding:String,checkOrigin:{type:Boolean,default:!0},direction:String,log:{type:[String,Boolean,Number],validator:r=>{switch(r){case u:case l:case!1:case!0:case-1:case 0:case 1:case 2:return!0;default:return!1}},default:void 0},inPageLinks:Boolean,offset:Number,scrolling:Boolean,tolerance:Number,warningTimeout:Number},emits:["onReady","onMessage","onResized"],setup(r,{expose:d,emit:f}){const m=(e=>e?.__esModule?e.default:e)(v),p=r,a=f,c=o.ref(null),s=o.ref(null);return o.onMounted(()=>{const e=m(),t=c.value,i={...Object.fromEntries(Object.entries(o.toRaw(p)).filter(([,n])=>n!==void 0)),waitForLoad:!0,onBeforeClose:()=>(e.event("Blocked Close Event"),e.warn("Close method is disabled, use Vue to remove iframe"),!1),onReady:(...n)=>a("onReady",...n),onMessage:(...n)=>a("onMessage",...n),onResized:(...n)=>a("onResized",...n)};e.label(`vue(${t.id})`),e.event("setup"),s.value=g(i)(t),e.expand(i.logExpand),[u,l,!0].includes(i.log)&&e.log("Created Vue component")}),o.onBeforeUnmount(()=>{s.value?.disconnect()}),d({moveToAnchor:e=>s.value?.moveToAnchor(e),resize:()=>s.value?.resize(),sendMessage:(e,t)=>s.value?.sendMessage(e,t)}),(e,t)=>(o.openBlock(),o.createElementBlock("iframe",o.mergeProps({ref_key:"iframeRef",ref:c},e.$attrs),null,16))}}),b={install(r){r.component("IframeResizer",R)}};module.exports=b;
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
package/index.cjs.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../packages/vue/iframe-resizer.vue","../../packages/vue/index.ts"],"sourcesContent":["<template>\n <iframe ref=\"iframeRef\" v-bind=\"$attrs\"></iframe>\n</template>\n\n<script setup lang=\"ts\">\n import { onBeforeUnmount, onMounted, ref, toRaw } from 'vue'\n import type { PropType } from 'vue'\n import connectResizer from '@iframe-resizer/core'\n import type { IFrameObject, LogOption } from '@iframe-resizer/core'\n import acg from 'auto-console-group'\n\n const EXPAND = 'expanded'\n const COLLAPSE = 'collapsed'\n\n const esModuleInterop = (mod: any) =>\n // eslint-disable-next-line no-underscore-dangle\n mod?.__esModule ? mod.default : mod\n\n // Deal with UMD not converting default exports to named exports\n const createAutoConsoleGroup = esModuleInterop(acg)\n\n defineOptions({ name: 'IframeResizer' })\n\n const props = defineProps({\n license: {\n type: String,\n required: true,\n },\n bodyBackground: String,\n bodyMargin: String,\n bodyPadding: String,\n checkOrigin: {\n type: Boolean,\n default: true,\n },\n direction: String,\n log: {\n type: [String, Boolean, Number] as PropType<LogOption>,\n validator: (value: LogOption) => {\n switch (value) {\n case COLLAPSE:\n case EXPAND:\n case false:\n case true:\n case -1:\n case 0:\n case 1:\n case 2:\n return true\n default:\n return false\n }\n },\n default: undefined,\n },\n inPageLinks: Boolean,\n offset: Number,\n scrolling: Boolean,\n tolerance: Number,\n warningTimeout: Number,\n })\n\n const emit = defineEmits<{\n onReady: [...args: any[]]\n onMessage: [...args: any[]]\n onResized: [...args: any[]]\n }>()\n\n const iframeRef = ref<HTMLIFrameElement | null>(null)\n const resizer = ref<IFrameObject | null>(null)\n\n onMounted(() => {\n const consoleGroup = createAutoConsoleGroup()\n // Template refs are guaranteed populated before onMounted fires\n const iframe = iframeRef.value!\n const options: any = {\n ...Object.fromEntries(\n Object.entries(toRaw(props)).filter(([, value]) => value !== undefined),\n ),\n waitForLoad: true,\n\n onBeforeClose: () => {\n consoleGroup.event('Blocked Close Event')\n consoleGroup.warn('Close method is disabled, use Vue to remove iframe')\n return false\n },\n onReady: (...args: any[]) => emit('onReady', ...args),\n onMessage: (...args: any[]) => emit('onMessage', ...args),\n onResized: (...args: any[]) => emit('onResized', ...args),\n }\n\n consoleGroup.label(`vue(${iframe.id})`)\n consoleGroup.event('setup')\n\n resizer.value = connectResizer(options)(iframe)\n\n consoleGroup.expand(options.logExpand)\n if ([COLLAPSE, EXPAND, true].includes(options.log as any)) {\n consoleGroup.log('Created Vue component')\n }\n })\n\n onBeforeUnmount(() => {\n resizer.value?.disconnect()\n })\n\n defineExpose({\n moveToAnchor: (anchor: string) => resizer.value?.moveToAnchor(anchor),\n resize: () => resizer.value?.resize(),\n sendMessage: (msg: any, target?: string) =>\n resizer.value?.sendMessage(msg, target),\n })\n</script>\n","import type { App } from 'vue'\n\nimport IframeResizer from './iframe-resizer.vue'\n\nexport default {\n install(app: App) {\n app.component('IframeResizer', IframeResizer)\n },\n}\n"],"names":["EXPAND","COLLAPSE","createAutoConsoleGroup","mod","acg","props","__props","emit","__emit","iframeRef","ref","resizer","onMounted","consoleGroup","iframe","options","toRaw","value","args","connectResizer","onBeforeUnmount","__expose","anchor","msg","target","_openBlock","_createElementBlock","_mergeProps","$attrs","index","app","IframeResizer"],"mappings":"sGAWQA,EAAS,WACTC,EAAW,wiBAOjB,MAAMC,GALmBC,GAEvBA,GAAK,WAAaA,EAAI,QAAUA,GAGaC,CAAG,EAI5CC,EAAQC,EAuCRC,EAAOC,EAMPC,EAAYC,EAAAA,IAA8B,IAAI,EAC9CC,EAAUD,EAAAA,IAAyB,IAAI,EAE7CE,OAAAA,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAeX,EAAA,EAEfY,EAASL,EAAU,MACnBM,EAAe,CACnB,GAAG,OAAO,YACR,OAAO,QAAQC,EAAAA,MAAMX,CAAK,CAAC,EAAE,OAAO,CAAC,CAAA,CAAGY,CAAK,IAAMA,IAAU,MAAS,CAAA,EAExE,YAAa,GAEb,cAAe,KACbJ,EAAa,MAAM,qBAAqB,EACxCA,EAAa,KAAK,oDAAoD,EAC/D,IAET,QAAS,IAAIK,IAAgBX,EAAK,UAAW,GAAGW,CAAI,EACpD,UAAW,IAAIA,IAAgBX,EAAK,YAAa,GAAGW,CAAI,EACxD,UAAW,IAAIA,IAAgBX,EAAK,YAAa,GAAGW,CAAI,CAAA,EAG1DL,EAAa,MAAM,OAAOC,EAAO,EAAE,GAAG,EACtCD,EAAa,MAAM,OAAO,EAE1BF,EAAQ,MAAQQ,EAAeJ,CAAO,EAAED,CAAM,EAE9CD,EAAa,OAAOE,EAAQ,SAAS,EACjC,CAACd,EAAUD,EAAQ,EAAI,EAAE,SAASe,EAAQ,GAAU,GACtDF,EAAa,IAAI,uBAAuB,CAE5C,CAAC,EAEDO,EAAAA,gBAAgB,IAAM,CACpBT,EAAQ,OAAO,WAAA,CACjB,CAAC,EAEDU,EAAa,CACX,aAAeC,GAAmBX,EAAQ,OAAO,aAAaW,CAAM,EACpE,OAAQ,IAAMX,EAAQ,OAAO,OAAA,EAC7B,YAAa,CAACY,EAAUC,IACtBb,EAAQ,OAAO,YAAYY,EAAKC,CAAM,CAAA,CACzC,UA9GDC,EAAAA,YAAAC,EAAAA,mBAAiD,SAAjDC,aAAiD,SAArC,YAAJ,IAAIlB,CAAA,EAAoBmB,EAAAA,MAAM,EAAA,KAAA,EAAA,MCGxCC,EAAe,CACb,QAAQC,EAAU,CAChBA,EAAI,UAAU,gBAAiBC,CAAa,CAC9C,CACF"}
|
package/index.d.ts
ADDED
package/index.esm.js
CHANGED
|
@@ -1,158 +1,88 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
* @author David J. Bradshaw <info@iframe-resizer.com>
|
|
13
|
-
*
|
|
14
|
-
* @see {@link https://iframe-resizer.com}
|
|
15
|
-
*
|
|
16
|
-
* @copyright (c) 2013 - 2026, David J. Bradshaw. All rights reserved.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import connectResizer from '@iframe-resizer/core';
|
|
21
|
-
import acg from 'auto-console-group';
|
|
22
|
-
import { openBlock, createElementBlock, mergeProps } from 'vue';
|
|
23
|
-
|
|
24
|
-
const EXPAND = 'expanded';
|
|
25
|
-
const COLLAPSE = 'collapsed';
|
|
26
|
-
|
|
27
|
-
const esModuleInterop = (mod) =>
|
|
28
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
29
|
-
mod?.__esModule ? mod.default : mod;
|
|
30
|
-
|
|
31
|
-
// Deal with UMD not converting default exports to named exports
|
|
32
|
-
const createAutoConsoleGroup = esModuleInterop(acg);
|
|
33
|
-
|
|
34
|
-
const script = {
|
|
35
|
-
name: 'IframeResizer',
|
|
36
|
-
|
|
37
|
-
props: {
|
|
38
|
-
license: {
|
|
39
|
-
type: String,
|
|
40
|
-
required: true
|
|
41
|
-
},
|
|
42
|
-
bodyBackground: {
|
|
43
|
-
type: String,
|
|
44
|
-
},
|
|
45
|
-
bodyMargin: {
|
|
46
|
-
type: String,
|
|
47
|
-
},
|
|
48
|
-
bodyPadding: {
|
|
49
|
-
type: String,
|
|
50
|
-
},
|
|
51
|
-
checkOrigin: {
|
|
52
|
-
type: Boolean,
|
|
53
|
-
default: true,
|
|
54
|
-
},
|
|
55
|
-
direction: {
|
|
56
|
-
type: String,
|
|
57
|
-
},
|
|
58
|
-
log: {
|
|
59
|
-
type: [String, Boolean, Number],
|
|
60
|
-
validator: (value) => {
|
|
61
|
-
switch (value) {
|
|
62
|
-
case COLLAPSE:
|
|
63
|
-
case EXPAND:
|
|
64
|
-
case false:
|
|
65
|
-
case true:
|
|
66
|
-
case -1:
|
|
67
|
-
return true
|
|
68
|
-
default:
|
|
69
|
-
return false
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
default: undefined,
|
|
73
|
-
},
|
|
74
|
-
inPageLinks: {
|
|
75
|
-
type: Boolean,
|
|
76
|
-
},
|
|
77
|
-
offset: {
|
|
78
|
-
type: Number,
|
|
79
|
-
},
|
|
80
|
-
scrolling: {
|
|
81
|
-
type: Boolean,
|
|
82
|
-
},
|
|
83
|
-
tolerance: {
|
|
84
|
-
type: Number,
|
|
85
|
-
},
|
|
86
|
-
warningTimeout: {
|
|
87
|
-
type: Number,
|
|
88
|
-
},
|
|
1
|
+
import { defineComponent as g, ref as l, onMounted as v, toRaw as R, onBeforeUnmount as b, openBlock as y, createElementBlock as z, mergeProps as B } from "vue";
|
|
2
|
+
import M from "@iframe-resizer/core";
|
|
3
|
+
import _ from "auto-console-group";
|
|
4
|
+
const c = "expanded", u = "collapsed", k = /* @__PURE__ */ g({
|
|
5
|
+
name: "IframeResizer",
|
|
6
|
+
__name: "iframe-resizer",
|
|
7
|
+
props: {
|
|
8
|
+
license: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: !0
|
|
89
11
|
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
Object
|
|
97
|
-
.entries(this.$props)
|
|
98
|
-
.filter(([key, value]) => value !== undefined)
|
|
99
|
-
),
|
|
100
|
-
waitForLoad: true,
|
|
101
|
-
|
|
102
|
-
onBeforeClose: () => {
|
|
103
|
-
consoleGroup.event('Blocked Close Event');
|
|
104
|
-
consoleGroup.warn('Close method is disabled, use Vue to remove iframe');
|
|
105
|
-
return false
|
|
106
|
-
},
|
|
107
|
-
onReady: (...args) => self.$emit('onReady', ...args),
|
|
108
|
-
onMessage: (...args) => self.$emit('onMessage', ...args),
|
|
109
|
-
onResized: (...args) => self.$emit('onResized', ...args),
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
const connectWithOptions = connectResizer(options);
|
|
113
|
-
self.resizer = connectWithOptions(iframe);
|
|
114
|
-
|
|
115
|
-
const consoleOptions = {
|
|
116
|
-
label: `vue(${iframe.id})`,
|
|
117
|
-
expand: options.logExpand, // set inside connectResizer
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
const consoleGroup = createAutoConsoleGroup(consoleOptions);
|
|
121
|
-
consoleGroup.event('setup');
|
|
122
|
-
|
|
123
|
-
if ([COLLAPSE, EXPAND, true].includes(options.log)) {
|
|
124
|
-
consoleGroup.log('Created Vue component');
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
beforeUnmount() {
|
|
129
|
-
this.resizer?.disconnect();
|
|
12
|
+
bodyBackground: String,
|
|
13
|
+
bodyMargin: String,
|
|
14
|
+
bodyPadding: String,
|
|
15
|
+
checkOrigin: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: !0
|
|
130
18
|
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
19
|
+
direction: String,
|
|
20
|
+
log: {
|
|
21
|
+
type: [String, Boolean, Number],
|
|
22
|
+
validator: (n) => {
|
|
23
|
+
switch (n) {
|
|
24
|
+
case u:
|
|
25
|
+
case c:
|
|
26
|
+
case !1:
|
|
27
|
+
case !0:
|
|
28
|
+
case -1:
|
|
29
|
+
case 0:
|
|
30
|
+
case 1:
|
|
31
|
+
case 2:
|
|
32
|
+
return !0;
|
|
33
|
+
default:
|
|
34
|
+
return !1;
|
|
35
|
+
}
|
|
141
36
|
},
|
|
37
|
+
default: void 0
|
|
142
38
|
},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
script.render = render;
|
|
150
|
-
script.__file = "./iframe-resizer.vue";
|
|
151
|
-
|
|
152
|
-
const index = {
|
|
153
|
-
install(Vue) {
|
|
154
|
-
Vue.component('IframeResizer', script);
|
|
39
|
+
inPageLinks: Boolean,
|
|
40
|
+
offset: Number,
|
|
41
|
+
scrolling: Boolean,
|
|
42
|
+
tolerance: Number,
|
|
43
|
+
warningTimeout: Number
|
|
155
44
|
},
|
|
45
|
+
emits: ["onReady", "onMessage", "onResized"],
|
|
46
|
+
setup(n, { expose: d, emit: m }) {
|
|
47
|
+
const f = ((e) => (
|
|
48
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
49
|
+
e?.__esModule ? e.default : e
|
|
50
|
+
))(_), p = n, s = m, i = l(null), r = l(null);
|
|
51
|
+
return v(() => {
|
|
52
|
+
const e = f(), t = i.value, a = {
|
|
53
|
+
...Object.fromEntries(
|
|
54
|
+
Object.entries(R(p)).filter(([, o]) => o !== void 0)
|
|
55
|
+
),
|
|
56
|
+
waitForLoad: !0,
|
|
57
|
+
onBeforeClose: () => (e.event("Blocked Close Event"), e.warn("Close method is disabled, use Vue to remove iframe"), !1),
|
|
58
|
+
onReady: (...o) => s("onReady", ...o),
|
|
59
|
+
onMessage: (...o) => s("onMessage", ...o),
|
|
60
|
+
onResized: (...o) => s("onResized", ...o)
|
|
61
|
+
};
|
|
62
|
+
e.label(`vue(${t.id})`), e.event("setup"), r.value = M(a)(t), e.expand(a.logExpand), [u, c, !0].includes(a.log) && e.log("Created Vue component");
|
|
63
|
+
}), b(() => {
|
|
64
|
+
r.value?.disconnect();
|
|
65
|
+
}), d({
|
|
66
|
+
moveToAnchor: (e) => r.value?.moveToAnchor(e),
|
|
67
|
+
resize: () => r.value?.resize(),
|
|
68
|
+
sendMessage: (e, t) => r.value?.sendMessage(e, t)
|
|
69
|
+
}), (e, t) => (y(), z(
|
|
70
|
+
"iframe",
|
|
71
|
+
B({
|
|
72
|
+
ref_key: "iframeRef",
|
|
73
|
+
ref: i
|
|
74
|
+
}, e.$attrs),
|
|
75
|
+
null,
|
|
76
|
+
16
|
|
77
|
+
/* FULL_PROPS */
|
|
78
|
+
));
|
|
79
|
+
}
|
|
80
|
+
}), E = {
|
|
81
|
+
install(n) {
|
|
82
|
+
n.component("IframeResizer", k);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
export {
|
|
86
|
+
E as default
|
|
156
87
|
};
|
|
157
|
-
|
|
158
|
-
export { index as default };
|
|
88
|
+
//# sourceMappingURL=index.esm.js.map
|
package/index.esm.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../packages/vue/iframe-resizer.vue","../../packages/vue/index.ts"],"sourcesContent":["<template>\n <iframe ref=\"iframeRef\" v-bind=\"$attrs\"></iframe>\n</template>\n\n<script setup lang=\"ts\">\n import { onBeforeUnmount, onMounted, ref, toRaw } from 'vue'\n import type { PropType } from 'vue'\n import connectResizer from '@iframe-resizer/core'\n import type { IFrameObject, LogOption } from '@iframe-resizer/core'\n import acg from 'auto-console-group'\n\n const EXPAND = 'expanded'\n const COLLAPSE = 'collapsed'\n\n const esModuleInterop = (mod: any) =>\n // eslint-disable-next-line no-underscore-dangle\n mod?.__esModule ? mod.default : mod\n\n // Deal with UMD not converting default exports to named exports\n const createAutoConsoleGroup = esModuleInterop(acg)\n\n defineOptions({ name: 'IframeResizer' })\n\n const props = defineProps({\n license: {\n type: String,\n required: true,\n },\n bodyBackground: String,\n bodyMargin: String,\n bodyPadding: String,\n checkOrigin: {\n type: Boolean,\n default: true,\n },\n direction: String,\n log: {\n type: [String, Boolean, Number] as PropType<LogOption>,\n validator: (value: LogOption) => {\n switch (value) {\n case COLLAPSE:\n case EXPAND:\n case false:\n case true:\n case -1:\n case 0:\n case 1:\n case 2:\n return true\n default:\n return false\n }\n },\n default: undefined,\n },\n inPageLinks: Boolean,\n offset: Number,\n scrolling: Boolean,\n tolerance: Number,\n warningTimeout: Number,\n })\n\n const emit = defineEmits<{\n onReady: [...args: any[]]\n onMessage: [...args: any[]]\n onResized: [...args: any[]]\n }>()\n\n const iframeRef = ref<HTMLIFrameElement | null>(null)\n const resizer = ref<IFrameObject | null>(null)\n\n onMounted(() => {\n const consoleGroup = createAutoConsoleGroup()\n // Template refs are guaranteed populated before onMounted fires\n const iframe = iframeRef.value!\n const options: any = {\n ...Object.fromEntries(\n Object.entries(toRaw(props)).filter(([, value]) => value !== undefined),\n ),\n waitForLoad: true,\n\n onBeforeClose: () => {\n consoleGroup.event('Blocked Close Event')\n consoleGroup.warn('Close method is disabled, use Vue to remove iframe')\n return false\n },\n onReady: (...args: any[]) => emit('onReady', ...args),\n onMessage: (...args: any[]) => emit('onMessage', ...args),\n onResized: (...args: any[]) => emit('onResized', ...args),\n }\n\n consoleGroup.label(`vue(${iframe.id})`)\n consoleGroup.event('setup')\n\n resizer.value = connectResizer(options)(iframe)\n\n consoleGroup.expand(options.logExpand)\n if ([COLLAPSE, EXPAND, true].includes(options.log as any)) {\n consoleGroup.log('Created Vue component')\n }\n })\n\n onBeforeUnmount(() => {\n resizer.value?.disconnect()\n })\n\n defineExpose({\n moveToAnchor: (anchor: string) => resizer.value?.moveToAnchor(anchor),\n resize: () => resizer.value?.resize(),\n sendMessage: (msg: any, target?: string) =>\n resizer.value?.sendMessage(msg, target),\n })\n</script>\n","import type { App } from 'vue'\n\nimport IframeResizer from './iframe-resizer.vue'\n\nexport default {\n install(app: App) {\n app.component('IframeResizer', IframeResizer)\n },\n}\n"],"names":["EXPAND","COLLAPSE","createAutoConsoleGroup","mod","acg","props","__props","emit","__emit","iframeRef","ref","resizer","onMounted","consoleGroup","iframe","options","toRaw","value","args","connectResizer","onBeforeUnmount","__expose","anchor","msg","target","_openBlock","_createElementBlock","_mergeProps","$attrs","index","app","IframeResizer"],"mappings":";;;AAWE,MAAMA,IAAS,YACTC,IAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOjB,UAAMC,KALkB,CAACC;AAAA;AAAA,MAEvBA,GAAK,aAAaA,EAAI,UAAUA;AAAA,OAGaC,CAAG,GAI5CC,IAAQC,GAuCRC,IAAOC,GAMPC,IAAYC,EAA8B,IAAI,GAC9CC,IAAUD,EAAyB,IAAI;AAE7C,WAAAE,EAAU,MAAM;AACd,YAAMC,IAAeX,EAAA,GAEfY,IAASL,EAAU,OACnBM,IAAe;AAAA,QACnB,GAAG,OAAO;AAAA,UACR,OAAO,QAAQC,EAAMX,CAAK,CAAC,EAAE,OAAO,CAAC,CAAA,EAAGY,CAAK,MAAMA,MAAU,MAAS;AAAA,QAAA;AAAA,QAExE,aAAa;AAAA,QAEb,eAAe,OACbJ,EAAa,MAAM,qBAAqB,GACxCA,EAAa,KAAK,oDAAoD,GAC/D;AAAA,QAET,SAAS,IAAIK,MAAgBX,EAAK,WAAW,GAAGW,CAAI;AAAA,QACpD,WAAW,IAAIA,MAAgBX,EAAK,aAAa,GAAGW,CAAI;AAAA,QACxD,WAAW,IAAIA,MAAgBX,EAAK,aAAa,GAAGW,CAAI;AAAA,MAAA;AAG1D,MAAAL,EAAa,MAAM,OAAOC,EAAO,EAAE,GAAG,GACtCD,EAAa,MAAM,OAAO,GAE1BF,EAAQ,QAAQQ,EAAeJ,CAAO,EAAED,CAAM,GAE9CD,EAAa,OAAOE,EAAQ,SAAS,GACjC,CAACd,GAAUD,GAAQ,EAAI,EAAE,SAASe,EAAQ,GAAU,KACtDF,EAAa,IAAI,uBAAuB;AAAA,IAE5C,CAAC,GAEDO,EAAgB,MAAM;AACpB,MAAAT,EAAQ,OAAO,WAAA;AAAA,IACjB,CAAC,GAEDU,EAAa;AAAA,MACX,cAAc,CAACC,MAAmBX,EAAQ,OAAO,aAAaW,CAAM;AAAA,MACpE,QAAQ,MAAMX,EAAQ,OAAO,OAAA;AAAA,MAC7B,aAAa,CAACY,GAAUC,MACtBb,EAAQ,OAAO,YAAYY,GAAKC,CAAM;AAAA,IAAA,CACzC,cA9GDC,KAAAC;AAAAA,MAAiD;AAAA,MAAjDC,EAAiD;AAAA,iBAArC;AAAA,QAAJ,KAAIlB;AAAA,MAAA,GAAoBmB,EAAAA,MAAM;AAAA,MAAA;AAAA,MAAA;AAAA;AAAA,IAAA;AAAA;ICGxCC,IAAe;AAAA,EACb,QAAQC,GAAU;AAChB,IAAAA,EAAI,UAAU,iBAAiBC,CAAa;AAAA,EAC9C;AACF;"}
|
package/index.umd.js
CHANGED
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* @module iframe-resizer/vue 5.5.9 (umd) - 2026-02-06
|
|
5
|
-
*
|
|
6
|
-
* @license GPL-3.0 for non-commercial use only.
|
|
7
|
-
* For commercial use, you must purchase a license from
|
|
8
|
-
* https://iframe-resizer.com/pricing
|
|
9
|
-
*
|
|
10
|
-
* @description Keep same and cross domain iFrames sized to their content
|
|
11
|
-
*
|
|
12
|
-
* @author David J. Bradshaw <info@iframe-resizer.com>
|
|
13
|
-
*
|
|
14
|
-
* @see {@link https://iframe-resizer.com}
|
|
15
|
-
*
|
|
16
|
-
* @copyright (c) 2013 - 2026, David J. Bradshaw. All rights reserved.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("@iframe-resizer/core"),require("auto-console-group"),require("vue")):"function"==typeof define&&define.amd?define(["@iframe-resizer/core","auto-console-group","vue"],r):(e="undefined"!=typeof globalThis?globalThis:e||self).IframeResizer=r(e.connectResizer,e.acg,e.Vue)}(this,function(e,r,o){"use strict";const t="expanded",n="collapsed",i=(s=r,s?.__esModule?s.default:s);var s;const a={name:"IframeResizer",props:{license:{type:String,required:!0},bodyBackground:{type:String},bodyMargin:{type:String},bodyPadding:{type:String},checkOrigin:{type:Boolean,default:!0},direction:{type:String},log:{type:[String,Boolean,Number],validator:e=>{switch(e){case n:case t:case!1:case!0:case-1:return!0;default:return!1}},default:void 0},inPageLinks:{type:Boolean},offset:{type:Number},scrolling:{type:Boolean},tolerance:{type:Number},warningTimeout:{type:Number}},mounted(){const r=this,{iframe:o}=this.$refs,s={...Object.fromEntries(Object.entries(this.$props).filter(([e,r])=>void 0!==r)),waitForLoad:!0,onBeforeClose:()=>(l.event("Blocked Close Event"),l.warn("Close method is disabled, use Vue to remove iframe"),!1),onReady:(...e)=>r.$emit("onReady",...e),onMessage:(...e)=>r.$emit("onMessage",...e),onResized:(...e)=>r.$emit("onResized",...e)},a=e(s);r.resizer=a(o);const d={label:`vue(${o.id})`,expand:s.logExpand},l=i(d);l.event("setup"),[n,t,!0].includes(s.log)&&l.log("Created Vue component")},beforeUnmount(){this.resizer?.disconnect()},methods:{moveToAnchor(e){this.resizer.moveToAnchor(e)},resize(){this.resizer.resize()},sendMessage(e,r){this.resizer.sendMessage(e,r)}}};a.render=function(e,r,t,n,i,s){return o.openBlock(),o.createElementBlock("iframe",o.mergeProps({ref:"iframe"},e.$attrs),null,16)},a.__file="./iframe-resizer.vue";return{install(e){e.component("IframeResizer",a)}}});
|
|
1
|
+
(function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("vue"),require("@iframe-resizer/core"),require("auto-console-group")):typeof define=="function"&&define.amd?define(["vue","@iframe-resizer/core","auto-console-group"],r):(e=typeof globalThis<"u"?globalThis:e||self,e.IframeResizer=r(e.Vue,e.connectResizer,e.acg))})(this,(function(e,r,f){"use strict";const u="expanded",d="collapsed",m=e.defineComponent({name:"IframeResizer",__name:"iframe-resizer",props:{license:{type:String,required:!0},bodyBackground:String,bodyMargin:String,bodyPadding:String,checkOrigin:{type:Boolean,default:!0},direction:String,log:{type:[String,Boolean,Number],validator:t=>{switch(t){case d:case u:case!1:case!0:case-1:case 0:case 1:case 2:return!0;default:return!1}},default:void 0},inPageLinks:Boolean,offset:Number,scrolling:Boolean,tolerance:Number,warningTimeout:Number},emits:["onReady","onMessage","onResized"],setup(t,{expose:p,emit:g}){const z=(o=>o?.__esModule?o.default:o)(f),R=t,a=g,l=e.ref(null),s=e.ref(null);return e.onMounted(()=>{const o=z(),i=l.value,c={...Object.fromEntries(Object.entries(e.toRaw(R)).filter(([,n])=>n!==void 0)),waitForLoad:!0,onBeforeClose:()=>(o.event("Blocked Close Event"),o.warn("Close method is disabled, use Vue to remove iframe"),!1),onReady:(...n)=>a("onReady",...n),onMessage:(...n)=>a("onMessage",...n),onResized:(...n)=>a("onResized",...n)};o.label(`vue(${i.id})`),o.event("setup"),s.value=r(c)(i),o.expand(c.logExpand),[d,u,!0].includes(c.log)&&o.log("Created Vue component")}),e.onBeforeUnmount(()=>{s.value?.disconnect()}),p({moveToAnchor:o=>s.value?.moveToAnchor(o),resize:()=>s.value?.resize(),sendMessage:(o,i)=>s.value?.sendMessage(o,i)}),(o,i)=>(e.openBlock(),e.createElementBlock("iframe",e.mergeProps({ref_key:"iframeRef",ref:l},o.$attrs),null,16))}});return{install(t){t.component("IframeResizer",m)}}}));
|
|
2
|
+
//# sourceMappingURL=index.umd.js.map
|
package/index.umd.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../../packages/vue/iframe-resizer.vue","../../packages/vue/index.ts"],"sourcesContent":["<template>\n <iframe ref=\"iframeRef\" v-bind=\"$attrs\"></iframe>\n</template>\n\n<script setup lang=\"ts\">\n import { onBeforeUnmount, onMounted, ref, toRaw } from 'vue'\n import type { PropType } from 'vue'\n import connectResizer from '@iframe-resizer/core'\n import type { IFrameObject, LogOption } from '@iframe-resizer/core'\n import acg from 'auto-console-group'\n\n const EXPAND = 'expanded'\n const COLLAPSE = 'collapsed'\n\n const esModuleInterop = (mod: any) =>\n // eslint-disable-next-line no-underscore-dangle\n mod?.__esModule ? mod.default : mod\n\n // Deal with UMD not converting default exports to named exports\n const createAutoConsoleGroup = esModuleInterop(acg)\n\n defineOptions({ name: 'IframeResizer' })\n\n const props = defineProps({\n license: {\n type: String,\n required: true,\n },\n bodyBackground: String,\n bodyMargin: String,\n bodyPadding: String,\n checkOrigin: {\n type: Boolean,\n default: true,\n },\n direction: String,\n log: {\n type: [String, Boolean, Number] as PropType<LogOption>,\n validator: (value: LogOption) => {\n switch (value) {\n case COLLAPSE:\n case EXPAND:\n case false:\n case true:\n case -1:\n case 0:\n case 1:\n case 2:\n return true\n default:\n return false\n }\n },\n default: undefined,\n },\n inPageLinks: Boolean,\n offset: Number,\n scrolling: Boolean,\n tolerance: Number,\n warningTimeout: Number,\n })\n\n const emit = defineEmits<{\n onReady: [...args: any[]]\n onMessage: [...args: any[]]\n onResized: [...args: any[]]\n }>()\n\n const iframeRef = ref<HTMLIFrameElement | null>(null)\n const resizer = ref<IFrameObject | null>(null)\n\n onMounted(() => {\n const consoleGroup = createAutoConsoleGroup()\n // Template refs are guaranteed populated before onMounted fires\n const iframe = iframeRef.value!\n const options: any = {\n ...Object.fromEntries(\n Object.entries(toRaw(props)).filter(([, value]) => value !== undefined),\n ),\n waitForLoad: true,\n\n onBeforeClose: () => {\n consoleGroup.event('Blocked Close Event')\n consoleGroup.warn('Close method is disabled, use Vue to remove iframe')\n return false\n },\n onReady: (...args: any[]) => emit('onReady', ...args),\n onMessage: (...args: any[]) => emit('onMessage', ...args),\n onResized: (...args: any[]) => emit('onResized', ...args),\n }\n\n consoleGroup.label(`vue(${iframe.id})`)\n consoleGroup.event('setup')\n\n resizer.value = connectResizer(options)(iframe)\n\n consoleGroup.expand(options.logExpand)\n if ([COLLAPSE, EXPAND, true].includes(options.log as any)) {\n consoleGroup.log('Created Vue component')\n }\n })\n\n onBeforeUnmount(() => {\n resizer.value?.disconnect()\n })\n\n defineExpose({\n moveToAnchor: (anchor: string) => resizer.value?.moveToAnchor(anchor),\n resize: () => resizer.value?.resize(),\n sendMessage: (msg: any, target?: string) =>\n resizer.value?.sendMessage(msg, target),\n })\n</script>\n","import type { App } from 'vue'\n\nimport IframeResizer from './iframe-resizer.vue'\n\nexport default {\n install(app: App) {\n app.component('IframeResizer', IframeResizer)\n },\n}\n"],"names":["EXPAND","COLLAPSE","createAutoConsoleGroup","mod","acg","props","__props","emit","__emit","iframeRef","ref","resizer","onMounted","consoleGroup","iframe","options","toRaw","value","args","connectResizer","onBeforeUnmount","__expose","anchor","msg","target","_openBlock","_createElementBlock","_mergeProps","$attrs","app","IframeResizer"],"mappings":"gYAWE,MAAMA,EAAS,WACTC,EAAW,wiBAOjB,MAAMC,GALmBC,GAEvBA,GAAK,WAAaA,EAAI,QAAUA,GAGaC,CAAG,EAI5CC,EAAQC,EAuCRC,EAAOC,EAMPC,EAAYC,EAAAA,IAA8B,IAAI,EAC9CC,EAAUD,EAAAA,IAAyB,IAAI,EAE7CE,OAAAA,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAeX,EAAA,EAEfY,EAASL,EAAU,MACnBM,EAAe,CACnB,GAAG,OAAO,YACR,OAAO,QAAQC,EAAAA,MAAMX,CAAK,CAAC,EAAE,OAAO,CAAC,CAAA,CAAGY,CAAK,IAAMA,IAAU,MAAS,CAAA,EAExE,YAAa,GAEb,cAAe,KACbJ,EAAa,MAAM,qBAAqB,EACxCA,EAAa,KAAK,oDAAoD,EAC/D,IAET,QAAS,IAAIK,IAAgBX,EAAK,UAAW,GAAGW,CAAI,EACpD,UAAW,IAAIA,IAAgBX,EAAK,YAAa,GAAGW,CAAI,EACxD,UAAW,IAAIA,IAAgBX,EAAK,YAAa,GAAGW,CAAI,CAAA,EAG1DL,EAAa,MAAM,OAAOC,EAAO,EAAE,GAAG,EACtCD,EAAa,MAAM,OAAO,EAE1BF,EAAQ,MAAQQ,EAAeJ,CAAO,EAAED,CAAM,EAE9CD,EAAa,OAAOE,EAAQ,SAAS,EACjC,CAACd,EAAUD,EAAQ,EAAI,EAAE,SAASe,EAAQ,GAAU,GACtDF,EAAa,IAAI,uBAAuB,CAE5C,CAAC,EAEDO,EAAAA,gBAAgB,IAAM,CACpBT,EAAQ,OAAO,WAAA,CACjB,CAAC,EAEDU,EAAa,CACX,aAAeC,GAAmBX,EAAQ,OAAO,aAAaW,CAAM,EACpE,OAAQ,IAAMX,EAAQ,OAAO,OAAA,EAC7B,YAAa,CAACY,EAAUC,IACtBb,EAAQ,OAAO,YAAYY,EAAKC,CAAM,CAAA,CACzC,UA9GDC,EAAAA,YAAAC,EAAAA,mBAAiD,SAAjDC,aAAiD,SAArC,YAAJ,IAAIlB,CAAA,EAAoBmB,EAAAA,MAAM,EAAA,KAAA,EAAA,YCGzB,CACb,QAAQC,EAAU,CAChBA,EAAI,UAAU,gBAAiBC,CAAa,CAC9C,CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iframe-resizer/vue",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-beta.1",
|
|
4
4
|
"license": "GPL-3.0",
|
|
5
5
|
"homepage": "https://iframe-resizer.com",
|
|
6
6
|
"author": {
|
|
@@ -19,11 +19,12 @@
|
|
|
19
19
|
},
|
|
20
20
|
"main": "index.umd.js",
|
|
21
21
|
"module": "index.esm.js",
|
|
22
|
+
"types": "index.d.ts",
|
|
22
23
|
"browser": {
|
|
23
24
|
"./sfc": "iframe-resizer.vue"
|
|
24
25
|
},
|
|
25
26
|
"peerDependencies": {
|
|
26
|
-
"vue": "^
|
|
27
|
+
"vue": "^3.3.0"
|
|
27
28
|
},
|
|
28
29
|
"keywords": [
|
|
29
30
|
"iframe",
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
"vue"
|
|
40
41
|
],
|
|
41
42
|
"dependencies": {
|
|
42
|
-
"@iframe-resizer/core": "
|
|
43
|
+
"@iframe-resizer/core": "6.0.0-beta.1",
|
|
43
44
|
"auto-console-group": "1.3.0"
|
|
44
45
|
}
|
|
45
|
-
}
|
|
46
|
+
}
|