@iframe-resizer/vue 5.5.9-beta.1 → 6.0.0-beta.0
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 +36 -21
- package/iframe-resizer.vue.d.ts +41 -0
- package/index.cjs.js +2 -160
- package/index.cjs.js.map +1 -0
- package/index.d.ts +7 -0
- package/index.esm.js +123 -151
- package/index.esm.js.map +1 -0
- package/index.umd.js +1 -20
- package/index.umd.js.map +1 -1
- package/package.json +4 -3
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
|
@@ -2,14 +2,18 @@
|
|
|
2
2
|
<iframe ref="iframe" v-bind="$attrs"></iframe>
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
|
-
<script>
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import type { PropType } from 'vue'
|
|
6
7
|
import connectResizer from '@iframe-resizer/core'
|
|
8
|
+
import type { IFrameObject } from '@iframe-resizer/core'
|
|
7
9
|
import acg from 'auto-console-group'
|
|
8
10
|
|
|
9
11
|
const EXPAND = 'expanded'
|
|
10
12
|
const COLLAPSE = 'collapsed'
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
type LogOption = 'expanded' | 'collapsed' | boolean | -1
|
|
15
|
+
|
|
16
|
+
const esModuleInterop = (mod: any) =>
|
|
13
17
|
// eslint-disable-next-line no-underscore-dangle
|
|
14
18
|
mod?.__esModule ? mod.default : mod
|
|
15
19
|
|
|
@@ -22,7 +26,7 @@
|
|
|
22
26
|
props: {
|
|
23
27
|
license: {
|
|
24
28
|
type: String,
|
|
25
|
-
required: true
|
|
29
|
+
required: true,
|
|
26
30
|
},
|
|
27
31
|
bodyBackground: {
|
|
28
32
|
type: String,
|
|
@@ -41,8 +45,8 @@
|
|
|
41
45
|
type: String,
|
|
42
46
|
},
|
|
43
47
|
log: {
|
|
44
|
-
type: [String, Boolean, Number]
|
|
45
|
-
validator: (value) => {
|
|
48
|
+
type: [String, Boolean, Number] as PropType<LogOption>,
|
|
49
|
+
validator: (value: LogOption) => {
|
|
46
50
|
switch (value) {
|
|
47
51
|
case COLLAPSE:
|
|
48
52
|
case EXPAND:
|
|
@@ -73,14 +77,20 @@
|
|
|
73
77
|
},
|
|
74
78
|
},
|
|
75
79
|
|
|
80
|
+
data() {
|
|
81
|
+
return {
|
|
82
|
+
resizer: null as IFrameObject | null,
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
|
|
76
86
|
mounted() {
|
|
77
87
|
const self = this
|
|
78
|
-
const { iframe } = this.$refs
|
|
79
|
-
const options = {
|
|
88
|
+
const { iframe } = this.$refs as { iframe: HTMLIFrameElement }
|
|
89
|
+
const options: any = {
|
|
80
90
|
...Object.fromEntries(
|
|
81
|
-
Object
|
|
82
|
-
|
|
83
|
-
|
|
91
|
+
Object.entries(this.$props).filter(
|
|
92
|
+
([key, value]) => value !== undefined
|
|
93
|
+
)
|
|
84
94
|
),
|
|
85
95
|
waitForLoad: true,
|
|
86
96
|
|
|
@@ -89,9 +99,9 @@
|
|
|
89
99
|
consoleGroup.warn('Close method is disabled, use Vue to remove iframe')
|
|
90
100
|
return false
|
|
91
101
|
},
|
|
92
|
-
onReady: (...args) => self.$emit('onReady', ...args),
|
|
93
|
-
onMessage: (...args) => self.$emit('onMessage', ...args),
|
|
94
|
-
onResized: (...args) => self.$emit('onResized', ...args),
|
|
102
|
+
onReady: (...args: any[]) => self.$emit('onReady', ...args),
|
|
103
|
+
onMessage: (...args: any[]) => self.$emit('onMessage', ...args),
|
|
104
|
+
onResized: (...args: any[]) => self.$emit('onResized', ...args),
|
|
95
105
|
}
|
|
96
106
|
|
|
97
107
|
const connectWithOptions = connectResizer(options)
|
|
@@ -99,32 +109,37 @@
|
|
|
99
109
|
|
|
100
110
|
const consoleOptions = {
|
|
101
111
|
label: `vue(${iframe.id})`,
|
|
102
|
-
expand: options.logExpand, // set inside connectResizer
|
|
112
|
+
expand: (options as any).logExpand, // set inside connectResizer
|
|
103
113
|
}
|
|
104
114
|
|
|
105
115
|
const consoleGroup = createAutoConsoleGroup(consoleOptions)
|
|
106
116
|
consoleGroup.event('setup')
|
|
107
117
|
|
|
108
|
-
if ([COLLAPSE, EXPAND, true].includes(options.log)) {
|
|
118
|
+
if ([COLLAPSE, EXPAND, true].includes(options.log as any)) {
|
|
109
119
|
consoleGroup.log('Created Vue component')
|
|
110
120
|
}
|
|
111
121
|
},
|
|
112
122
|
|
|
123
|
+
// Vue 2 lifecycle hook
|
|
124
|
+
beforeDestroy() {
|
|
125
|
+
this.resizer?.disconnect()
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
// Vue 3 lifecycle hook
|
|
113
129
|
beforeUnmount() {
|
|
114
130
|
this.resizer?.disconnect()
|
|
115
131
|
},
|
|
116
132
|
|
|
117
133
|
methods: {
|
|
118
|
-
moveToAnchor(anchor) {
|
|
119
|
-
this.resizer
|
|
134
|
+
moveToAnchor(anchor: string) {
|
|
135
|
+
this.resizer?.moveToAnchor(anchor)
|
|
120
136
|
},
|
|
121
137
|
resize() {
|
|
122
|
-
this.resizer
|
|
138
|
+
this.resizer?.resize()
|
|
123
139
|
},
|
|
124
|
-
sendMessage(msg, target) {
|
|
125
|
-
this.resizer
|
|
140
|
+
sendMessage(msg: any, target?: string) {
|
|
141
|
+
this.resizer?.sendMessage(msg, target)
|
|
126
142
|
},
|
|
127
143
|
},
|
|
128
144
|
}
|
|
129
|
-
|
|
130
145
|
</script>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DefineComponent } from 'vue'
|
|
2
|
+
|
|
3
|
+
export interface IframeResizerProps {
|
|
4
|
+
license: string
|
|
5
|
+
bodyBackground?: string
|
|
6
|
+
bodyMargin?: string
|
|
7
|
+
bodyPadding?: string
|
|
8
|
+
checkOrigin?: boolean
|
|
9
|
+
direction?: string
|
|
10
|
+
log?: 'expanded' | 'collapsed' | boolean | number
|
|
11
|
+
inPageLinks?: boolean
|
|
12
|
+
offset?: number
|
|
13
|
+
scrolling?: boolean
|
|
14
|
+
tolerance?: number
|
|
15
|
+
warningTimeout?: number
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface IframeResizerMethods {
|
|
19
|
+
moveToAnchor(anchor: string): void
|
|
20
|
+
resize(): void
|
|
21
|
+
sendMessage(msg: any, target?: string): void
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface IframeResizerEmits {
|
|
25
|
+
onReady: (...args: any[]) => void
|
|
26
|
+
onMessage: (...args: any[]) => void
|
|
27
|
+
onResized: (...args: any[]) => void
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare const IframeResizer: DefineComponent<
|
|
31
|
+
IframeResizerProps,
|
|
32
|
+
IframeResizerMethods,
|
|
33
|
+
{},
|
|
34
|
+
{},
|
|
35
|
+
{},
|
|
36
|
+
{},
|
|
37
|
+
{},
|
|
38
|
+
IframeResizerEmits
|
|
39
|
+
>
|
|
40
|
+
|
|
41
|
+
export default IframeResizer
|
package/index.cjs.js
CHANGED
|
@@ -1,160 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* @module iframe-resizer/vue 5.5.9-beta.1 (cjs) - 2026-02-05
|
|
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 d=require("@iframe-resizer/core"),p=require("auto-console-group"),c=require("vue"),a="expanded",l="collapsed",f=e=>e?.__esModule?e.default:e,m=f(p),g={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 l:case a: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}},data(){return{resizer:null}},mounted(){const e=this,{iframe:t}=this.$refs,o={...Object.fromEntries(Object.entries(this.$props).filter(([r,u])=>u!==void 0)),waitForLoad:!0,onBeforeClose:()=>(s.event("Blocked Close Event"),s.warn("Close method is disabled, use Vue to remove iframe"),!1),onReady:(...r)=>e.$emit("onReady",...r),onMessage:(...r)=>e.$emit("onMessage",...r),onResized:(...r)=>e.$emit("onResized",...r)},n=d(o);e.resizer=n(t);const i={label:`vue(${t.id})`,expand:o.logExpand},s=m(i);s.event("setup"),[l,a,!0].includes(o.log)&&s.log("Created Vue component")},beforeDestroy(){this.resizer?.disconnect()},beforeUnmount(){this.resizer?.disconnect()},methods:{moveToAnchor(e){this.resizer?.moveToAnchor(e)},resize(){this.resizer?.resize()},sendMessage(e,t){this.resizer?.sendMessage(e,t)}}},y=(e,t)=>{const o=e.__vccOpts||e;for(const[n,i]of t)o[n]=i;return o};function h(e,t,o,n,i,s){return c.openBlock(),c.createElementBlock("iframe",c.mergeProps({ref:"iframe"},e.$attrs),null,16)}const z=y(g,[["render",h]]),b={install(e){e.component("IframeResizer",z)}};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=\"iframe\" v-bind=\"$attrs\"></iframe>\n</template>\n\n<script lang=\"ts\">\n import type { PropType } from 'vue'\n import connectResizer from '@iframe-resizer/core'\n import type { IFrameObject } from '@iframe-resizer/core'\n import acg from 'auto-console-group'\n\n const EXPAND = 'expanded'\n const COLLAPSE = 'collapsed'\n\n type LogOption = 'expanded' | 'collapsed' | boolean | -1\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 export default {\n name: 'IframeResizer',\n\n props: {\n license: {\n type: String,\n required: true,\n },\n bodyBackground: {\n type: String,\n },\n bodyMargin: {\n type: String,\n },\n bodyPadding: {\n type: String,\n },\n checkOrigin: {\n type: Boolean,\n default: true,\n },\n direction: {\n type: String,\n },\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 return true\n default:\n return false\n }\n },\n default: undefined,\n },\n inPageLinks: {\n type: Boolean,\n },\n offset: {\n type: Number,\n },\n scrolling: {\n type: Boolean,\n },\n tolerance: {\n type: Number,\n },\n warningTimeout: {\n type: Number,\n },\n },\n\n data() {\n return {\n resizer: null as IFrameObject | null,\n }\n },\n\n mounted() {\n const self = this\n const { iframe } = this.$refs as { iframe: HTMLIFrameElement }\n const options: any = {\n ...Object.fromEntries(\n Object.entries(this.$props).filter(\n ([key, value]) => value !== undefined\n )\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[]) => self.$emit('onReady', ...args),\n onMessage: (...args: any[]) => self.$emit('onMessage', ...args),\n onResized: (...args: any[]) => self.$emit('onResized', ...args),\n }\n\n const connectWithOptions = connectResizer(options)\n self.resizer = connectWithOptions(iframe)\n\n const consoleOptions = {\n label: `vue(${iframe.id})`,\n expand: (options as any).logExpand, // set inside connectResizer\n }\n\n const consoleGroup = createAutoConsoleGroup(consoleOptions)\n consoleGroup.event('setup')\n\n if ([COLLAPSE, EXPAND, true].includes(options.log as any)) {\n consoleGroup.log('Created Vue component')\n }\n },\n\n // Vue 2 lifecycle hook\n beforeDestroy() {\n this.resizer?.disconnect()\n },\n\n // Vue 3 lifecycle hook\n beforeUnmount() {\n this.resizer?.disconnect()\n },\n\n methods: {\n moveToAnchor(anchor: string) {\n this.resizer?.moveToAnchor(anchor)\n },\n resize() {\n this.resizer?.resize()\n },\n sendMessage(msg: any, target?: string) {\n this.resizer?.sendMessage(msg, target)\n },\n },\n }\n</script>\n","import IframeResizer from './iframe-resizer.vue'\n\n// Duck-typed interface compatible with both Vue 2 and Vue 3\ninterface VueApp {\n component: (name: string, component: any) => void\n}\n\nexport default {\n install(app: VueApp) {\n app.component('IframeResizer', IframeResizer)\n },\n}\n"],"names":["EXPAND","COLLAPSE","esModuleInterop","mod","createAutoConsoleGroup","acg","_sfc_main","value","self","iframe","options","key","consoleGroup","args","connectWithOptions","connectResizer","consoleOptions","anchor","msg","target","_openBlock","_createElementBlock","_mergeProps","_ctx","index","app","IframeResizer"],"mappings":"sGAUQA,EAAS,WACTC,EAAW,YAIXC,EAAmBC,GAEvBA,GAAK,WAAaA,EAAI,QAAUA,EAG5BC,EAAyBF,EAAgBG,CAAG,EAElDC,EAAe,CACb,KAAM,gBAEN,MAAO,CACL,QAAS,CACP,KAAM,OACN,SAAU,EAAA,EAEZ,eAAgB,CACd,KAAM,MAAA,EAER,WAAY,CACV,KAAM,MAAA,EAER,YAAa,CACX,KAAM,MAAA,EAER,YAAa,CACX,KAAM,QACN,QAAS,EAAA,EAEX,UAAW,CACT,KAAM,MAAA,EAER,IAAK,CACH,KAAM,CAAC,OAAQ,QAAS,MAAM,EAC9B,UAAYC,GAAqB,CAC/B,OAAQA,EAAA,CACN,KAAKN,EACL,KAAKD,EACL,IAAK,GACL,IAAK,GACL,IAAK,GACH,MAAO,GACT,QACE,MAAO,EAAA,CAEb,EACA,QAAS,MAAA,EAEX,YAAa,CACX,KAAM,OAAA,EAER,OAAQ,CACN,KAAM,MAAA,EAER,UAAW,CACT,KAAM,OAAA,EAER,UAAW,CACT,KAAM,MAAA,EAER,eAAgB,CACd,KAAM,MAAA,CACR,EAGF,MAAO,CACL,MAAO,CACL,QAAS,IAAA,CAEb,EAEA,SAAU,CACR,MAAMQ,EAAO,KACP,CAA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.js
CHANGED
|
@@ -1,158 +1,130 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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 d from "@iframe-resizer/core";
|
|
2
|
+
import p from "auto-console-group";
|
|
3
|
+
import { openBlock as u, createElementBlock as f, mergeProps as m } from "vue";
|
|
4
|
+
const a = "expanded", c = "collapsed", g = (e) => (
|
|
5
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
6
|
+
e?.__esModule ? e.default : e
|
|
7
|
+
), y = g(p), h = {
|
|
8
|
+
name: "IframeResizer",
|
|
9
|
+
props: {
|
|
10
|
+
license: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: !0
|
|
89
13
|
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const self = this;
|
|
93
|
-
const { iframe } = this.$refs;
|
|
94
|
-
const options = {
|
|
95
|
-
...Object.fromEntries(
|
|
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
|
-
}
|
|
14
|
+
bodyBackground: {
|
|
15
|
+
type: String
|
|
126
16
|
},
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
this.resizer?.disconnect();
|
|
17
|
+
bodyMargin: {
|
|
18
|
+
type: String
|
|
130
19
|
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
20
|
+
bodyPadding: {
|
|
21
|
+
type: String
|
|
22
|
+
},
|
|
23
|
+
checkOrigin: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !0
|
|
26
|
+
},
|
|
27
|
+
direction: {
|
|
28
|
+
type: String
|
|
29
|
+
},
|
|
30
|
+
log: {
|
|
31
|
+
type: [String, Boolean, Number],
|
|
32
|
+
validator: (e) => {
|
|
33
|
+
switch (e) {
|
|
34
|
+
case c:
|
|
35
|
+
case a:
|
|
36
|
+
case !1:
|
|
37
|
+
case !0:
|
|
38
|
+
case -1:
|
|
39
|
+
return !0;
|
|
40
|
+
default:
|
|
41
|
+
return !1;
|
|
42
|
+
}
|
|
141
43
|
},
|
|
44
|
+
default: void 0
|
|
142
45
|
},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
46
|
+
inPageLinks: {
|
|
47
|
+
type: Boolean
|
|
48
|
+
},
|
|
49
|
+
offset: {
|
|
50
|
+
type: Number
|
|
51
|
+
},
|
|
52
|
+
scrolling: {
|
|
53
|
+
type: Boolean
|
|
54
|
+
},
|
|
55
|
+
tolerance: {
|
|
56
|
+
type: Number
|
|
57
|
+
},
|
|
58
|
+
warningTimeout: {
|
|
59
|
+
type: Number
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
data() {
|
|
63
|
+
return {
|
|
64
|
+
resizer: null
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
mounted() {
|
|
68
|
+
const e = this, { iframe: t } = this.$refs, o = {
|
|
69
|
+
...Object.fromEntries(
|
|
70
|
+
Object.entries(this.$props).filter(
|
|
71
|
+
([r, l]) => l !== void 0
|
|
72
|
+
)
|
|
73
|
+
),
|
|
74
|
+
waitForLoad: !0,
|
|
75
|
+
onBeforeClose: () => (n.event("Blocked Close Event"), n.warn("Close method is disabled, use Vue to remove iframe"), !1),
|
|
76
|
+
onReady: (...r) => e.$emit("onReady", ...r),
|
|
77
|
+
onMessage: (...r) => e.$emit("onMessage", ...r),
|
|
78
|
+
onResized: (...r) => e.$emit("onResized", ...r)
|
|
79
|
+
}, s = d(o);
|
|
80
|
+
e.resizer = s(t);
|
|
81
|
+
const i = {
|
|
82
|
+
label: `vue(${t.id})`,
|
|
83
|
+
expand: o.logExpand
|
|
84
|
+
// set inside connectResizer
|
|
85
|
+
}, n = y(i);
|
|
86
|
+
n.event("setup"), [c, a, !0].includes(o.log) && n.log("Created Vue component");
|
|
155
87
|
},
|
|
88
|
+
// Vue 2 lifecycle hook
|
|
89
|
+
beforeDestroy() {
|
|
90
|
+
this.resizer?.disconnect();
|
|
91
|
+
},
|
|
92
|
+
// Vue 3 lifecycle hook
|
|
93
|
+
beforeUnmount() {
|
|
94
|
+
this.resizer?.disconnect();
|
|
95
|
+
},
|
|
96
|
+
methods: {
|
|
97
|
+
moveToAnchor(e) {
|
|
98
|
+
this.resizer?.moveToAnchor(e);
|
|
99
|
+
},
|
|
100
|
+
resize() {
|
|
101
|
+
this.resizer?.resize();
|
|
102
|
+
},
|
|
103
|
+
sendMessage(e, t) {
|
|
104
|
+
this.resizer?.sendMessage(e, t);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}, z = (e, t) => {
|
|
108
|
+
const o = e.__vccOpts || e;
|
|
109
|
+
for (const [s, i] of t)
|
|
110
|
+
o[s] = i;
|
|
111
|
+
return o;
|
|
112
|
+
};
|
|
113
|
+
function b(e, t, o, s, i, n) {
|
|
114
|
+
return u(), f(
|
|
115
|
+
"iframe",
|
|
116
|
+
m({ ref: "iframe" }, e.$attrs),
|
|
117
|
+
null,
|
|
118
|
+
16
|
|
119
|
+
/* FULL_PROPS */
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
const v = /* @__PURE__ */ z(h, [["render", b]]), k = {
|
|
123
|
+
install(e) {
|
|
124
|
+
e.component("IframeResizer", v);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
export {
|
|
128
|
+
k as default
|
|
156
129
|
};
|
|
157
|
-
|
|
158
|
-
export { index as default };
|
|
130
|
+
//# 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=\"iframe\" v-bind=\"$attrs\"></iframe>\n</template>\n\n<script lang=\"ts\">\n import type { PropType } from 'vue'\n import connectResizer from '@iframe-resizer/core'\n import type { IFrameObject } from '@iframe-resizer/core'\n import acg from 'auto-console-group'\n\n const EXPAND = 'expanded'\n const COLLAPSE = 'collapsed'\n\n type LogOption = 'expanded' | 'collapsed' | boolean | -1\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 export default {\n name: 'IframeResizer',\n\n props: {\n license: {\n type: String,\n required: true,\n },\n bodyBackground: {\n type: String,\n },\n bodyMargin: {\n type: String,\n },\n bodyPadding: {\n type: String,\n },\n checkOrigin: {\n type: Boolean,\n default: true,\n },\n direction: {\n type: String,\n },\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 return true\n default:\n return false\n }\n },\n default: undefined,\n },\n inPageLinks: {\n type: Boolean,\n },\n offset: {\n type: Number,\n },\n scrolling: {\n type: Boolean,\n },\n tolerance: {\n type: Number,\n },\n warningTimeout: {\n type: Number,\n },\n },\n\n data() {\n return {\n resizer: null as IFrameObject | null,\n }\n },\n\n mounted() {\n const self = this\n const { iframe } = this.$refs as { iframe: HTMLIFrameElement }\n const options: any = {\n ...Object.fromEntries(\n Object.entries(this.$props).filter(\n ([key, value]) => value !== undefined\n )\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[]) => self.$emit('onReady', ...args),\n onMessage: (...args: any[]) => self.$emit('onMessage', ...args),\n onResized: (...args: any[]) => self.$emit('onResized', ...args),\n }\n\n const connectWithOptions = connectResizer(options)\n self.resizer = connectWithOptions(iframe)\n\n const consoleOptions = {\n label: `vue(${iframe.id})`,\n expand: (options as any).logExpand, // set inside connectResizer\n }\n\n const consoleGroup = createAutoConsoleGroup(consoleOptions)\n consoleGroup.event('setup')\n\n if ([COLLAPSE, EXPAND, true].includes(options.log as any)) {\n consoleGroup.log('Created Vue component')\n }\n },\n\n // Vue 2 lifecycle hook\n beforeDestroy() {\n this.resizer?.disconnect()\n },\n\n // Vue 3 lifecycle hook\n beforeUnmount() {\n this.resizer?.disconnect()\n },\n\n methods: {\n moveToAnchor(anchor: string) {\n this.resizer?.moveToAnchor(anchor)\n },\n resize() {\n this.resizer?.resize()\n },\n sendMessage(msg: any, target?: string) {\n this.resizer?.sendMessage(msg, target)\n },\n },\n }\n</script>\n","import IframeResizer from './iframe-resizer.vue'\n\n// Duck-typed interface compatible with both Vue 2 and Vue 3\ninterface VueApp {\n component: (name: string, component: any) => void\n}\n\nexport default {\n install(app: VueApp) {\n app.component('IframeResizer', IframeResizer)\n },\n}\n"],"names":["EXPAND","COLLAPSE","esModuleInterop","mod","createAutoConsoleGroup","acg","_sfc_main","value","self","iframe","options","key","consoleGroup","args","connectWithOptions","connectResizer","consoleOptions","anchor","msg","target","_openBlock","_createElementBlock","_mergeProps","_ctx","index","app","IframeResizer"],"mappings":";;;AAUE,MAAMA,IAAS,YACTC,IAAW,aAIXC,IAAkB,CAACC;AAAA;AAAA,EAEvBA,GAAK,aAAaA,EAAI,UAAUA;AAAA,GAG5BC,IAAyBF,EAAgBG,CAAG,GAElDC,IAAe;AAAA,EACb,MAAM;AAAA,EAEN,OAAO;AAAA,IACL,SAAS;AAAA,MACP,MAAM;AAAA,MACN,UAAU;AAAA,IAAA;AAAA,IAEZ,gBAAgB;AAAA,MACd,MAAM;AAAA,IAAA;AAAA,IAER,YAAY;AAAA,MACV,MAAM;AAAA,IAAA;AAAA,IAER,aAAa;AAAA,MACX,MAAM;AAAA,IAAA;AAAA,IAER,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA,IAAA;AAAA,IAEX,WAAW;AAAA,MACT,MAAM;AAAA,IAAA;AAAA,IAER,KAAK;AAAA,MACH,MAAM,CAAC,QAAQ,SAAS,MAAM;A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AAAA,IAAA,GAGrBE,IAAeR,EAAuBY,CAAc;AAC1D,IAAAJ,EAAa,MAAM,OAAO,GAEtB,CAACX,GAAUD,GAAQ,EAAI,EAAE,SAASU,EAAQ,GAAU,KACtDE,EAAa,IAAI,uBAAuB;AAAA,EAE5C;AAAA;AAAA,EAGA,gBAAgB;AACd,SAAK,SAAS,WAAA;AAAA,EAChB;AAAA;AAAA,EAGA,gBAAgB;AACd,SAAK,SAAS,WAAA;AAAA,EAChB;AAAA,EAEA,SAAS;AAAA,IACP,aAAaK,GAAgB;AAC3B,WAAK,SAAS,aAAaA,CAAM;AAAA,IACnC;AAAA,IACA,SAAS;AACP,WAAK,SAAS,OAAA;AAAA,IAChB;AAAA,IACA,YAAYC,GAAUC,GAAiB;AACrC,WAAK,SAAS,YAAYD,GAAKC,CAAM;AAAA,IACvC;AAAA,EAAA;AAEJ;;;;;;;AA9IA,SAAAC,EAAA,GAAAC;AAAAA,IAA8C;AAAA,IAA9CC,EAA8C,EAAtC,KAAI,SAAA,GAAiBC,EAAA,MAAM;AAAA,IAAA;AAAA,IAAA;AAAA;AAAA,EAAA;;iDCMrCC,IAAe;AAAA,EACb,QAAQC,GAAa;AACnB,IAAAA,EAAI,UAAU,iBAAiBC,CAAa;AAAA,EAC9C;AACF;"}
|
package/index.umd.js
CHANGED
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* @preserve
|
|
3
|
-
*
|
|
4
|
-
* @module iframe-resizer/vue 5.5.9-beta.1 (umd) - 2026-02-05
|
|
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(t,s){typeof exports=="object"&&typeof module<"u"?module.exports=s(require("@iframe-resizer/core"),require("auto-console-group"),require("vue")):typeof define=="function"&&define.amd?define(["@iframe-resizer/core","auto-console-group","vue"],s):(t=typeof globalThis<"u"?globalThis:t||self,t.IframeResizer=s(t.connectResizer,t.acg,t.Vue))})(this,(function(t,s,u){"use strict";const d="expanded",l="collapsed",p=(e=>e?.__esModule?e.default:e)(s),f={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 l:case d: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}},data(){return{resizer:null}},mounted(){const e=this,{iframe:o}=this.$refs,r={...Object.fromEntries(Object.entries(this.$props).filter(([n,h])=>h!==void 0)),waitForLoad:!0,onBeforeClose:()=>(i.event("Blocked Close Event"),i.warn("Close method is disabled, use Vue to remove iframe"),!1),onReady:(...n)=>e.$emit("onReady",...n),onMessage:(...n)=>e.$emit("onMessage",...n),onResized:(...n)=>e.$emit("onResized",...n)},c=t(r);e.resizer=c(o);const a={label:`vue(${o.id})`,expand:r.logExpand},i=p(a);i.event("setup"),[l,d,!0].includes(r.log)&&i.log("Created Vue component")},beforeDestroy(){this.resizer?.disconnect()},beforeUnmount(){this.resizer?.disconnect()},methods:{moveToAnchor(e){this.resizer?.moveToAnchor(e)},resize(){this.resizer?.resize()},sendMessage(e,o){this.resizer?.sendMessage(e,o)}}},m=(e,o)=>{const r=e.__vccOpts||e;for(const[c,a]of o)r[c]=a;return r};function g(e,o,r,c,a,i){return u.openBlock(),u.createElementBlock("iframe",u.mergeProps({ref:"iframe"},e.$attrs),null,16)}const y=m(f,[["render",g]]);return{install(e){e.component("IframeResizer",y)}}}));
|
|
21
2
|
//# sourceMappingURL=index.umd.js.map
|
package/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../../packages/vue/iframe-resizer.vue","../../packages/vue/
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../../packages/vue/iframe-resizer.vue","../../packages/vue/index.ts"],"sourcesContent":["<template>\n <iframe ref=\"iframe\" v-bind=\"$attrs\"></iframe>\n</template>\n\n<script lang=\"ts\">\n import type { PropType } from 'vue'\n import connectResizer from '@iframe-resizer/core'\n import type { IFrameObject } from '@iframe-resizer/core'\n import acg from 'auto-console-group'\n\n const EXPAND = 'expanded'\n const COLLAPSE = 'collapsed'\n\n type LogOption = 'expanded' | 'collapsed' | boolean | -1\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 export default {\n name: 'IframeResizer',\n\n props: {\n license: {\n type: String,\n required: true,\n },\n bodyBackground: {\n type: String,\n },\n bodyMargin: {\n type: String,\n },\n bodyPadding: {\n type: String,\n },\n checkOrigin: {\n type: Boolean,\n default: true,\n },\n direction: {\n type: String,\n },\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 return true\n default:\n return false\n }\n },\n default: undefined,\n },\n inPageLinks: {\n type: Boolean,\n },\n offset: {\n type: Number,\n },\n scrolling: {\n type: Boolean,\n },\n tolerance: {\n type: Number,\n },\n warningTimeout: {\n type: Number,\n },\n },\n\n data() {\n return {\n resizer: null as IFrameObject | null,\n }\n },\n\n mounted() {\n const self = this\n const { iframe } = this.$refs as { iframe: HTMLIFrameElement }\n const options: any = {\n ...Object.fromEntries(\n Object.entries(this.$props).filter(\n ([key, value]) => value !== undefined\n )\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[]) => self.$emit('onReady', ...args),\n onMessage: (...args: any[]) => self.$emit('onMessage', ...args),\n onResized: (...args: any[]) => self.$emit('onResized', ...args),\n }\n\n const connectWithOptions = connectResizer(options)\n self.resizer = connectWithOptions(iframe)\n\n const consoleOptions = {\n label: `vue(${iframe.id})`,\n expand: (options as any).logExpand, // set inside connectResizer\n }\n\n const consoleGroup = createAutoConsoleGroup(consoleOptions)\n consoleGroup.event('setup')\n\n if ([COLLAPSE, EXPAND, true].includes(options.log as any)) {\n consoleGroup.log('Created Vue component')\n }\n },\n\n // Vue 2 lifecycle hook\n beforeDestroy() {\n this.resizer?.disconnect()\n },\n\n // Vue 3 lifecycle hook\n beforeUnmount() {\n this.resizer?.disconnect()\n },\n\n methods: {\n moveToAnchor(anchor: string) {\n this.resizer?.moveToAnchor(anchor)\n },\n resize() {\n this.resizer?.resize()\n },\n sendMessage(msg: any, target?: string) {\n this.resizer?.sendMessage(msg, target)\n },\n },\n }\n</script>\n","import IframeResizer from './iframe-resizer.vue'\n\n// Duck-typed interface compatible with both Vue 2 and Vue 3\ninterface VueApp {\n component: (name: string, component: any) => void\n}\n\nexport default {\n install(app: VueApp) {\n app.component('IframeResizer', IframeResizer)\n },\n}\n"],"names":["EXPAND","COLLAPSE","createAutoConsoleGroup","mod","acg","_sfc_main","value","self","iframe","options","key","consoleGroup","args","connectWithOptions","connectResizer","consoleOptions","anchor","msg","target","_openBlock","_createElementBlock","_mergeProps","_ctx","app","IframeResizer"],"mappings":"gYAUE,MAAMA,EAAS,WACTC,EAAW,YASXC,GALmBC,GAEvBA,GAAK,WAAaA,EAAI,QAAUA,GAGaC,CAAG,EAElDC,EAAe,CACb,KAAM,gBAEN,MAAO,CACL,QAAS,CACP,KAAM,OACN,SAAU,EAAA,EAEZ,eAAgB,CACd,KAAM,MAAA,EAER,WAAY,CACV,KAAM,MAAA,EAER,YAAa,C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,eAAgB,CACd,KAAK,SAAS,WAAA,CAChB,EAGA,eAAgB,CACd,KAAK,SAAS,WAAA,CAChB,EAEA,QAAS,CACP,aAAaK,EAAgB,CAC3B,KAAK,SAAS,aAAaA,CAAM,CACnC,EACA,QAAS,CACP,KAAK,SAAS,OAAA,CAChB,EACA,YAAYC,EAAUC,EAAiB,CACrC,KAAK,SAAS,YAAYD,EAAKC,CAAM,CACvC,CAAA,CAEJ,+FA9IA,OAAAC,EAAAA,UAAA,EAAAC,EAAAA,mBAA8C,SAA9CC,EAAAA,WAA8C,CAAtC,IAAI,QAAA,EAAiBC,EAAA,MAAM,EAAA,KAAA,EAAA,oCCMtB,CACb,QAAQC,EAAa,CACnBA,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.0",
|
|
4
4
|
"license": "GPL-3.0",
|
|
5
5
|
"homepage": "https://iframe-resizer.com",
|
|
6
6
|
"author": {
|
|
@@ -19,6 +19,7 @@
|
|
|
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
|
},
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
"vue"
|
|
40
41
|
],
|
|
41
42
|
"dependencies": {
|
|
42
|
-
"@iframe-resizer/core": "
|
|
43
|
+
"@iframe-resizer/core": "6.0.0-beta.0",
|
|
43
44
|
"auto-console-group": "1.3.0"
|
|
44
45
|
}
|
|
45
|
-
}
|
|
46
|
+
}
|