@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everchron/ec-shards",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "private": false,
5
5
  "description": "Everchron Shards UI Library",
6
6
  "repository": "https://github.com/everchron/ec-shards.git",
@@ -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
 
@@ -6,6 +6,12 @@ import { Meta } from '@storybook/addon-docs/blocks';
6
6
  Changelog
7
7
  </h1>
8
8
 
9
+ ## Version 2.1.5 (28 October 2022)
10
+
11
+ ### Features
12
+
13
+ - Added `fixedHeight` prop to modal component
14
+
9
15
  ## Version 2.1.4 (26 October 2022)
10
16
 
11
17
  ### Features
@@ -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
+ });