goodteditor-ui 1.0.23 → 1.0.25

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 (114) 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/dist/js.png +0 -0
  6. package/index.js +53 -53
  7. package/jsconfig.json +13 -13
  8. package/package.json +67 -66
  9. package/src/App.vue +36 -36
  10. package/src/components/ui/Avatar.md +68 -68
  11. package/src/components/ui/Avatar.vue +180 -180
  12. package/src/components/ui/Badge.md +20 -20
  13. package/src/components/ui/Badge.vue +75 -75
  14. package/src/components/ui/Collapse.md +90 -90
  15. package/src/components/ui/Collapse.vue +86 -86
  16. package/src/components/ui/ColorPicker/Alpha.vue +114 -114
  17. package/src/components/ui/ColorPicker/Colors.vue +117 -117
  18. package/src/components/ui/ColorPicker/Hue.vue +113 -113
  19. package/src/components/ui/ColorPicker/Preview.vue +55 -55
  20. package/src/components/ui/ColorPicker/Saturation.vue +123 -123
  21. package/src/components/ui/ColorPicker/mixin.js +105 -105
  22. package/src/components/ui/ColorPicker.md +17 -17
  23. package/src/components/ui/ColorPicker.vue +314 -314
  24. package/src/components/ui/Datalist.md +41 -41
  25. package/src/components/ui/Datalist.vue +164 -157
  26. package/src/components/ui/DatePicker.md +168 -168
  27. package/src/components/ui/DatePicker.vue +527 -527
  28. package/src/components/ui/FileSelector.md +105 -105
  29. package/src/components/ui/FileSelector.vue +82 -82
  30. package/src/components/ui/Grid.md +130 -130
  31. package/src/components/ui/Grid.vue +92 -92
  32. package/src/components/ui/Image.md +59 -59
  33. package/src/components/ui/Image.vue +57 -57
  34. package/src/components/ui/InputAutocomplete.md +115 -115
  35. package/src/components/ui/InputAutocomplete.vue +349 -341
  36. package/src/components/ui/InputColorPicker.md +51 -51
  37. package/src/components/ui/InputColorPicker.vue +151 -151
  38. package/src/components/ui/InputDatePicker.md +121 -121
  39. package/src/components/ui/InputDatePicker.vue +326 -326
  40. package/src/components/ui/InputTags.md +51 -51
  41. package/src/components/ui/InputTags.vue +184 -184
  42. package/src/components/ui/InputTimePicker.md +25 -25
  43. package/src/components/ui/InputTimePicker.vue +253 -253
  44. package/src/components/ui/InputUnits.md +20 -20
  45. package/src/components/ui/InputUnits.vue +257 -257
  46. package/src/components/ui/Lazy.md +37 -37
  47. package/src/components/ui/Lazy.vue +92 -92
  48. package/src/components/ui/Pagination.md +74 -74
  49. package/src/components/ui/Pagination.vue +138 -138
  50. package/src/components/ui/Paginator.md +34 -34
  51. package/src/components/ui/Paginator.vue +83 -83
  52. package/src/components/ui/Popover.md +34 -34
  53. package/src/components/ui/Popover.vue +274 -274
  54. package/src/components/ui/Popup.md +59 -59
  55. package/src/components/ui/Popup.vue +150 -150
  56. package/src/components/ui/ResponsiveContainer.md +58 -58
  57. package/src/components/ui/ResponsiveContainer.vue +99 -99
  58. package/src/components/ui/Select.md +187 -187
  59. package/src/components/ui/Select.vue +421 -421
  60. package/src/components/ui/TimePicker.md +50 -50
  61. package/src/components/ui/TimePicker.vue +252 -252
  62. package/src/components/ui/Tooltip.md +54 -54
  63. package/src/components/ui/Tooltip.vue +113 -113
  64. package/src/components/ui/WysiwygEditor/WysiwygEditor.d.ts +119 -119
  65. package/src/components/ui/WysiwygEditor/constants.js +264 -264
  66. package/src/components/ui/WysiwygEditor/extensions/blockquote.js +15 -15
  67. package/src/components/ui/WysiwygEditor/extensions/bold.js +15 -15
  68. package/src/components/ui/WysiwygEditor/extensions/bullet-list.js +15 -15
  69. package/src/components/ui/WysiwygEditor/extensions/code-block.js +13 -13
  70. package/src/components/ui/WysiwygEditor/extensions/code.js +13 -13
  71. package/src/components/ui/WysiwygEditor/extensions/font-size.js +34 -34
  72. package/src/components/ui/WysiwygEditor/extensions/formatting.js +14 -14
  73. package/src/components/ui/WysiwygEditor/extensions/heading.js +13 -13
  74. package/src/components/ui/WysiwygEditor/extensions/horizontal-rule.js +15 -15
  75. package/src/components/ui/WysiwygEditor/extensions/image.js +19 -19
  76. package/src/components/ui/WysiwygEditor/extensions/index.d.ts +32 -32
  77. package/src/components/ui/WysiwygEditor/extensions/index.js +32 -32
  78. package/src/components/ui/WysiwygEditor/extensions/italic.js +15 -15
  79. package/src/components/ui/WysiwygEditor/extensions/link.js +16 -16
  80. package/src/components/ui/WysiwygEditor/extensions/list-item.js +15 -15
  81. package/src/components/ui/WysiwygEditor/extensions/ordered-list.js +15 -15
  82. package/src/components/ui/WysiwygEditor/extensions/paragraph.js +23 -23
  83. package/src/components/ui/WysiwygEditor/extensions/strike.js +15 -15
  84. package/src/components/ui/WysiwygEditor/extensions/table-cell.js +13 -13
  85. package/src/components/ui/WysiwygEditor/extensions/table-header.js +15 -15
  86. package/src/components/ui/WysiwygEditor/extensions/table-row.js +15 -15
  87. package/src/components/ui/WysiwygEditor/extensions/table.js +29 -29
  88. package/src/components/ui/WysiwygEditor/extensions/text-align.js +6 -6
  89. package/src/components/ui/WysiwygEditor/extensions/text-style.js +15 -15
  90. package/src/components/ui/WysiwygEditor/extensions/underline.js +15 -15
  91. package/src/components/ui/WysiwygEditor/index.d.ts +4 -4
  92. package/src/components/ui/WysiwygEditor/index.js +4 -4
  93. package/src/components/ui/WysiwygEditor/renders/Button.vue +28 -28
  94. package/src/components/ui/WysiwygEditor/renders/ColorPicker.vue +41 -41
  95. package/src/components/ui/WysiwygEditor/renders/InputAuto.vue +34 -34
  96. package/src/components/ui/WysiwygEditor/renders/InputBrowse.vue +35 -35
  97. package/src/components/ui/WysiwygEditor/renders/InputUnits.vue +38 -38
  98. package/src/components/ui/WysiwygEditor/renders/Link.vue +87 -87
  99. package/src/components/ui/WysiwygEditor/renders/Select.vue +47 -47
  100. package/src/components/ui/WysiwygEditor/renders/ToolbarPopover.vue +49 -49
  101. package/src/components/ui/WysiwygEditor/renders/index.d.ts +8 -8
  102. package/src/components/ui/WysiwygEditor/renders/index.js +8 -8
  103. package/src/components/ui/WysiwygEditor/renders/mixins/RenderMixin.js +39 -39
  104. package/src/components/ui/WysiwygEditor/renders/mixins/index.js +1 -1
  105. package/src/components/ui/WysiwygEditor/tools-and-commands.js +704 -704
  106. package/src/components/ui/WysiwygEditor/utils.js +72 -72
  107. package/src/components/ui/WysiwygEditor.md +18 -18
  108. package/src/components/ui/WysiwygEditor.vue +266 -271
  109. package/src/components/ui/utils/FormComponent.js +107 -107
  110. package/src/components/ui/utils/Helpers.js +84 -84
  111. package/src/components/ui/utils/WithPopover.js +81 -81
  112. package/src/main.js +8 -8
  113. package/styleguide.config.js +37 -37
  114. package/vue.config.js +8 -8
