@iframe-resizer/vue 5.0.0-alpha.3 → 5.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/README.md CHANGED
@@ -22,4 +22,4 @@ yarn add @iframe-resizer/vue
22
22
 
23
23
  ---
24
24
 
25
- _iframe-resizer version 5.0.1 2024-05-28 - 15:11:55.878Z_
25
+ _iframe-resizer version 5.0.1 2024-05-28 - 19:45:39.232Z_
@@ -1,29 +1,72 @@
1
1
  <template>
2
- <div class="iframe-container">
3
- <iframe ref="iframe" :src="src"></iframe>
4
- </div>
2
+ <iframe ref="iframe" v-bind="$attrs"></iframe>
5
3
  </template>
6
4
 
7
- <script>
5
+ <script setup>
8
6
  import connectResizer from '@iframe-resizer/core'
9
7
 
10
- export default {
11
- name: 'IframeResizer',
12
- props: {
13
- src: {
14
- type: String
15
- },
8
+ const emit = defineEmits(['onReady', 'onMessage', 'onResized'])
9
+
10
+ defineProps({
16
11
  license: {
17
12
  type: String,
18
13
  required: true
19
- }
20
- },
14
+ },
15
+ bodyBackground: {
16
+ type: String,
17
+ },
18
+ bodyMargin: {
19
+ type: String,
20
+ },
21
+ bodyPadding: {
22
+ type: String,
23
+ },
24
+ checkOrigin: {
25
+ type: Boolean,
26
+ default: true,
27
+ },
28
+ direction: {
29
+ type: String,
30
+ },
31
+ inPageLinks: {
32
+ type: Boolean,
33
+ },
34
+ offset: {
35
+ type: Number,
36
+ },
37
+ scrolling: {
38
+ type: Boolean,
39
+ },
40
+ tolerance: {
41
+ type: Number,
42
+ },
43
+ warningTimeout: {
44
+ type: Number,
45
+ },
46
+ })
47
+
48
+ defineOptions({
49
+ name: 'IframeResizer',
21
50
 
22
51
  mounted() {
23
- const options = binding.value || {}
52
+ const self = this
53
+ const { iframe } = this.$refs
54
+ const options = {
55
+ ...Object.fromEntries(
56
+ Object
57
+ .entries(this.$props)
58
+ .filter(([key, value]) => value !== undefined)
59
+ ),
60
+
61
+ onClose:() => false, // Disable close methods, use Vue to remove iframe
62
+ onReady: (...args) => self.$emit('onReady', ...args),
63
+ onMessage: (...args) => self.$emit('onMessage', ...args),
64
+ onResized: (...args) => self.$emit('onResized', ...args),
65
+ }
66
+
24
67
  const connectWithOptions = connectResizer(options)
25
- el.addEventListener('load', () => connectWithOptions(el))
26
- //iframeResizer({}, this.$refs.iframe);
68
+
69
+ iframe.addEventListener("load", () => connectWithOptions(iframe))
27
70
  },
28
71
 
29
72
  beforeDestroy() {
@@ -31,6 +74,6 @@
31
74
  this.$refs.iframe.iFrameResizer.disconnect();
32
75
  }
33
76
  }
34
- }
77
+ })
35
78
 
36
79
  </script>
package/index.cjs.js CHANGED
@@ -19,26 +19,31 @@
19
19
 
20
20
  'use strict';
21
21
 
22
- const connectResizer = require('@iframe-resizer/core');
23
22
  const vue = require('vue');
23
+ const connectResizer = require('@iframe-resizer/core');
24
24
 
