@fishawack/lab-velocity 1.11.1 → 2.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.
Files changed (95) hide show
  1. package/README.md +13 -7
  2. package/_base.scss +1 -1
  3. package/_defaults.scss +2 -3
  4. package/_variables.scss +16 -18
  5. package/components/_alert.scss +2 -2
  6. package/components/_basic.scss +5 -4
  7. package/components/_breadcrumbs.scss +7 -8
  8. package/components/_button.scss +11 -12
  9. package/components/_cascader.scss +1 -1
  10. package/components/_checkbox.scss +27 -26
  11. package/components/_chip.scss +24 -0
  12. package/components/_collapse.scss +2 -3
  13. package/components/_datepicker.scss +7 -6
  14. package/components/_footer.scss +1 -1
  15. package/components/_form.scss +6 -4
  16. package/components/_header.scss +4 -5
  17. package/components/_icon.scss +4 -3
  18. package/components/_inputNumber.scss +4 -3
  19. package/components/_link.scss +7 -7
  20. package/components/_loader.scss +3 -4
  21. package/components/_menu.scss +22 -22
  22. package/components/_pageTitle.scss +3 -3
  23. package/components/_permissionLegend.scss +18 -0
  24. package/components/_select.scss +3 -2
  25. package/components/_sidebar.scss +5 -6
  26. package/components/_switch.scss +2 -2
  27. package/components/_table.scss +3 -3
  28. package/components/_tooltip.scss +2 -2
  29. package/components/_typography.scss +71 -62
  30. package/components/_upload.scss +1 -1
  31. package/components/_wysiwyg.scss +3 -2
  32. package/components/_wysiwyg2.scss +37 -31
  33. package/general.scss +1 -2
  34. package/index.js +38 -30
  35. package/modules/_AuthModule.scss +32 -29
  36. package/modules/_AuthVariables.scss +3 -3
  37. package/modules/_modal.scss +3 -3
  38. package/package.json +109 -102
  39. package/vendor.scss +2 -2
  40. package/AuthModule/components/AuthModal.vue +0 -110
  41. package/AuthModule/components/VPasswordValidation.vue +0 -66
  42. package/AuthModule/js/AuthAxios.js +0 -59
  43. package/AuthModule/js/AuthRoutes.js +0 -186
  44. package/AuthModule/js/AuthStore.js +0 -99
  45. package/AuthModule/js/FakeAPI.js +0 -84
  46. package/AuthModule/routes/account-exists.vue +0 -35
  47. package/AuthModule/routes/change-password.vue +0 -162
  48. package/AuthModule/routes/container.vue +0 -38
  49. package/AuthModule/routes/expired-reset.vue +0 -76
  50. package/AuthModule/routes/expired-verification.vue +0 -100
  51. package/AuthModule/routes/force-reset.vue +0 -142
  52. package/AuthModule/routes/forgot.vue +0 -87
  53. package/AuthModule/routes/login.vue +0 -138
  54. package/AuthModule/routes/logincallback.vue +0 -46
  55. package/AuthModule/routes/loginheadless.vue +0 -16
  56. package/AuthModule/routes/loginsso.vue +0 -127
  57. package/AuthModule/routes/logout.vue +0 -21
  58. package/AuthModule/routes/register.vue +0 -156
  59. package/AuthModule/routes/reset.vue +0 -123
  60. package/AuthModule/routes/success-forgot.vue +0 -117
  61. package/AuthModule/routes/success-reset.vue +0 -35
  62. package/AuthModule/routes/success-verify.vue +0 -29
  63. package/AuthModule/routes/verify.vue +0 -110
  64. package/Icon.vue +0 -33
  65. package/Svg.vue +0 -40
  66. package/basic/Button.vue +0 -111
  67. package/basic/link.vue +0 -63
  68. package/form/Cascader.vue +0 -85
  69. package/form/Checkbox.vue +0 -39
  70. package/form/CheckboxGroup.vue +0 -69
  71. package/form/DatePicker.vue +0 -100
  72. package/form/InputNumber.vue +0 -90
  73. package/form/Select.vue +0 -110
  74. package/form/Switch.vue +0 -63
  75. package/form/Upload.vue +0 -103
  76. package/form/Wysiwyg.vue +0 -127
  77. package/form/Wysiwyg2.vue +0 -278
  78. package/form/basic.vue +0 -88
  79. package/form/color.vue +0 -22
  80. package/form/file.vue +0 -89
  81. package/form/input.js +0 -79
  82. package/form/input.vue +0 -85
  83. package/layout/Alert.vue +0 -38
  84. package/layout/Footer.vue +0 -35
  85. package/layout/Header.vue +0 -15
  86. package/layout/Loader.vue +0 -39
  87. package/layout/Tooltip.vue +0 -46
  88. package/layout/pageTitle.vue +0 -18
  89. package/layout/sideBar.vue +0 -27
  90. package/navigation/Breadcrumbs.vue +0 -32
  91. package/navigation/BreadcrumbsItem.vue +0 -19
  92. package/navigation/Menu.vue +0 -16
  93. package/navigation/MenuItem.vue +0 -20
  94. package/navigation/MenuItemGroup.vue +0 -20
  95. package/navigation/SubMenu.vue +0 -20