@@ -1,180 +1,180 @@
1
- <template>
2
- <div class="ui-avatar" :style="cssStyle">
3
- <img
4
- class="ui-avatar__img"
5
- :src="src"
6
- :alt="isDoneState ? alt : ''"
7
- @error="onImageError"
8
- @load="onImageLoad"
9
- v-if="isLoadingState || isDoneState"
10
- />
11
- <div class="ui-avatar__alt" v-if="isErrorState">
12
- <!--
13
- @slot Alternative content slot (displayed if no image provided)
14
- @binding {string} alt alternative text
15
- @binding {string} abbr alternative text abbr
16
- -->
17
- <slot v-bind="{ alt, abbr }">
18
- <b class="ui-avatar__abbr">{{ abbr }}</b>
19
- </slot>
20
- </div>
21
- <div class="ui-avatar__loading" v-else-if="isLoadingState">
22
- <!--
23
- @slot Loading content slot
24
- -->
25
- <slot name="loading">
26
- <div class="preloader color-inherit"></div>
27
- </slot>
28
- </div>
29
- </div>
30
- </template>
31
- <style lang="less" scoped>
32
- .ui-avatar {
33
- --size: 2rem;
34
- --alt-scale: 0.4;
35
- position: relative;
36
- width: var(--size);
37
- height: var(--size);
38
- display: inline-flex;
39
- align-items: center;
40
- justify-content: center;
41
- overflow: hidden;
42
- &__abbr {
43
- font-size: calc(var(--size) * var(--alt-scale));
44
- line-height: 1;
45
- }
46
- &__img {
47
- width: 100%;
48
- height: 100%;
49
- object-fit: cover;
50
- }
51
- &__alt,
52
- &__loading {
53
- position: absolute;
54
- }
55
- }
56
- </style>
57
- <script>
58
- const State = {
59
- LOADING: 'loading',
60
- ERROR: 'error',
61
- DONE: 'done',
62
- };
63
- export default {
64
- props: {
65
- /**
66
- * Avatar src url
67
- */
68
- src: {
69
- type: String,
70
- default: '',
71
- },
72
- /**
73
- * Alternative text
74
- */
75
- alt: {
76
- type: String,
77
- default: '',
78
- },
79
- /**
80
- * Color (any web color format)
81
- */
82
- color: {
83
- type: String,
84
- default: '#fff',
85
- },
86
- /**
87
- * Background color (any web color format)
88
- */
89
- background: {
90
- type: String,
91
- default: '#999',
92
- },
93
- /**
94
- * Whether the avatar should be around
95
- */
96
- round: {
97
- type: Boolean,
98
- default: true,
99
- },
100
- /**
101
- * Defines avatar's size (any web size)
102
- */
103
- size: {
104
- type: String,
105
- default: '2rem',
106
- },
107
- },
108
- data: () => ({ state: State.LOADING }),
109
- computed: {
110
- /**
111
- * @return {boolean}
112
- */
113
- isLoadingState() {
114
- return this.state === State.LOADING;
115
- },
116
- /**
117
- * @return {boolean}
118
- */
119
- isErrorState() {
120
- return this.state === State.ERROR;
121
- },
122
- /**
123
- * @return {boolean}
124
- */
125
- isDoneState() {
126
- return this.state === State.DONE;
127
- },
128
- /**
129
- * @return {object}
130
- */
131
- cssClass() {
132
- return { 'ui-avatar--round': this.round };
133
- },
134
- /**
135
- * @return {object}
136
- */
137
- cssStyle() {
138
- const { size, color, round, background } = this;
139
- const borderRadius = round ? '50%' : 0;
140
- return { '--size': size, height: size, color, background, borderRadius };
141
- },
142
- /**
143
- * @return {string}
144
- */
145
- abbr() {
146
- const str = this.alt ?? '';
147
- return str
148
- .split(' ')
149
- .map(s => (s.length ? s[0].toUpperCase() : ''))
150
- .join('');
151
- },
152
- },
153
- watch: {
154
- src: {
155
- handler(val) {
156
- this.state = val ? State.LOADING : State.ERROR;
157
- },
158
- immediate: true,
159
- },
160
- },
161
- methods: {
162
- onImageError(event) {
163
- this.state = State.ERROR;
164
- /**
165
- * Error event
166
- * @property {Event} event
167
- */
168
- this.$emit('error', event);
169
- },
170
- onImageLoad(event) {
171
- this.state = State.DONE;
172
- /**
173
- * Load event
174
- * @property {Event} event
175
- */
176
- this.$emit('load', event);
177
- },
178
- },
179
- };
180
- </script>
1
+ <template>
2
+ <div class="ui-avatar" :style="cssStyle">
3
+ <img
4
+ class="ui-avatar__img"
5
+ :src="src"
6
+ :alt="isDoneState ? alt : ''"
7
+ @error="onImageError"
8
+ @load="onImageLoad"
9
+ v-if="isLoadingState || isDoneState"
10
+ />
11
+ <div class="ui-avatar__alt" v-if="isErrorState">
12
+ <!--
13
+ @slot Alternative content slot (displayed if no image provided)
14
+ @binding {string} alt alternative text
15
+ @binding {string} abbr alternative text abbr
16
+ -->
17
+ <slot v-bind="{ alt, abbr }">
18
+ <b class="ui-avatar__abbr">{{ abbr }}</b>
19
+ </slot>
20
+ </div>
21
+ <div class="ui-avatar__loading" v-else-if="isLoadingState">
22
+ <!--
23
+ @slot Loading content slot
24
+ -->
25
+ <slot name="loading">
26
+ <div class="preloader color-inherit"></div>
27
+ </slot>
28
+ </div>
29
+ </div>
30
+ </template>
31
+ <style lang="less" scoped>
32
+ .ui-avatar {
33
+ --size: 2rem;
34
+ --alt-scale: 0.4;
35
+ position: relative;
36
+ width: var(--size);
37
+ height: var(--size);
38
+ display: inline-flex;
39
+ align-items: center;
40
+ justify-content: center;
41
+ overflow: hidden;
42
+ &__abbr {
43
+ font-size: calc(var(--size) * var(--alt-scale));
44
+ line-height: 1;
45
+ }
46
+ &__img {
47
+ width: 100%;
48
+ height: 100%;
49
+ object-fit: cover;
50
+ }
51
+ &__alt,
52
+ &__loading {
53
+ position: absolute;
54
+ }
55
+ }
56
+ </style>
57
+ <script>
58
+ const State = {
59
+ LOADING: 'loading',
60
+ ERROR: 'error',
61
+ DONE: 'done',
62
+ };
63
+ export default {
64
+ props: {
65
+ /**
66
+ * Avatar src url
67
+ */
68
+ src: {
69
+ type: String,
70
+ default: '',
71
+ },
72
+ /**
73
+ * Alternative text
74
+ */
75
+ alt: {
76
+ type: String,
77
+ default: '',
78
+ },
79
+ /**
80
+ * Color (any web color format)
81
+ */
82
+ color: {
83
+ type: String,
84
+ default: '#fff',
85
+ },
86
+ /**
87
+ * Background color (any web color format)
88
+ */
89
+ background: {
90
+ type: String,
91
+ default: '#999',
92
+ },
93
+ /**
94
+ * Whether the avatar should be around
95
+ */
96
+ round: {
97
+ type: Boolean,
98
+ default: true,
99
+ },
100
+ /**
101
+ * Defines avatar's size (any web size)
102
+ */
103
+ size: {
104
+ type: String,
105
+ default: '2rem',
106
+ },
107
+ },
108
+ data: () => ({ state: State.LOADING }),
109
+ computed: {
110
+ /**
111
+ * @return {boolean}
112
+ */
113
+ isLoadingState() {
114
+ return this.state === State.LOADING;
115
+ },
116
+ /**
117
+ * @return {boolean}
118
+ */
119
+ isErrorState() {
120
+ return this.state === State.ERROR;
121
+ },
122
+ /**
123
+ * @return {boolean}
124
+ */
125
+ isDoneState() {
126
+ return this.state === State.DONE;
127
+ },
128
+ /**
129
+ * @return {object}
130
+ */
131
+ cssClass() {
132
+ return { 'ui-avatar--round': this.round };
133
+ },
134
+ /**
135
+ * @return {object}
136
+ */
137
+ cssStyle() {
138
+ const { size, color, round, background } = this;
139
+ const borderRadius = round ? '50%' : 0;
140
+ return { '--size': size, height: size, color, background, borderRadius };
141
+ },
142
+ /**
143
+ * @return {string}
144
+ */
145
+ abbr() {
146
+ const str = this.alt ?? '';
147
+ return str
148
+ .split(' ')
149
+ .map(s => (s.length ? s[0].toUpperCase() : ''))
150
+ .join('');
151
+ },
152
+ },
153
+ watch: {
154
+ src: {
155
+ handler(val) {
156
+ this.state = val ? State.LOADING : State.ERROR;
157
+ },
158
+ immediate: true,
159
+ },
160
+ },
161
+ methods: {
162
+ onImageError(event) {
163
+ this.state = State.ERROR;
164
+ /**
165
+ * Error event
166
+ * @property {Event} event
167
+ */
168
+ this.$emit('error', event);
169
+ },
170
+ onImageLoad(event) {
171
+ this.state = State.DONE;
172
+ /**
173
+ * Load event
174
+ * @property {Event} event
175
+ */
176
+ this.$emit('load', event);
177
+ },
178
+ },
179
+ };
180
+ </script>
@@ -1,20 +1,20 @@
1
- ```vue
2
- <template>
3
- <div class="pad-l5">
4
- <ui-badge>badge</ui-badge>
5
- <ui-badge theme="success" removable @remove="onRemove">badge</ui-badge>
6
- </div>
7
- </template>
8
- <script>
9
- import UiBadge from './Badge.vue';
10
-
11
- export default {
12
- components: { UiBadge },
13
- methods: {
14
- onRemove() {
15
- alert('remove badge');
16
- },
17
- },
18
- };
19
- </script>
20
- ```
1
+ ```vue
2
+ <template>
3
+ <div class="pad-l5">
4
+ <ui-badge>badge</ui-badge>
5
+ <ui-badge theme="success" removable @remove="onRemove">badge</ui-badge>
6
+ </div>
7
+ </template>
8
+ <script>
9
+ import UiBadge from './Badge.vue';
10
+
11
+ export default {
12
+ components: { UiBadge },
13
+ methods: {
14
+ onRemove() {
15
+ alert('remove badge');
16
+ },
17
+ },
18
+ };
19
+ </script>
20
+ ```
@@ -1,75 +1,75 @@
1
- <template>
2
- <div class="ui-badge badge" :class="cssClass">
3
- <!-- @slot Content slot -->
4
- <slot></slot>
5
- <!--
6
- @slot Custom 'remove' content (icon, button etc)
7
- @binding {function} remove remove function
8
- -->
9
- <slot name="remove" v-if="removable" :remove="onRemove">
10
- <i class="mdi mdi-close text-small mar-left-2 cursor-pointer" @click="onRemove"></i>
11
- </slot>
12
- </div>
13
- </template>
14
- <style lang="less" scoped>
15
- .ui-badge {
16
- white-space: normal;
17
- overflow-wrap: break-word;
18
- word-break: break-word;
19
- }
20
- </style>
21
- <script>
22
- export default {
23
- props: {
24
- /**
25
- * Size of the badge
26
- * @values '', xsmall, small, large
27
- */
28
- size: {
29
- type: String,
30
- default: '',
31
- validator(val) {
32
- return ['', 'xsmall', 'small', 'large'].indexOf(val) >= 0;
33
- },
34
- },
35
- /**
36
- * Theme of the badge
37
- * @values '', primary, success, warn, error, misc
38
- */
39
- theme: {
40
- type: String,
41
- default: '',
42
- validator(val) {
43
- return ['', 'primary', 'success', 'warn', 'error', 'misc'].indexOf(val) >= 0;
44
- },
45
- },
46
- /**
47
- * Whether the badge has a remove <slot>
48
- */
49
- removable: {
50
- type: Boolean,
51
- default: false,
52
- },
53
- },
54
- computed: {
55
- cssClass() {
56
- let o = {};
57
- if (this.size) {
58
- o[`text-${this.size}`] = true;
59
- }
60
- if (this.theme) {
61
- o[`badge-${this.theme}`] = true;
62
- }
63
- return o;
64
- },
65
- },
66
- methods: {
67
- onRemove() {
68
- /**
69
- * Remove event, emitted when close method is invoked
70
- */
71
- this.$emit('remove');
72
- },
73
- },
74
- };
75
- </script>
1
+ <template>
2
+ <div class="ui-badge badge" :class="cssClass">
3
+ <!-- @slot Content slot -->
4
+ <slot></slot>
5
+ <!--
6
+ @slot Custom 'remove' content (icon, button etc)
7
+ @binding {function} remove remove function
8
+ -->
9
+ <slot name="remove" v-if="removable" :remove="onRemove">
10
+ <i class="mdi mdi-close text-small mar-left-2 cursor-pointer" @click="onRemove"></i>
11
+ </slot>
12
+ </div>
13
+ </template>
14
+ <style lang="less" scoped>
15
+ .ui-badge {
16
+ white-space: normal;
17
+ overflow-wrap: break-word;
18
+ word-break: break-word;
19
+ }
20
+ </style>
21
+ <script>
22
+ export default {
23
+ props: {
24
+ /**
25
+ * Size of the badge
26
+ * @values '', xsmall, small, large
27
+ */
28
+ size: {
29
+ type: String,
30
+ default: '',
31
+ validator(val) {
32
+ return ['', 'xsmall', 'small', 'large'].indexOf(val) >= 0;
33
+ },
34
+ },
35
+ /**
36
+ * Theme of the badge
37
+ * @values '', primary, success, warn, error, misc
38
+ */
39
+ theme: {
40
+ type: String,
41
+ default: '',
42
+ validator(val) {
43
+ return ['', 'primary', 'success', 'warn', 'error', 'misc'].indexOf(val) >= 0;
44
+ },
45
+ },
46
+ /**
47
+ * Whether the badge has a remove <slot>
48
+ */
49
+ removable: {
50
+ type: Boolean,
51
+ default: false,
52
+ },
53
+ },
54
+ computed: {
55
+ cssClass() {
56
+ let o = {};
57
+ if (this.size) {
58
+ o[`text-${this.size}`] = true;
59
+ }
60
+ if (this.theme) {
61
+ o[`badge-${this.theme}`] = true;
62
+ }
63
+ return o;
64
+ },
65
+ },
66
+ methods: {
67
+ onRemove() {
68
+ /**
69
+ * Remove event, emitted when close method is invoked
70
+ */
71
+ this.$emit('remove');
72
+ },
73
+ },
74
+ };
75
+ </script>