25
- const script = {
25
+ const script = /*#__PURE__*/Object.assign({
26
26
  name: 'IframeResizer',
27
- props: {
28
- src: {
29
- type: String
30
- },
31
- license: {
32
- type: String,
33
- required: true
34
- }
35
- },
36
27
 
37
28
  mounted() {
38
- const options = binding.value || {};
29
+ const self = this;
30
+ const { iframe } = this.$refs;
31
+ const options = {
32
+ ...Object.fromEntries(
33
+ Object
34
+ .entries(this.$props)
35
+ .filter(([key, value]) => value !== undefined)
36
+ ),
37
+
38
+ onClose:() => false, // Disable close methods, use Vue to remove iframe
39
+ onReady: (...args) => self.$emit('onReady', ...args),
40
+ onMessage: (...args) => self.$emit('onMessage', ...args),
41
+ onResized: (...args) => self.$emit('onResized', ...args),
42
+ };
43
+
39
44
  const connectWithOptions = connectResizer(options);
40
- el.addEventListener('load', () => connectWithOptions(el));
41
- //iframeResizer({}, this.$refs.iframe);
45
+
46
+ iframe.addEventListener("load", () => connectWithOptions(iframe));
42
47
  },
43
48
 
44
49
  beforeDestroy() {
@@ -46,21 +51,60 @@ const script = {
46
51
  this.$refs.iframe.iFrameResizer.disconnect();
47
52
  }
48
53
  }
49
- };
54
+ }, {
55
+ __name: 'iframe-resizer',
56
+ props: {
57
+ license: {
58
+ type: String,
59
+ required: true
60
+ },
61
+ bodyBackground: {
62
+ type: String,
63
+ },
64
+ bodyMargin: {
65
+ type: String,
66
+ },
67
+ bodyPadding: {
68
+ type: String,
69
+ },
70
+ checkOrigin: {
71
+ type: Boolean,
72
+ default: true,
73
+ },
74
+ direction: {
75
+ type: String,
76
+ },
77
+ inPageLinks: {
78
+ type: Boolean,
79
+ },
80
+ offset: {
81
+ type: Number,
82
+ },
83
+ scrolling: {
84
+ type: Boolean,
85
+ },
86
+ tolerance: {
87
+ type: Number,
88
+ },
89
+ warningTimeout: {
90
+ type: Number,
91
+ },
92
+ },
93
+ emits: ['onReady', 'onMessage', 'onResized'],
94
+ setup(__props, { emit: __emit }) {
50
95
 
51
- const _hoisted_1 = { class: "iframe-container" };
52
- const _hoisted_2 = ["src"];
96
+
53
97
 
54
- function render(_ctx, _cache, $props, $setup, $data, $options) {
55
- return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
56
- vue.createElementVNode("iframe", {
57
- ref: "iframe",
58
- src: $props.src
59
- }, null, 8 /* PROPS */, _hoisted_2)
60
- ]))
98
+
99
+
100
+
101
+ return (_ctx, _cache) => {
102
+ return (vue.openBlock(), vue.createElementBlock("iframe", vue.mergeProps({ ref: "iframe" }, _ctx.$attrs), null, 16 /* FULL_PROPS */))
61
103
  }
104
+ }
105
+
106
+ });
62
107
 
63
- script.render = render;
64
108
  script.__file = "./iframe-resizer.vue";
65
109
 
