frappe-ui 0.0.21 → 0.0.22

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": "frappe-ui",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "description": "A set of components and utilities for rapid UI development",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -23,10 +23,17 @@
23
23
 
24
24
  <Dialog :options="{ title: 'Set Link' }" v-model="setLinkDialog.show">
25
25
  <template #body-content>
26
- <Input type="text" label="URL" v-model="setLinkDialog.url" />
26
+ <Input
27
+ type="text"
28
+ label="URL"
29
+ v-model="setLinkDialog.url"
30
+ @keydown.enter="(e) => setLink(e.target.value)"
31
+ />
27
32
  </template>
28
33
  <template #actions>
29
- <Button appearance="primary" @click="setLink"> Save </Button>
34
+ <Button appearance="primary" @click="setLink(setLinkDialog.url)">
35
+ Save
36
+ </Button>
30
37
  </template>
31
38
  </Dialog>
32
39
  </div>
@@ -54,9 +61,9 @@ export default {
54
61
  button.action(this.editor)
55
62
  }
56
63
  },
57
- setLink() {
64
+ setLink(url) {
58
65
  // empty
59
- if (this.setLinkDialog.url === '') {
66
+ if (url === '') {
60
67
  this.editor.chain().focus().extendMarkRange('link').unsetLink().run()
61
68
  } else {
62
69
  // update link
@@ -64,7 +71,7 @@ export default {
64
71
  .chain()
65
72
  .focus()
66
73
  .extendMarkRange('link')
67
- .setLink({ href: this.setLinkDialog.url })
74
+ .setLink({ href: url })
68
75
  .run()
69
76
  }
70
77