@everchron/ec-shards 7.3.13 → 7.3.14
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 +23 -13
- package/dist/ec-shards.common.js.map +1 -1
- package/dist/ec-shards.umd.js +23 -13
- package/dist/ec-shards.umd.js.map +1 -1
- package/dist/ec-shards.umd.min.js +1 -1
- package/dist/ec-shards.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/dialog/dialog.vue +48 -40
- package/src/stories/Changelog.stories.mdx +15 -0
- package/src/stories/dialog/dialog.stories.js +13 -23
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<dialog v-if="lazyLoad" ref="dialog" :class="'ecs-dialog-' + size" class="ecs-dialog">
|
|
2
|
+
<dialog v-if="lazyLoad" ref="dialog" :class="'ecs-dialog-' + size" class="ecs-dialog" @keydown.enter="handleEnterKey">
|
|
3
3
|
<div class="ecs-dialog-body scrollbar scrollbar-sml">
|
|
4
4
|
<slot></slot>
|
|
5
5
|
</div>
|
|
@@ -19,11 +19,6 @@
|
|
|
19
19
|
type: Boolean,
|
|
20
20
|
default: false
|
|
21
21
|
},
|
|
22
|
-
/** If set `true`, the dialog element will render where it's placed inside the DOM. This can be useful for dialogs that should not "escape" their parent elements, e.g. when a dialog is launched within a larger modal. **Note:** dialogs shown in place have no backdrop element and need to be positioned manually via CSS. */
|
|
23
|
-
showInPlace: {
|
|
24
|
-
type: Boolean,
|
|
25
|
-
default: false
|
|
26
|
-
},
|
|
27
22
|
/** Determines the size of the dialog. */
|
|
28
23
|
size: {
|
|
29
24
|
type: String,
|
|
@@ -49,6 +44,20 @@
|
|
|
49
44
|
this.isShown = !this.isShown
|
|
50
45
|
/** Emitted when the dialog show state changes. */
|
|
51
46
|
this.$emit('toggled', this.id, this.isShown)
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
handleEnterKey(event) {
|
|
50
|
+
// If the user presses enter, we want to trigger the last button (always confirm) in the footer.
|
|
51
|
+
if (event.key === 'Enter') {
|
|
52
|
+
const buttons = this.$el.querySelectorAll('.ecs-dialog-footer button')
|
|
53
|
+
const lastButton = buttons[buttons.length - 1]
|
|
54
|
+
const activeElement = document.activeElement
|
|
55
|
+
|
|
56
|
+
if (activeElement.tagName !== 'BUTTON' || !activeElement.closest('.ecs-dialog-footer')) {
|
|
57
|
+
event.preventDefault()
|
|
58
|
+
lastButton.click()
|
|
59
|
+
}
|
|
60
|
+
}
|
|
52
61
|
}
|
|
53
62
|
},
|
|
54
63
|
|
|
@@ -59,12 +68,9 @@
|
|
|
59
68
|
if (this.isShown) {
|
|
60
69
|
this.lazyLoad = true
|
|
61
70
|
this.$nextTick(() => {
|
|
62
|
-
|
|
63
|
-
this.$refs.dialog.show()
|
|
64
|
-
else
|
|
65
|
-
this.$refs.dialog.showModal()
|
|
66
|
-
|
|
71
|
+
this.$refs.dialog.showModal()
|
|
67
72
|
document.addEventListener('keyup', this.keyUpHandler)
|
|
73
|
+
this.$refs.dialog.focus()
|
|
68
74
|
})
|
|
69
75
|
} else {
|
|
70
76
|
this.$refs.dialog.close()
|
|
@@ -102,7 +108,7 @@
|
|
|
102
108
|
@import "../../tokens/build/scss/tokens.scss";
|
|
103
109
|
@import "../mixins/svg-uri";
|
|
104
110
|
|
|
105
|
-
.ecs-dialog{
|
|
111
|
+
.ecs-dialog {
|
|
106
112
|
display: flex;
|
|
107
113
|
flex-direction: column;
|
|
108
114
|
margin: auto;
|
|
@@ -118,109 +124,109 @@
|
|
|
118
124
|
border-radius: $border-radius-large;
|
|
119
125
|
width: 100%;
|
|
120
126
|
|
|
121
|
-
&:not([open]){
|
|
127
|
+
&:not([open]) {
|
|
122
128
|
display: none;
|
|
123
129
|
}
|
|
124
130
|
|
|
125
|
-
&[open]{
|
|
131
|
+
&[open] {
|
|
126
132
|
animation: show-dialog .3s cubic-bezier(0.595, -0.275, 0.330, 1.280) normal;
|
|
127
133
|
|
|
128
|
-
&::backdrop{
|
|
134
|
+
&::backdrop {
|
|
129
135
|
animation: show-backdrop .2s cubic-bezier(0.595, -0.275, 0.330, 1.280) normal;
|
|
130
136
|
}
|
|
131
137
|
}
|
|
132
138
|
|
|
133
|
-
&::backdrop{
|
|
139
|
+
&::backdrop {
|
|
134
140
|
position: fixed;
|
|
135
141
|
inset: 0;
|
|
136
|
-
background: rgba(49,52,57, .5);
|
|
142
|
+
background: rgba(49, 52, 57, .5);
|
|
137
143
|
}
|
|
138
144
|
|
|
139
|
-
&-md{
|
|
145
|
+
&-md {
|
|
140
146
|
max-width: 380px;
|
|
141
147
|
}
|
|
142
148
|
|
|
143
|
-
&-lg{
|
|
149
|
+
&-lg {
|
|
144
150
|
max-width: 540px;
|
|
145
151
|
|
|
146
|
-
.ecs-dialog-body{
|
|
152
|
+
.ecs-dialog-body {
|
|
147
153
|
text-align: left;
|
|
148
154
|
}
|
|
149
155
|
}
|
|
150
156
|
|
|
151
|
-
&-body{
|
|
157
|
+
&-body {
|
|
152
158
|
padding: 25px 20px 10px;
|
|
153
159
|
text-align: center;
|
|
154
160
|
overflow: auto;
|
|
155
161
|
|
|
156
|
-
p{
|
|
162
|
+
p {
|
|
157
163
|
margin: 0 0 20px 0;
|
|
158
164
|
font-size: $type-scale-3-font-size;
|
|
159
165
|
line-height: 1.4em;
|
|
160
166
|
color: rgba($color-gray-13, .7);
|
|
161
167
|
|
|
162
|
-
&.long{
|
|
168
|
+
&.long {
|
|
163
169
|
text-align: left;
|
|
164
170
|
color: rgba($color-gray-13, .85);
|
|
165
171
|
margin: 18px 0;
|
|
166
172
|
}
|
|
167
173
|
|
|
168
|
-
&.left{
|
|
174
|
+
&.left {
|
|
169
175
|
text-align: left;
|
|
170
176
|
}
|
|
171
177
|
|
|
172
|
-
a{
|
|
178
|
+
a {
|
|
173
179
|
color: $color-blue-8;
|
|
174
180
|
text-decoration: none;
|
|
175
181
|
|
|
176
|
-
&:hover{
|
|
182
|
+
&:hover {
|
|
177
183
|
color: $color-blue-9;
|
|
178
184
|
}
|
|
179
185
|
}
|
|
180
186
|
}
|
|
181
187
|
|
|
182
|
-
.mono{
|
|
188
|
+
.mono {
|
|
183
189
|
color: $color-gray-12;
|
|
184
190
|
font-family: $font-family-monospace;
|
|
185
191
|
font-size: $type-scale-3-font-size;
|
|
186
192
|
}
|
|
187
193
|
|
|
188
|
-
.ecs-alert{
|
|
194
|
+
.ecs-alert {
|
|
189
195
|
margin: 0 -10px;
|
|
190
196
|
}
|
|
191
197
|
}
|
|
192
198
|
|
|
193
|
-
&-footer{
|
|
199
|
+
&-footer {
|
|
194
200
|
display: flex;
|
|
195
201
|
justify-content: space-between;
|
|
196
202
|
box-shadow: 0 -1px 0 rgba(#000, .1);
|
|
197
203
|
height: 54px;
|
|
198
204
|
|
|
199
|
-
|
|
205
|
+
>* {
|
|
200
206
|
flex: 1;
|
|
201
207
|
|
|
202
|
-
&:first-child{
|
|
208
|
+
&:first-child {
|
|
203
209
|
border-right: 1px solid rgba(#000, .13);
|
|
204
210
|
}
|
|
205
211
|
|
|
206
|
-
&:last-child{
|
|
212
|
+
&:last-child {
|
|
207
213
|
border-right: none;
|
|
208
214
|
}
|
|
209
215
|
}
|
|
210
216
|
|
|
211
|
-
&-stacked{
|
|
217
|
+
&-stacked {
|
|
212
218
|
height: auto;
|
|
213
219
|
flex-direction: column;
|
|
214
220
|
|
|
215
|
-
|
|
221
|
+
>* {
|
|
216
222
|
border-right: none;
|
|
217
223
|
border-bottom: 1px solid rgba(#000, .13);
|
|
218
224
|
|
|
219
|
-
&:first-child{
|
|
225
|
+
&:first-child {
|
|
220
226
|
border-right: none;
|
|
221
227
|
}
|
|
222
228
|
|
|
223
|
-
&:last-child{
|
|
229
|
+
&:last-child {
|
|
224
230
|
border-bottom: none;
|
|
225
231
|
}
|
|
226
232
|
}
|
|
@@ -229,21 +235,23 @@
|
|
|
229
235
|
}
|
|
230
236
|
|
|
231
237
|
@keyframes show-dialog {
|
|
232
|
-
from{
|
|
238
|
+
from {
|
|
233
239
|
transform: translateY(-20px) scale(.98);
|
|
234
240
|
opacity: 0;
|
|
235
241
|
}
|
|
236
|
-
|
|
242
|
+
|
|
243
|
+
to {
|
|
237
244
|
transform: translateY(0) scale(1);
|
|
238
245
|
opacity: 1;
|
|
239
246
|
}
|
|
240
247
|
}
|
|
241
248
|
|
|
242
249
|
@keyframes show-backdrop {
|
|
243
|
-
from{
|
|
250
|
+
from {
|
|
244
251
|
opacity: 0;
|
|
245
252
|
}
|
|
246
|
-
|
|
253
|
+
|
|
254
|
+
to {
|
|
247
255
|
opacity: 1;
|
|
248
256
|
}
|
|
249
257
|
}
|
|
@@ -6,6 +6,21 @@ import { Meta } from '@storybook/addon-docs/blocks';
|
|
|
6
6
|
Changelog
|
|
7
7
|
</h1>
|
|
8
8
|
|
|
9
|
+
## Version 7.3.14 (19 July 2023)
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- Added Icons for: empty-table-template, document-extract-ai, sparkle-ai, dialog sparkle
|
|
14
|
+
|
|
15
|
+
### Fixes
|
|
16
|
+
|
|
17
|
+
- Also emit click on meta element in EcsTreeListItem
|
|
18
|
+
- Fixed EcsDialog button focusing behavior
|
|
19
|
+
- Fixed EcsDialog Enter key confirm behavior
|
|
20
|
+
- Removed EcsEmojiPicker until it's ready for production (hasn't been used yet)
|
|
21
|
+
- Correctly pass down name and id to EcsSelect's select element
|
|
22
|
+
|
|
23
|
+
|
|
9
24
|
## Version 7.3.0 (14 June 2023)
|
|
10
25
|
|
|
11
26
|
### Features
|
|
@@ -14,14 +14,24 @@ export const dialogPrompt = () => ({
|
|
|
14
14
|
showdialog: false
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
|
+
methods: {
|
|
18
|
+
cancel() {
|
|
19
|
+
this.showdialog = false;
|
|
20
|
+
console.log('cancel');
|
|
21
|
+
},
|
|
22
|
+
confirm() {
|
|
23
|
+
this.showdialog = false;
|
|
24
|
+
console.log('confirm');
|
|
25
|
+
}
|
|
26
|
+
},
|
|
17
27
|
template: `<div>
|
|
18
28
|
<button @click="showdialog = true">Open</button>
|
|
19
|
-
<ecs-dialog @cancel="
|
|
29
|
+
<ecs-dialog @cancel="cancel" :show="showdialog">
|
|
20
30
|
<ecs-dialog-header icon="document">Send Documents</ecs-dialog-header>
|
|
21
31
|
<p>Are you sure you want to delete the selected documents?</p>
|
|
22
32
|
<template slot="actions">
|
|
23
|
-
<ecs-button-dialog @click="
|
|
24
|
-
<ecs-button-dialog type="confirm" icon="download">Confirm</ecs-button-dialog>
|
|
33
|
+
<ecs-button-dialog @click="cancel">Cancel</ecs-button-dialog>
|
|
34
|
+
<ecs-button-dialog @click="confirm" type="confirm" icon="download">Confirm</ecs-button-dialog>
|
|
25
35
|
</template>
|
|
26
36
|
</ecs-dialog>
|
|
27
37
|
</div>`
|
|
@@ -68,23 +78,3 @@ export const dialogSizes = () => ({
|
|
|
68
78
|
</ecs-dialog>
|
|
69
79
|
</div>`
|
|
70
80
|
});
|
|
71
|
-
|
|
72
|
-
export const dialogInPlace = () => ({
|
|
73
|
-
components: { EcsDialog, EcsDialogHeader, EcsButtonDialog },
|
|
74
|
-
data() {
|
|
75
|
-
return {
|
|
76
|
-
showdialog: false
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
template: `<div style="height:400px">
|
|
80
|
-
<button @click="showdialog = !showdialog">Open</button>
|
|
81
|
-
<ecs-dialog show-in-place :show="showdialog">
|
|
82
|
-
<ecs-dialog-header>Choose Attachment</ecs-dialog-header>
|
|
83
|
-
<p>Select documents to attach to.</p>
|
|
84
|
-
<template slot="actions">
|
|
85
|
-
<ecs-button-dialog @click="showdialog = !showdialog">Cancel</ecs-button-dialog>
|
|
86
|
-
<ecs-button-dialog type="confirm" icon="download">Confirm</ecs-button-dialog>
|
|
87
|
-
</template>
|
|
88
|
-
</ecs-dialog>
|
|
89
|
-
</div>`
|
|
90
|
-
});
|