@everchron/ec-shards 2.1.4 → 2.1.5
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/dist/ec-shards.common.js +16 -6
- package/dist/ec-shards.common.js.map +1 -1
- package/dist/ec-shards.umd.js +16 -6
- package/dist/ec-shards.umd.js.map +1 -1
- package/dist/ec-shards.umd.min.js +2 -2
- package/dist/ec-shards.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/modal/modal.vue +11 -1
- package/src/stories/Changelog.stories.mdx +6 -0
- package/src/stories/modal/modal.stories.js +29 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<transition name="dialog-fade">
|
|
3
3
|
<div v-if="isShown" class="ecs-modal" :class="[typeClass, clickthrough ? 'ecs-modal-click-through' : '']">
|
|
4
4
|
|
|
5
|
-
<div class="ecs-modal-dialog ecs-modal-sheet">
|
|
5
|
+
<div class="ecs-modal-dialog ecs-modal-sheet" :style="fixedHeightStyle">
|
|
6
6
|
<div v-if="$slots.header" class="ecs-modal-header-wrap">
|
|
7
7
|
<!-- @slot Slot for the modal header content. -->
|
|
8
8
|
<slot name="header"></slot>
|
|
@@ -44,6 +44,10 @@
|
|
|
44
44
|
type: Boolean,
|
|
45
45
|
default: false
|
|
46
46
|
},
|
|
47
|
+
/** Sets the modal height to a fixed pixel value. If not passed, the modal height will auto adapt it's height. The modal height will never exceed 90% height of viewport. */
|
|
48
|
+
fixedHeight: {
|
|
49
|
+
type: Number
|
|
50
|
+
}
|
|
47
51
|
},
|
|
48
52
|
|
|
49
53
|
data () {
|
|
@@ -57,6 +61,12 @@
|
|
|
57
61
|
if (this.type && this.type !== '')
|
|
58
62
|
return `ecs-modal-${this.type}`
|
|
59
63
|
return this.type
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
fixedHeightStyle() {
|
|
67
|
+
if (this.fixedHeight && this.fixedHeight !== '')
|
|
68
|
+
return `height:${this.fixedHeight}px`
|
|
69
|
+
return this.fixedHeight
|
|
60
70
|
}
|
|
61
71
|
},
|
|
62
72
|
|
|
@@ -128,3 +128,32 @@ export const footer = () => ({
|
|
|
128
128
|
</ecs-modal>
|
|
129
129
|
</div>`,
|
|
130
130
|
});
|
|
131
|
+
|
|
132
|
+
export const modalFixedHeight = () => ({
|
|
133
|
+
components: { EcsModal, EcsModalHeader, EcsModalFooter },
|
|
134
|
+
data() {
|
|
135
|
+
return {
|
|
136
|
+
showdialog: false
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
template: `<div>
|
|
140
|
+
<button @click="showdialog = !showdialog">Open</button>
|
|
141
|
+
|
|
142
|
+
<ecs-modal :fixed-height="300" :show="showdialog">
|
|
143
|
+
<template slot="header">
|
|
144
|
+
<ecs-modal-header @close="showdialog = !showdialog">
|
|
145
|
+
<h2 class="headline-2">Regular Header</h2>
|
|
146
|
+
</ecs-modal-header>
|
|
147
|
+
</template>
|
|
148
|
+
<p>Modal Content Slot</p>
|
|
149
|
+
<template slot="footer">
|
|
150
|
+
<ecs-modal-footer>
|
|
151
|
+
<template slot="secondary">
|
|
152
|
+
Secondary Footer
|
|
153
|
+
</template>
|
|
154
|
+
Primary Footer Content
|
|
155
|
+
</ecs-modal-footer>
|
|
156
|
+
</template>
|
|
157
|
+
</ecs-modal>
|
|
158
|
+
</div>`,
|
|
159
|
+
});
|