66
110
  const index = {
package/index.esm.js CHANGED
@@ -17,26 +17,31 @@
17
17
  */
18
18
 
19
19
 
20
+ import { openBlock, createElementBlock, mergeProps } from 'vue';
20
21
  import connectResizer from '@iframe-resizer/core';
21
- import { openBlock, createElementBlock, createElementVNode } from 'vue';
22
22
 
23
- const script = {
23
+ const script = /*#__PURE__*/Object.assign({
24
24
  name: 'IframeResizer',
25
- props: {
26
- src: {
27
- type: String
28
- },
29
- license: {
30
- type: String,
31
- required: true
32
- }
33
- },
34
25
 
35
26
  mounted() {
36
- const options = binding.value || {};
27
+ const self = this;
28
+ const { iframe } = this.$refs;
29
+ const options = {
30
+ ...Object.fromEntries(
31
+ Object
32
+ .entries(this.$props)
33
+ .filter(([key, value]) => value !== undefined)
34
+ ),
35
+
36
+ onClose:() => false, // Disable close methods, use Vue to remove iframe
37
+ onReady: (...args) => self.$emit('onReady', ...args),
38
+ onMessage: (...args) => self.$emit('onMessage', ...args),
39
+ onResized: (...args) => self.$emit('onResized', ...args),
40
+ };
41
+
37
42
  const connectWithOptions = connectResizer(options);
38
- el.addEventListener('load', () => connectWithOptions(el));
39
- //iframeResizer({}, this.$refs.iframe);
43
+
44
+ iframe.addEventListener("load", () => connectWithOptions(iframe));
40
45
  },
41
46
 
42
47
  beforeDestroy() {
@@ -44,21 +49,60 @@ const script = {
44
49
  this.$refs.iframe.iFrameResizer.disconnect();
45
50
  }
46
51
  }
47
- };
52
+ }, {
53
+ __name: 'iframe-resizer',
54
+ props: {
55
+ license: {
56
+ type: String,
57
+ required: true
58
+ },
59
+ bodyBackground: {
60
+ type: String,
61
+ },
62
+ bodyMargin: {
63
+ type: String,
64
+ },
65
+ bodyPadding: {
66
+ type: String,
67
+ },
68
+ checkOrigin: {
69
+ type: Boolean,
70
+ default: true,
71
+ },
72
+ direction: {
73
+ type: String,
74
+ },
75
+ inPageLinks: {
76
+ type: Boolean,
77
+ },
78
+ offset: {
79
+ type: Number,
80
+ },
81
+ scrolling: {
82
+ type: Boolean,
83
+ },
84
+ tolerance: {
85
+ type: Number,
86
+ },
87
+ warningTimeout: {
88
+ type: Number,
89
+ },
90
+ },
91
+ emits: ['onReady', 'onMessage', 'onResized'],
92
+ setup(__props, { emit: __emit }) {
48
93
 
49
- const _hoisted_1 = { class: "iframe-container" };
50
- const _hoisted_2 = ["src"];
94
+
51
95
 
52
- function render(_ctx, _cache, $props, $setup, $data, $options) {
53
- return (openBlock(), createElementBlock("div", _hoisted_1, [
54
- createElementVNode("iframe", {
55
- ref: "iframe",
56
- src: $props.src
57
- }, null, 8 /* PROPS */, _hoisted_2)
58
- ]))
96
+
97
+
98
+
99
+ return (_ctx, _cache) => {
100
+ return (openBlock(), createElementBlock("iframe", mergeProps({ ref: "iframe" }, _ctx.$attrs), null, 16 /* FULL_PROPS */))
59
101
  }
102
+ }
103
+
104
+ });
60
105
 
61
- script.render = render;
62
106
  script.__file = "./iframe-resizer.vue";
63
107
 
64
108
  const index = {
package/index.umd.js CHANGED
@@ -18,28 +18,33 @@
18
18
 
19
19
 
20
20
  (function (global, factory) {
21
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@iframe-resizer/core'), require('vue')) :
22
- typeof define === 'function' && define.amd ? define(['@iframe-resizer/core', 'vue'], factory) :
23
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.IframeResizer = factory(global.connectResizer, global.vue));
24
- })(this, (function (connectResizer, vue) { 'use strict';
21
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('vue'), require('@iframe-resizer/core')) :
22
+ typeof define === 'function' && define.amd ? define(['vue', '@iframe-resizer/core'], factory) :
23
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.IframeResizer = factory(global.vue, global.connectResizer));
24
+ })(this, (function (vue, connectResizer) { 'use strict';
25
25
 
26
- const script = {
26
+ const script = /*#__PURE__*/Object.assign({
27
27
  name: 'IframeResizer',
28
- props: {
29
- src: {
30
- type: String
31
- },
32
- license: {
33
- type: String,
34
- required: true
35
- }
36
- },
37
28
 
38
29
  mounted() {
39
- const options = binding.value || {};
30
+ const self = this;
31
+ const { iframe } = this.$refs;
32
+ const options = {
33
+ ...Object.fromEntries(
34
+ Object
35
+ .entries(this.$props)
36
+ .filter(([key, value]) => value !== undefined)
37
+ ),
38
+
39
+ onClose:() => false, // Disable close methods, use Vue to remove iframe
40
+ onReady: (...args) => self.$emit('onReady', ...args),
41
+ onMessage: (...args) => self.$emit('onMessage', ...args),
42
+ onResized: (...args) => self.$emit('onResized', ...args),
43
+ };
44
+
40
45
  const connectWithOptions = connectResizer(options);
41
- el.addEventListener('load', () => connectWithOptions(el));
42
- //iframeResizer({}, this.$refs.iframe);
46
+
47
+ iframe.addEventListener("load", () => connectWithOptions(iframe));
43
48
  },
44
49
 
45
50
  beforeDestroy() {
@@ -47,21 +52,60 @@
47
52
  this.$refs.iframe.iFrameResizer.disconnect();
48
53
  }
49
54
  }
50
- };
55
+ }, {
56
+ __name: 'iframe-resizer',
57
+ props: {
58
+ license: {
59
+ type: String,
60
+ required: true
61
+ },
62
+ bodyBackground: {
63
+ type: String,
64
+ },
65
+ bodyMargin: {
66
+ type: String,
67
+ },
68
+ bodyPadding: {
69
+ type: String,
70
+ },
71
+ checkOrigin: {
72
+ type: Boolean,
73
+ default: true,
74
+ },
75
+ direction: {
76
+ type: String,
77
+ },
78
+ inPageLinks: {
79
+ type: Boolean,
80
+ },
81
+ offset: {
82
+ type: Number,
83
+ },
84
+ scrolling: {
85
+ type: Boolean,
86
+ },
87
+ tolerance: {
88
+ type: Number,
89
+ },
90
+ warningTimeout: {
91
+ type: Number,
92
+ },
93
+ },
94
+ emits: ['onReady', 'onMessage', 'onResized'],
95
+ setup(__props, { emit: __emit }) {
51
96
 
52
- const _hoisted_1 = { class: "iframe-container" };
53
- const _hoisted_2 = ["src"];
97
+
54
98
 
55
- function render(_ctx, _cache, $props, $setup, $data, $options) {
56
- return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
57
- vue.createElementVNode("iframe", {
58
- ref: "iframe",
59
- src: $props.src
60
- }, null, 8 /* PROPS */, _hoisted_2)
61
- ]))
99
+
100
+
101
+
102
+ return (_ctx, _cache) => {
103
+ return (vue.openBlock(), vue.createElementBlock("iframe", vue.mergeProps({ ref: "iframe" }, _ctx.$attrs), null, 16 /* FULL_PROPS */))
62
104
  }
105
+ }
106
+
107
+ });
63
108
 
64
- script.render = render;
65
109
  script.__file = "./iframe-resizer.vue";
66
110
 
67
111
  const index = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iframe-resizer/vue",
3
- "version": "5.0.0-alpha.3",
3
+ "version": "5.0.0-beta.1",
4
4
  "license": "GPL-3.0",
5
5
  "homepage": "https://iframe-resizer.com",
6
6
  "author": {