goodteditor-ui 1.0.26 → 1.0.28

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 (116) hide show
  1. package/.eslintrc.js +7 -7
  2. package/.prettierrc +14 -14
  3. package/README.md +35 -35
  4. package/babel.config.js +5 -5
  5. package/index.js +53 -53
  6. package/jsconfig.json +13 -13
  7. package/package.json +67 -67
  8. package/src/App.vue +36 -36
  9. package/src/components/ui/Avatar.md +68 -68
  10. package/src/components/ui/Avatar.vue +180 -180
  11. package/src/components/ui/Badge.md +20 -20
  12. package/src/components/ui/Badge.vue +75 -75
  13. package/src/components/ui/Collapse.md +90 -90
  14. package/src/components/ui/Collapse.vue +86 -86
  15. package/src/components/ui/ColorPicker/Alpha.vue +114 -114
  16. package/src/components/ui/ColorPicker/Colors.vue +117 -117
  17. package/src/components/ui/ColorPicker/Hue.vue +113 -113
  18. package/src/components/ui/ColorPicker/Preview.vue +55 -55
  19. package/src/components/ui/ColorPicker/Saturation.vue +123 -123
  20. package/src/components/ui/ColorPicker/mixin.js +105 -105
  21. package/src/components/ui/ColorPicker.md +17 -17
  22. package/src/components/ui/ColorPicker.vue +314 -314
  23. package/src/components/ui/Datalist.md +41 -41
  24. package/src/components/ui/Datalist.vue +164 -164
  25. package/src/components/ui/DatePicker.md +168 -168
  26. package/src/components/ui/DatePicker.vue +527 -527
  27. package/src/components/ui/FileSelector.md +105 -105
  28. package/src/components/ui/FileSelector.vue +82 -82
  29. package/src/components/ui/Grid.md +130 -130
  30. package/src/components/ui/Grid.vue +92 -92
  31. package/src/components/ui/Image.md +59 -59
  32. package/src/components/ui/Image.vue +57 -57
  33. package/src/components/ui/InputAutocomplete.md +115 -115
  34. package/src/components/ui/InputAutocomplete.vue +374 -349
  35. package/src/components/ui/InputColorPicker.md +51 -51
  36. package/src/components/ui/InputColorPicker.vue +151 -151
  37. package/src/components/ui/InputDatePicker.md +121 -121
  38. package/src/components/ui/InputDatePicker.vue +326 -326
  39. package/src/components/ui/InputTags.md +51 -51
  40. package/src/components/ui/InputTags.vue +184 -184
  41. package/src/components/ui/InputTimePicker.md +25 -25
  42. package/src/components/ui/InputTimePicker.vue +253 -253
  43. package/src/components/ui/InputUnits.md +20 -20
  44. package/src/components/ui/InputUnits.vue +257 -257
  45. package/src/components/ui/Lazy.md +37 -37
  46. package/src/components/ui/Lazy.vue +92 -92
  47. package/src/components/ui/Pagination.md +74 -74
  48. package/src/components/ui/Pagination.vue +138 -138
  49. package/src/components/ui/Paginator.md +34 -34
  50. package/src/components/ui/Paginator.vue +83 -83
  51. package/src/components/ui/Popover.md +34 -34
  52. package/src/components/ui/Popover.vue +274 -274
  53. package/src/components/ui/Popup.md +59 -59
  54. package/src/components/ui/Popup.vue +150 -150
  55. package/src/components/ui/ResponsiveContainer.md +58 -58
  56. package/src/components/ui/ResponsiveContainer.vue +99 -99
  57. package/src/components/ui/Select.md +187 -187
  58. package/src/components/ui/Select.vue +421 -421
  59. package/src/components/ui/TimePicker.md +50 -50
  60. package/src/components/ui/TimePicker.vue +252 -252
  61. package/src/components/ui/Tooltip.md +54 -54
  62. package/src/components/ui/Tooltip.vue +113 -113
  63. package/src/components/ui/WysiwygEditor/WysiwygEditor.d.ts +128 -128
  64. package/src/components/ui/WysiwygEditor/constants.js +273 -273
  65. package/src/components/ui/WysiwygEditor/extensions/blockquote.js +15 -15
  66. package/src/components/ui/WysiwygEditor/extensions/bold.js +15 -15
  67. package/src/components/ui/WysiwygEditor/extensions/bullet-list.js +15 -15
  68. package/src/components/ui/WysiwygEditor/extensions/code-block.js +13 -13
  69. package/src/components/ui/WysiwygEditor/extensions/code.js +13 -13
  70. package/src/components/ui/WysiwygEditor/extensions/font-size.js +34 -34
  71. package/src/components/ui/WysiwygEditor/extensions/formatting.js +14 -14
  72. package/src/components/ui/WysiwygEditor/extensions/heading.js +13 -13
  73. package/src/components/ui/WysiwygEditor/extensions/horizontal-rule.js +15 -15
  74. package/src/components/ui/WysiwygEditor/extensions/image.js +37 -33
  75. package/src/components/ui/WysiwygEditor/extensions/index.d.ts +32 -32
  76. package/src/components/ui/WysiwygEditor/extensions/index.js +32 -32
  77. package/src/components/ui/WysiwygEditor/extensions/italic.js +15 -15
  78. package/src/components/ui/WysiwygEditor/extensions/link.js +16 -16
  79. package/src/components/ui/WysiwygEditor/extensions/list-item.js +15 -15
  80. package/src/components/ui/WysiwygEditor/extensions/ordered-list.js +15 -15
  81. package/src/components/ui/WysiwygEditor/extensions/paragraph.js +23 -23
  82. package/src/components/ui/WysiwygEditor/extensions/strike.js +15 -15
  83. package/src/components/ui/WysiwygEditor/extensions/table-cell.js +13 -13
  84. package/src/components/ui/WysiwygEditor/extensions/table-header.js +15 -15
  85. package/src/components/ui/WysiwygEditor/extensions/table-row.js +15 -15
  86. package/src/components/ui/WysiwygEditor/extensions/table.js +29 -29
  87. package/src/components/ui/WysiwygEditor/extensions/text-align.js +6 -6
  88. package/src/components/ui/WysiwygEditor/extensions/text-style.js +12 -12
  89. package/src/components/ui/WysiwygEditor/extensions/underline.js +15 -15
  90. package/src/components/ui/WysiwygEditor/index.d.ts +4 -4
  91. package/src/components/ui/WysiwygEditor/index.js +4 -4
  92. package/src/components/ui/WysiwygEditor/renders/Button.vue +28 -28
  93. package/src/components/ui/WysiwygEditor/renders/ColorPicker.vue +41 -41
  94. package/src/components/ui/WysiwygEditor/renders/Image.vue +200 -162
  95. package/src/components/ui/WysiwygEditor/renders/InputAuto.vue +34 -34
  96. package/src/components/ui/WysiwygEditor/renders/InputUnits.vue +37 -37
  97. package/src/components/ui/WysiwygEditor/renders/Link.vue +82 -82
  98. package/src/components/ui/WysiwygEditor/renders/Select.vue +47 -47
  99. package/src/components/ui/WysiwygEditor/renders/ToolbarPopover.vue +49 -49
  100. package/src/components/ui/WysiwygEditor/renders/components/Popover.vue +15 -0
  101. package/src/components/ui/WysiwygEditor/renders/components/WithPopover.vue +35 -35
  102. package/src/components/ui/WysiwygEditor/renders/index.d.ts +8 -8
  103. package/src/components/ui/WysiwygEditor/renders/index.js +8 -8
  104. package/src/components/ui/WysiwygEditor/renders/mixins/RenderMixin.js +39 -39
  105. package/src/components/ui/WysiwygEditor/renders/mixins/index.js +1 -1
  106. package/src/components/ui/WysiwygEditor/tools-and-commands.js +709 -702
  107. package/src/components/ui/WysiwygEditor/utils.js +72 -72
  108. package/src/components/ui/WysiwygEditor.md +18 -18
  109. package/src/components/ui/WysiwygEditor.vue +266 -266
  110. package/src/components/ui/utils/FormComponent.js +107 -107
  111. package/src/components/ui/utils/Helpers.js +84 -84
  112. package/src/components/ui/utils/WithPopover.js +81 -81
  113. package/src/main.js +8 -8
  114. package/styleguide.config.js +37 -37
  115. package/vue.config.js +8 -8
  116. package/dist/js.png +0 -0