package/form/Switch.vue DELETED
@@ -1,63 +0,0 @@
1
- <template>
2
- <XInput v-bind="$props">
3
- <template #label v-if="label">
4
- <slot name="label" />
5
- </template>
6
-
7
- <el-switch
8
- :class="[`${baseClass}__control`]"
9
- :name="name"
10
- :id="id ? id: name"
11
- :size="size"
12
- :disabled="disabled"
13
- :inline-prompt="inlinePrompt"
14
- :active-icon="activeIcon"
15
- :inactive-icon="inactiveIcon"
16
- v-model="content"
17
- :required="required"
18
- @input="handleInput"
19
- />
20
- </XInput>
21
- </template>
22
-
23
- <script>
24
- import { ElSwitch } from "element-plus";
25
- import input from "./input.js";
26
- import XInput from "./input.vue";
27
-
28
- export default {
29
- mixins: [input],
30
- props: {
31
- ...input.props,
32
- modelValue: {
33
- type: Boolean,
34
- default: null,
35
- },
36
- baseClass: {
37
- type: String,
38
- default: "vel-switch",
39
- },
40
- size: {
41
- type: String,
42
- default: "default",
43
- },
44
- inlinePrompt: {
45
- type: Boolean,
46
- default: false,
47
- },
48
- activeIcon: {
49
- type: String,
50
- default: "",
51
- },
52
- inactiveIcon: {
53
- type: String,
54
- default: "",
55
- },
56
- },
57
-
58
- components: {
59
- XInput,
60
- ElSwitch,
61
- },
62
- };
63
- </script>
package/form/Upload.vue DELETED
@@ -1,103 +0,0 @@
1
- <template>
2
- <XInput v-bind="$props">
3
- <template #label>
4
- <slot name="label" />
5
- </template>
6
-
7
- <el-upload
8
- ref="upload"
9
- v-bind="$attrs.props"
10
- :class="[`${baseClass}`]"
11
- :name="name"
12
- :id="name"
13
- :disabled="disabled"
14
- :limit="limit"
15
- :action="action"
16
- :on-exceed="onExceed"
17
- v-model:file-list="content"
18
- :auto-upload="autoUpload"
19
- :required="required"
20
- :list-type="listType"
21
- :accept="accept"
22
- >
23
- <template #trigger>
24
- <slot name="trigger">
25
- <el-button type="primary">Select file</el-button>
26
- </slot>
27
- </template>
28
- <template #tip>
29
- <slot name="tip" />
30
- </template>
31
- <slot name="default">
32
- </slot>
33
- </el-upload>
34
- </XInput>
35
- </template>
36
-
37
- <script>
38
- import { ElUpload } from "element-plus";
39
- import input from "./input.js";
40
- import ElButton from "../basic/Button.vue";
41
- import XInput from "./input.vue";
42
-
43
- export default {
44
- mixins: [input],
45
- props: {
46
- ...input.props,
47
- baseClass: {
48
- type: String,
49
- default: "vel-upload",
50
- },
51
- limit: {
52
- type: Number,
53
- default: 1,
54
- },
55
- action: {
56
- type: Function,
57
- default: null,
58
- },
59
- autoUpload: {
60
- type: Boolean,
61
- default: false
62
- },
63
- onExceed: {
64
- type: Function,
65
- default: null,
66
- },
67
- listType: {
68
- type: String,
69
- default: "text",
70
- },
71
- accept: {
72
- type: String,
73
- default: "",
74
- },
75
- },
76
-
77
- components: {
78
- XInput,
79
- ElUpload,
80
- ElButton,
81
- },
82
-
83
- emits: ["upload"],
84
-
85
- watch: {
86
- content: {
87
- immediate: true,
88
- handler(val) {
89
- this.handleInput();
90
- },
91
- },
92
- },
93
- methods: {
94
- clearFiles() {
95
- this.$refs.upload.clearFiles();
96
- },
97
- handleStart(file) {
98
- this.$refs.upload.handleStart(file);
99
- }
100
- }
101
-
102
- };
103
- </script>
package/form/Wysiwyg.vue DELETED
@@ -1,127 +0,0 @@
1
- <template>
2
- <XInput v-bind="$props">
3
- <template #label>
4
- <slot name="label" />
5
- </template>
6
- <div class="el-input__inner px-0" ref="input" />
7
- </XInput>
8
- </template>
9
-
10
- <script>
11
- import Quill from "quill";
12
- import input from "./input.js";
13
- import XInput from "./input.vue";
14
- import sanitizeHtml from 'sanitize-html';
15
-
16
- export default {
17
- mixins: [input],
18
-
19
- components: {
20
- XInput,
21
- },
22
-
23
- props: {
24
- simple: {
25
- type: Boolean,
26
- default: false,
27
- },
28
- baseClass: {
29
- type: String,
30
- default: "vel-wysiwyg",
31
- },
32
- },
33
-
34
- data: () => ({
35
- editor: null,
36
- hold: null,
37
- }),
38
-
39
- watch: {
40
- modelValue: {
41
- handler(val) {
42
- if (val !== this.hold) {
43
- this.setValue();
44
- }
45
- },
46
- },
47
- },
48
-
49
- methods: {
50
- getValue() {
51
- return this.editor.getText().trim() === "" // Quill leaves <p></br></p> on empty input so ignore
52
- ? ""
53
- : this.simple // Simple editor removes outer tags and only allows inner phrasing tags
54
- ? [...this.editor.root.children]
55
- .map((d) => d.innerHTML)
56
- .join("\n")
57
- : this.editor.root.innerHTML;
58
- },
59
- setValue() {
60
- const temp =
61
- this.simple && this.modelValue // Surround text in p tags to keep it grouped correctly on simple strings. Ignore if modelValue empty otherwise you'll end up with <p>null</p>
62
- ? `<p>${this.modelValue}</p>`
63
- : this.modelValue;
64
- this.editor.root.innerHTML = this.formatCleaner(temp);
65
- },
66
- // Function to remove p tags from inside li tags, breaks the wysiwyg
67
- formatCleaner(unformmatted) {
68
- if(!unformmatted) {
69
- return "";
70
- }
71
- let parser = document.createElement('div');
72
- parser.innerHTML = unformmatted.replace(/(\r\n|\n|\r|\t)/gm,"");
73
- const lists = parser.getElementsByTagName('ul');
74
- for(var x = 0; x < lists.length; x++) {
75
- lists[x].innerHTML = sanitizeHtml(lists[x].innerHTML, {
76
- allowedTags: [ 'b', 'i', 'em', 'strong', 'a','li']
77
- });
78
- }
79
- return parser.innerHTML;
80
- }
81
- },
82
-
83
- mounted() {
84
- this.editor = new Quill(this.$refs.input, {
85
- modules: {
86
- clipboard: {
87
- matchVisual: false,
88
- },
89
- toolbar: [
90
- [
91
- this.simple
92
- ? undefined
93
- : { header: [1, 2, 3, 4, 5, 6, false] },
94
- "bold",
95
- "italic",
96
- "underline",
97
- "strike",
98
- { script: "sub" },
99
- { script: "super" },
100
- this.simple ? undefined : { list: "ordered" },
101
- this.simple ? undefined : { list: "bullet" },
102
- "clean",
103
- "link"
104
- ],
105
- ],
106
- },
107
- placeholder: this.placeholder,
108
- theme: "snow",
109
- });
110
-
111
- this.setValue();
112
-
113
- this.editor.on("text-change", (delta, oldDelta, source) => {
114
- this.hold = this.getValue();
115
- this.$emit("update:modelValue", this.hold);
116
- });
117
-
118
- // Disable tab
119
- // delete this.editor.getModule("keyboard").bindings["9"];
120
-
121
- // Disable tab index on toolbar buttons
122
- [...this.$el.querySelectorAll(".ql-toolbar button")].forEach((d) =>
123
- d.setAttribute("tabindex", -1)
124
- );
125
- },
126
- };
127
- </script>
package/form/Wysiwyg2.vue DELETED
@@ -1,278 +0,0 @@
1
- <template>
2
- <XInput v-bind="$props" class="vel-wysiwyg">
3
- <template #label>
4
- <slot name="label" />
5
- </template>
6
- <div class="control-group vel-wysiwyg__controls" v-if="editor">
7
- <el-dropdown>
8
- Heading
9
- <template #dropdown>
10
- <el-dropdown-menu>
11
- <el-dropdown-item @click="editor.chain().focus().toggleHeading({ level: 1 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 1 }) }">
12
- H1
13
- </el-dropdown-item>
14
- <el-dropdown-item @click="editor.chain().focus().toggleHeading({ level: 2 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 2 }) }">
15
- H2
16
- </el-dropdown-item>
17
- <el-dropdown-item @click="editor.chain().focus().toggleHeading({ level: 3 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 3 }) }">
18
- H3
19
- </el-dropdown-item>
20
- <el-dropdown-item @click="editor.chain().focus().toggleHeading({ level: 4 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 4 }) }">
21
- H4
22
- </el-dropdown-item>
23
- <el-dropdown-item @click="editor.chain().focus().toggleHeading({ level: 5 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 5 }) }">
24
- H5
25
- </el-dropdown-item>
26
- <el-dropdown-item @click="editor.chain().focus().toggleHeading({ level: 6 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 6 }) }">
27
- H6
28
- </el-dropdown-item>
29
- <el-dropdown-item @click="editor.chain().focus().setParagraph().run()" :class="{ 'is-active': editor.isActive('paragraph') }">
30
- Paragraph
31
- </el-dropdown-item>
32
- </el-dropdown-menu>
33
- </template>
34
- </el-dropdown>
35
- <el-dropdown>
36
- Style
37
- <template #dropdown>
38
- <el-dropdown-menu>
39
- <el-dropdown-item class="vel-wysiwyg__button" @click="editor.chain().focus().toggleBold().run()" :disabled="!editor.can().chain().focus().toggleBold().run()" :class="{ 'is-active': editor.isActive('bold') }">Bold</el-dropdown-item>
40
- <el-dropdown-item class="vel-wysiwyg__button" @click="editor.chain().focus().toggleItalic().run()" :disabled="!editor.can().chain().focus().toggleItalic().run()" :class="{ 'is-active': editor.isActive('italic') }">Italic</el-dropdown-item>
41
- <el-dropdown-item class="vel-wysiwyg__button" @click="editor.chain().focus().toggleUnderline().run()" :disabled="!editor.can().chain().focus().toggleUnderline().run()" :class="{ 'is-active': editor.isActive('underline') }">Underline</el-dropdown-item>
42
- </el-dropdown-menu>
43
- </template>
44
- </el-dropdown>
45
- <el-dropdown v-if="table">
46
- Table
47
- <template #dropdown>
48
- <el-dropdown-menu>
49
- <el-dropdown-item @click="editor.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: true }).run()">
50
- Insert table
51
- </el-dropdown-item>
52
- <el-dropdown-item @click="editor.chain().focus().addColumnBefore().run()">
53
- Add column before
54
- </el-dropdown-item>
55
- <el-dropdown-item @click="editor.chain().focus().addColumnAfter().run()">
56
- Add column after
57
- </el-dropdown-item>
58
- <el-dropdown-item @click="editor.chain().focus().deleteColumn().run()">
59
- Delete column
60
- </el-dropdown-item>
61
- <el-dropdown-item @click="editor.chain().focus().addRowBefore().run()">
62
- Add row before
63
- </el-dropdown-item>
64
- <el-dropdown-item @click="editor.chain().focus().addRowAfter().run()">
65
- Add row after
66
- </el-dropdown-item>
67
- <el-dropdown-item @click="editor.chain().focus().deleteRow().run()">
68
- Delete row
69
- </el-dropdown-item>
70
- <el-dropdown-item @click="editor.chain().focus().deleteTable().run()">
71
- Delete table
72
- </el-dropdown-item>
73
- <el-dropdown-item @click="editor.chain().focus().mergeCells().run()">
74
- Merge cells
75
- </el-dropdown-item>
76
- <el-dropdown-item @click="editor.chain().focus().splitCell().run()">
77
- Split cell
78
- </el-dropdown-item>
79
- <el-dropdown-item @click="editor.chain().focus().toggleHeaderColumn().run()">
80
- Toggle header column
81
- </el-dropdown-item>
82
- <el-dropdown-item @click="editor.chain().focus().toggleHeaderRow().run()">
83
- Toggle header row
84
- </el-dropdown-item>
85
- <el-dropdown-item @click="editor.chain().focus().toggleHeaderCell().run()">
86
- Toggle header cell
87
- </el-dropdown-item>
88
- <el-dropdown-item @click="editor.chain().focus().mergeOrSplit().run()">
89
- Merge or split
90
- </el-dropdown-item>
91
- <el-dropdown-item @click="editor.chain().focus().setCellAttribute('colspan', 2).run()">
92
- Set cell attribute
93
- </el-dropdown-item>
94
- <el-dropdown-item @click="editor.chain().focus().fixTables().run()">
95
- Fix tables
96
- </el-dropdown-item>
97
- </el-dropdown-menu>
98
- </template>
99
- </el-dropdown>
100
- <button type="button" @click="editor.chain().focus().toggleBulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
101
- <svg viewBox="0 0 18 18"> <line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"></line> <line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"></line> <line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"></line> <line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"></line> <line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"></line> <line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"></line> </svg>
102
- </button>
103
- <button type="button" @click="editor.chain().focus().toggleOrderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">
104
- <svg viewBox="0 0 18 18"> <line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"></line> <line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"></line> <line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"></line> <line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"></line> <path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"></path> <path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"></path> <path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"></path> </svg>
105
- </button>
106
- <button type="button" @click="editor.chain().focus().toggleCodeBlock().run()" :class="{ 'is-active': editor.isActive('codeBlock') }">
107
- Code block
108
- </button>
109
- <button type="button" @click="editor.chain().focus().toggleBlockquote().run()" :class="{ 'is-active': editor.isActive('blockquote') }">
110
- Blockquote
111
- </button>
112
- <button type="button" @click="editor.chain().focus().setHorizontalRule().run()">
113
- Horizontal rule
114
- </button>
115
- <button type="button" @click="editor.chain().focus().toggleSuperscript().run()" :class="{ 'is-active': editor.isActive('superscript') }">
116
- <svg viewBox="0 0 18 18"> <path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"></path> <path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"></path> </svg>
117
- </button>
118
- <button type="button" @click="editor.chain().focus().toggleSubscript().run()" :class="{ 'is-active': editor.isActive('subscript') }">
119
- <svg viewBox="0 0 18 18"> <path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"></path> <path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"></path> </svg>
120
- </button>
121
- <button type="button" @click="setLink" :class="{ 'is-active': editor.isActive('link') }">
122
- <svg viewBox="0 0 18 18"> <line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"></line> <path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"></path> <path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"></path> </svg>
123
- </button>
124
- </div>
125
- <editor-content :editor="editor" />
126
- <el-dialog
127
- v-model="dialogVisible"
128
- title="URL"
129
- width="500"
130
- >
131
- <label>Enter URL</label>
132
- <el-input v-model="newUrl" type="url" />
133
- <template #footer>
134
- <div class="dialog-footer">
135
- <el-button @click="dialogVisible = false">Cancel</el-button>
136
- <el-button type="primary" @click="updateURL">
137
- Confirm
138
- </el-button>
139
- </div>
140
- </template>
141
- </el-dialog>
142
- </XInput>
143
- </template>
144
-
145
- <script>
146
- import input from "./input.js";
147
- import XInput from "./input.vue";
148
- import sanitizeHtml from 'sanitize-html';
149
- import { ElDropdown, ElDropdownItem, ElDropdownMenu, ElDialog, ElButton, ElInput } from "element-plus";
150
- import { Editor, EditorContent } from '@tiptap/vue-3'
151
- import StarterKit from '@tiptap/starter-kit';
152
- import Underline from '@tiptap/extension-underline'
153
- import Table from '@tiptap/extension-table'
154
- import TableCell from '@tiptap/extension-table-cell'
155
- import TableHeader from '@tiptap/extension-table-header'
156
- import TableRow from '@tiptap/extension-table-row'
157
- import Superscript from '@tiptap/extension-superscript'
158
- import Subscript from '@tiptap/extension-subscript'
159
- import Link from '@tiptap/extension-link'
160
-
161
- export default {
162
- mixins: [input],
163
-
164
- components: {
165
- XInput,
166
- EditorContent,
167
- ElDropdown,
168
- ElDropdownItem,
169
- ElDropdownMenu,
170
- ElDialog,
171
- ElButton,
172
- ElInput
173
- },
174
-
175
- props: {
176
- table: {
177
- type: Boolean,
178
- default: false,
179
- },
180
- baseClass: {
181
- type: String,
182
- default: "vel-wysiwyg",
183
- },
184
- },
185
-
186
- data: () => ({
187
- editor: null,
188
- hold: null,
189
- previousUrl: null,
190
- newUrl: null,
191
- dialogVisible:false,
192
- }),
193
-
194
- watch: {
195
- modelValue: {
196
- handler(val) {
197
- if (this.hold !== val) {
198
- this.setValue();
199
- }
200
- },
201
- },
202
- },
203
-
204
- methods: {
205
- setValue() {
206
- this.editor.commands.setContent(this.modelValue);
207
- },
208
- setLink() {
209
- this.previousUrl = this.editor.getAttributes('link').href;
210
- this.newUrl = this.previousUrl;
211
- this.dialogVisible = true;
212
-
213
- },
214
- updateURL() {
215
- // cancelled
216
- this.dialogVisible = false;
217
- let url = this.newUrl;
218
- if (url === this.previousUrl) {
219
- return
220
- }
221
-
222
- // empty
223
- if (url === '') {
224
- this.editor
225
- .chain()
226
- .focus()
227
- .extendMarkRange('link')
228
- .unsetLink()
229
- .run()
230
-
231
- return
232
- }
233
- // update link
234
- this.editor
235
- .chain()
236
- .focus()
237
- .extendMarkRange('link')
238
- .setLink({ href: url })
239
- .run()
240
- }
241
- },
242
-
243
- mounted() {
244
- let extensions = [
245
- StarterKit,
246
- Underline,
247
- Superscript,
248
- Subscript,
249
- Link.configure({
250
- openOnClick: false,
251
- defaultProtocol: 'https',
252
- })
253
- ];
254
- if(this.$props.table) {
255
- extensions.push(
256
- Table.configure({
257
- resizable: true,
258
- }),
259
- TableRow,
260
- TableHeader,
261
- TableCell);
262
- }
263
-
264
- this.editor = new Editor({
265
- extensions: extensions,
266
- });
267
- this.setValue();
268
-
269
- this.editor.on('blur', ({ editor, event }) => {
270
- const value = editor.isEmpty ? '' : event.srcElement.innerHTML;
271
- if(this.hold !== value) {
272
- this.hold = value;
273
- this.$emit("update:modelValue", this.hold);
274
- }
275
- })
276
- },
277
- };
278
- </script>
package/form/basic.vue DELETED
@@ -1,88 +0,0 @@
1
- <template>
2
- <XInput v-bind="$props">
3
- <template #label>
4
- <slot name="label" />
5
- </template>
6
-
7
- <el-input
8
- v-bind="{ ...$attrs, class: undefined }"
9
- :class="[`${baseClass}__textbox`, type=== 'password' ? 'input--password': '']"
10
- :name="name"
11
- :id="name"
12
- :disabled="disabled"
13
- :minlength="minlength"
14
- :maxlength="maxlength"
15
- :type="type === 'password' && visibility ? 'text' : type"
16
- :placeholder="placeholder"
17
- v-model="content"
18
- :required="required"
19
- @input="handleInput"
20
- :parser="parser"
21
- :formatter="formatter"
22
- >
23
-
24
- <template v-if="prepend" #prepend>
25
- <slot name="prepend" />
26
- </template>
27
- <template v-if="append || type === 'password'" #append>
28
- <slot name="append" />
29
-
30
- <div v-if="type === 'password'" class="form__icon-container">
31
- <GSvg name="icon-error" class="form__error-icon icon" embed artboard v-if="error && error.first(name)" />
32
- <GSvg :name="visibility ? 'icon-visibility' : 'icon-visibility-off'" class="form__action-icon icon pointer" embed artboard @click="visibility = !visibility" />
33
- </div>
34
- </template>
35
- </el-input>
36
- </XInput>
37
- </template>
38
-
39
- <script>
40
- import { ElInput } from "element-plus";
41
- import input from "./input.js";
42
- import XInput from "./input.vue";
43
-
44
- export default {
45
- mixins: [input],
46
- props: {
47
- ...input.props,
48
- baseClass: {
49
- type: String,
50
- default: "vel-basic",
51
- },
52
- minlength: {
53
- type: Number,
54
- default: null,
55
- },
56
- maxlength: {
57
- type: Number,
58
- default: null,
59
- },
60
- prepend: {
61
- type: String,
62
- default: null,
63
- },
64
- append: {
65
- type: String,
66
- default: null,
67
- },
68
- parser: {
69
- type: Function,
70
- default: null,
71
- },
72
- formatter: {
73
- type: Function,
74
- default: null,
75
- }
76
- },
77
- data() {
78
- return {
79
- visibility: false
80
- }
81
- },
82
-
83
- components: {
84
- XInput,
85
- ElInput,
86
- },
87
- };
88
- </script>
package/form/color.vue DELETED
@@ -1,22 +0,0 @@
1
- <template>
2
- <XInput v-bind="$props">
3
- <template #label>
4
- <slot name="label" />
5
- </template>
6
-
7
- <el-color-picker v-model="content" @change="handleInput" />
8
- </XInput>
9
- </template>
10
-
11
- <script>
12
- import input from "./input.js";
13
- import XInput from "./input.vue";
14
-
15
- export default {
16
- mixins: [input],
17
-
18
- components: {
19
- XInput,
20
- },
21
- };
22
- </script>