@@ -1,41 +1,41 @@
1
- ```vue
2
- <template>
3
- <div class="pad-l5">
4
- <ui-datalist class="d-block w-f2" v-bind="props" v-on="events"></ui-datalist>
5
- <pre>{{ selected }}</pre>
6
- </div>
7
- </template>
8
- <script>
9
- import UiDatalist from './Datalist.vue';
10
-
11
- let options = [
12
- 'angular',
13
- 'aurelia',
14
- 'backbone',
15
- 'ember',
16
- 'meteor',
17
- 'react',
18
- 'riot',
19
- 'stencil',
20
- 'svelte',
21
- 'vue',
22
- ];
23
-
24
- export default {
25
- components: { UiDatalist },
26
- data() {
27
- return {
28
- selected: null,
29
- props: {
30
- options,
31
- },
32
- events: {
33
- 'select-option': data => {
34
- this.selected = data;
35
- },
36
- },
37
- };
38
- },
39
- };
40
- </script>
41
- ```
1
+ ```vue
2
+ <template>
3
+ <div class="pad-l5">
4
+ <ui-datalist class="d-block w-f2" v-bind="props" v-on="events"></ui-datalist>
5
+ <pre>{{ selected }}</pre>
6
+ </div>
7
+ </template>
8
+ <script>
9
+ import UiDatalist from './Datalist.vue';
10
+
11
+ let options = [
12
+ 'angular',
13
+ 'aurelia',
14
+ 'backbone',
15
+ 'ember',
16
+ 'meteor',
17
+ 'react',
18
+ 'riot',
19
+ 'stencil',
20
+ 'svelte',
21
+ 'vue',
22
+ ];
23
+
24
+ export default {
25
+ components: { UiDatalist },
26
+ data() {
27
+ return {
28
+ selected: null,
29
+ props: {
30
+ options,
31
+ },
32
+ events: {
33
+ 'select-option': data => {
34
+ this.selected = data;
35
+ },
36
+ },
37
+ };
38
+ },
39
+ };
40
+ </script>
41
+ ```
@@ -1,164 +1,164 @@
1
- <template>
2
- <div class="ui-datalist dropdown" :class="cssClass">
3
- <!--
4
- @slot Dropdown header slot
5
- -->
6
- <slot name="header"></slot>
7
- <ul ref="ul" :style="{ maxHeight }">
8
- <!--
9
- @slot Label slot for single mode
10
- @binding {Object} option option
11
- @binding {Number} index option's index
12
- @binding {Number} cursorIndex cursor index
13
- @binding {Function} setCursorIndex sets cursor index
14
- -->
15
- <slot
16
- name="option"
17
- v-for="(option, index) in options"
18
- v-bind="{
19
- option,
20
- index,
21
- cursorIndex,
22
- setCursorIndex,
23
- }"
24
- >
25
- <li
26
- :class="{ active: index == cursorIndex }"
27
- :key="index"
28
- @click="onOptionClick(option, index)"
29
- >
30
- <div class="text-truncate" style="min-height: calc(var(--line-height) * 1rem)">
31
- {{ option }}
32
- </div>
33
- </li>
34
- </slot>
35
- </ul>
36
- <!--
37
- @slot Dropdown footer slot
38
- -->
39
- <slot name="footer"></slot>
40
- </div>
41
- </template>
42
- <style lang="less" scoped>
43
- .dropdown {
44
- outline: none;
45
- ul {
46
- scroll-behavior: smooth;
47
- }
48
- &.no-scroll-animation {
49
- ul {
50
- scroll-behavior: auto;
51
- }
52
- }
53
- }
54
- </style>
55
- <script>
56
- import { scrollIntoView, Key } from './utils/Helpers';
57
-
58
- export default {
59
- props: {
60
- /**
61
- * Options
62
- */
63
- options: {
64
- type: Array,
65
- default() {
66
- return [];
67
- },
68
- },
69
- /**
70
- * Defines the size of the component
71
- * @values '', small, large
72
- */
73
- size: {
74
- type: String,
75
- default: '',
76
- validator: function (value) {
77
- return ['', 'small', 'large'].indexOf(value) >= 0;
78
- },
79
- },
80
- /**
81
- * Defines the max-height of the dropdown list (value may be any css unit/expression)
82
- */
83
- maxHeight: {
84
- type: String,
85
- default: '',
86
- },
87
- /**
88
- * The current cursor index position (.sync)
89
- */
90
- cursorIndex: {
91
- type: Number,
92
- default: -1,
93
- },
94
- },
95
- data() {
96
- return { useScrollAnimation: true };
97
- },
98
- computed: {
99
- cssClass() {
100
- let { size, useScrollAnimation } = this;
101
- let o = [];
102
- size && o.push(`dropdown-${this.size}`);
103
- !useScrollAnimation && o.push('no-scroll-animation');
104
- return o;
105
- },
106
- },
107
- watch: {
108
- cursorIndex: {
109
- handler(val) {
110
- this.useScrollAnimation = false;
111
- setTimeout(() => {
112
- let c = this.$refs.ul ? this.$refs.ul.children[val] : null;
113
- scrollIntoView(c);
114
- this.useScrollAnimation = true;
115
- });
116
- },
117
- immediate: true,
118
- },
119
- },
120
- methods: {
121
- onOptionClick(option, index) {
122
- /**
123
- * Select option event
124
- * @property {Object} { option, index }
125
- */
126
- this.$emit('select-option', { option, index });
127
- },
128
- setCursorIndex(index) {
129
- if (index < 0 || index >= this.options.length) {
130
- return;
131
- }
132
- /**
133
- * Update cursor index event (.sync)
134
- * @property {Number} index
135
- */
136
- this.$emit('update:cursorIndex', index);
137
- },
138
- onKeyDown(e) {
139
- if (e.key === Key.UP) {
140
- if (this.cursorIndex > 0) {
141
- e.preventDefault();
142
- this.setCursorIndex(this.cursorIndex - 1);
143
- }
144
- } else if (e.key === Key.DOWN) {
145
- if (this.cursorIndex < this.options.length - 1) {
146
- e.preventDefault();
147
- this.setCursorIndex(this.cursorIndex + 1);
148
- }
149
- } else if (e.key === Key.ENTER && this.options.length) {
150
- e.preventDefault();
151
- let option = this.options[this.cursorIndex];
152
- if (!option) {
153
- return;
154
- }
155
- /**
156
- * Select option event
157
- * @property {Object} { option, index }
158
- */
159
- this.$emit('select-option', { option, index: this.cursorIndex });
160
- }
161
- },
162
- },
163
- };
164
- </script>
1
+ <template>
2
+ <div class="ui-datalist dropdown" :class="cssClass">
3
+ <!--
4
+ @slot Dropdown header slot
5
+ -->
6
+ <slot name="header"></slot>
7
+ <ul ref="ul" :style="{ maxHeight }">
8
+ <!--
9
+ @slot Label slot for single mode
10
+ @binding {Object} option option
11
+ @binding {Number} index option's index
12
+ @binding {Number} cursorIndex cursor index
13
+ @binding {Function} setCursorIndex sets cursor index
14
+ -->
15
+ <slot
16
+ name="option"
17
+ v-for="(option, index) in options"
18
+ v-bind="{
19
+ option,
20
+ index,
21
+ cursorIndex,
22
+ setCursorIndex,
23
+ }"
24
+ >
25
+ <li
26
+ :class="{ active: index == cursorIndex }"
27
+ :key="index"
28
+ @click="onOptionClick(option, index)"
29
+ >
30
+ <div class="text-truncate" style="min-height: calc(var(--line-height) * 1rem)">
31
+ {{ option }}
32
+ </div>
33
+ </li>
34
+ </slot>
35
+ </ul>
36
+ <!--
37
+ @slot Dropdown footer slot
38
+ -->
39
+ <slot name="footer"></slot>
40
+ </div>
41
+ </template>
42
+ <style lang="less" scoped>
43
+ .dropdown {
44
+ outline: none;
45
+ ul {
46
+ scroll-behavior: smooth;
47
+ }
48
+ &.no-scroll-animation {
49
+ ul {
50
+ scroll-behavior: auto;
51
+ }
52
+ }
53
+ }
54
+ </style>
55
+ <script>
56
+ import { scrollIntoView, Key } from './utils/Helpers';
57
+
58
+ export default {
59
+ props: {
60
+ /**
61
+ * Options
62
+ */
63
+ options: {
64
+ type: Array,
65
+ default() {
66
+ return [];
67
+ },
68
+ },
69
+ /**
70
+ * Defines the size of the component
71
+ * @values '', small, large
72
+ */
73
+ size: {
74
+ type: String,
75
+ default: '',
76
+ validator: function (value) {
77
+ return ['', 'small', 'large'].indexOf(value) >= 0;
78
+ },
79
+ },
80
+ /**
81
+ * Defines the max-height of the dropdown list (value may be any css unit/expression)
82
+ */
83
+ maxHeight: {
84
+ type: String,
85
+ default: '',
86
+ },
87
+ /**
88
+ * The current cursor index position (.sync)
89
+ */
90
+ cursorIndex: {
91
+ type: Number,
92
+ default: -1,
93
+ },
94
+ },
95
+ data() {
96
+ return { useScrollAnimation: true };
97
+ },
98
+ computed: {
99
+ cssClass() {
100
+ let { size, useScrollAnimation } = this;
101
+ let o = [];
102
+ size && o.push(`dropdown-${this.size}`);
103
+ !useScrollAnimation && o.push('no-scroll-animation');
104
+ return o;
105
+ },
106
+ },
107
+ watch: {
108
+ cursorIndex: {
109
+ handler(val) {
110
+ this.useScrollAnimation = false;
111
+ setTimeout(() => {
112
+ let c = this.$refs.ul ? this.$refs.ul.children[val] : null;
113
+ scrollIntoView(c);
114
+ this.useScrollAnimation = true;
115
+ });
116
+ },
117
+ immediate: true,
118
+ },
119
+ },
120
+ methods: {
121
+ onOptionClick(option, index) {
122
+ /**
123
+ * Select option event
124
+ * @property {Object} { option, index }
125
+ */
126
+ this.$emit('select-option', { option, index });
127
+ },
128
+ setCursorIndex(index) {
129
+ if (index < 0 || index >= this.options.length) {
130
+ return;
131
+ }
132
+ /**
133
+ * Update cursor index event (.sync)
134
+ * @property {Number} index
135
+ */
136
+ this.$emit('update:cursorIndex', index);
137
+ },
138
+ onKeyDown(e) {
139
+ if (e.key === Key.UP) {
140
+ if (this.cursorIndex > 0) {
141
+ e.preventDefault();
142
+ this.setCursorIndex(this.cursorIndex - 1);
143
+ }
144
+ } else if (e.key === Key.DOWN) {
145
+ if (this.cursorIndex < this.options.length - 1) {
146
+ e.preventDefault();
147
+ this.setCursorIndex(this.cursorIndex + 1);
148
+ }
149
+ } else if (e.key === Key.ENTER && this.options.length) {
150
+ e.preventDefault();
151
+ let option = this.options[this.cursorIndex];
152
+ if (!option) {
153
+ return;
154
+ }
155
+ /**
156
+ * Select option event
157
+ * @property {Object} { option, index }
158
+ */
159
+ this.$emit('select-option', { option, index: this.cursorIndex });
160
+ }
161
+ },
162
+ },
163
+ };
164
+ </script>