goodteditor-ui 1.0.12 → 1.0.13

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 (75) 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 +51 -51
  7. package/jsconfig.json +13 -13
  8. package/package.json +57 -57
  9. package/src/App.vue +36 -36
  10. package/src/components/ui/Avatar.md +68 -68
  11. package/src/components/ui/Avatar.vue +177 -177
  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 +157 -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 +341 -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 +310 -310
  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 +258 -209
  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 +420 -420
  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 +114 -52
  63. package/src/components/ui/Tooltip.vue +113 -113
  64. package/src/components/ui/utils/FormComponent.js +107 -107
  65. package/src/components/ui/utils/Helpers.js +84 -61
  66. package/src/components/ui/utils/WithPopover.js +99 -81
  67. package/src/main.js +8 -8
  68. package/styleguide.config.js +37 -37
  69. package/vue.config.js +8 -8
  70. package/.idea/codeStyles/Project.xml +0 -51
  71. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  72. package/.idea/goodt-ui.iml +0 -12
  73. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  74. package/.idea/modules.xml +0 -8
  75. package/.idea/vcs.xml +0 -6
@@ -1,51 +1,51 @@
1
- Simple example
2
-
3
- ```vue
4
- <template>
5
- <div class="pad-l5">
6
- <p>value: {{ model }}</p>
7
- <input-tags class="w-6-12" v-model="model" v-bind="props"></input-tags>
8
- </div>
9
- </template>
10
- <script>
11
- export default {
12
- data() {
13
- return {
14
- model: ['hello', 'world'],
15
- props: {
16
- placeholder: 'Add a tag...',
17
- },
18
- };
19
- },
20
- };
21
- </script>
22
- ```
23
-
24
- Advanced example. Slots
25
-
26
- ```vue
27
- <template>
28
- <div class="pad-l5">
29
- <p>value: {{ model }}</p>
30
- <input-tags class="w-6-12" v-model="model" v-bind="props">
31
- <template #tag="{ tag, remove }">
32
- <code class="pull-left mar-1">
33
- {{ tag }} <b class="cursor-pointer" @click="remove(tag)">[x]</b>
34
- </code>
35
- </template>
36
- </input-tags>
37
- </div>
38
- </template>
39
- <script>
40
- export default {
41
- data() {
42
- return {
43
- model: ['hello', 'world'],
44
- props: {
45
- placeholder: 'Add a tag...',
46
- },
47
- };
48
- },
49
- };
50
- </script>
51
- ```
1
+ Simple example
2
+
3
+ ```vue
4
+ <template>
5
+ <div class="pad-l5">
6
+ <p>value: {{ model }}</p>
7
+ <input-tags class="w-6-12" v-model="model" v-bind="props"></input-tags>
8
+ </div>
9
+ </template>
10
+ <script>
11
+ export default {
12
+ data() {
13
+ return {
14
+ model: ['hello', 'world'],
15
+ props: {
16
+ placeholder: 'Add a tag...',
17
+ },
18
+ };
19
+ },
20
+ };
21
+ </script>
22
+ ```
23
+
24
+ Advanced example. Slots
25
+
26
+ ```vue
27
+ <template>
28
+ <div class="pad-l5">
29
+ <p>value: {{ model }}</p>
30
+ <input-tags class="w-6-12" v-model="model" v-bind="props">
31
+ <template #tag="{ tag, remove }">
32
+ <code class="pull-left mar-1">
33
+ {{ tag }} <b class="cursor-pointer" @click="remove(tag)">[x]</b>
34
+ </code>
35
+ </template>
36
+ </input-tags>
37
+ </div>
38
+ </template>
39
+ <script>
40
+ export default {
41
+ data() {
42
+ return {
43
+ model: ['hello', 'world'],
44
+ props: {
45
+ placeholder: 'Add a tag...',
46
+ },
47
+ };
48
+ },
49
+ };
50
+ </script>
51
+ ```
@@ -1,184 +1,184 @@
1
- <template>
2
- <div class="ui-input-tags form-elem" :class="cssClass" @focus="onRootFocus" tabindex="0">
3
- <div class="ui-input-tags-tags" v-if="value.length">
4
- <!--
5
- @slot Tag slot
6
- @binding {String} tag tag
7
- @binding {Function} remove remove tag function(tag)
8
- -->
9
- <slot name="tag" v-for="tag in value" v-bind="{ tag, remove: removeTag }">
10
- <ui-badge
11
- class="ui-input-tags-badge mar-none mar-right-2 mar-bot-2 pull-left"
12
- theme="primary"
13
- size="small"
14
- :key="tag"
15
- removable
16
- @remove="removeTag(tag)"
17
- >
18
- <span>{{ tag }}</span>
19
- </ui-badge>
20
- </slot>
21
- </div>
22
- <!--
23
- @slot Custom input slot
24
- @binding {String} id input id attribute value
25
- @binding {String} value input value
26
- @binding {Function} addTag function to add tag
27
- @binding {Function} setValue function to set the 'value' function(value)
28
- @binding {Object} inputBinds input props (use v-bind)
29
- @binding {Object} inputEvents input events (use v-on)
30
- -->
31
- <slot
32
- name="input"
33
- v-bind="{
34
- id: inputId,
35
- value: newTag,
36
- addTag,
37
- setValue: setNewTag,
38
- inputBinds,
39
- inputEvents,
40
- }"
41
- >
42
- <input
43
- :id="inputId"
44
- class="ui-input-tags-input w-100"
45
- :class="{ 'mar-top-2': value.length }"
46
- type="text"
47
- tabindex="-1"
48
- :value="newTag"
49
- v-bind="inputBinds"
50
- v-on="inputEvents"
51
- />
52
- </slot>
53
- </div>
54
- </template>
55
- <style lang="less" scoped>
56
- .ui-input-tags {
57
- display: inline-flex;
58
- flex-wrap: wrap;
59
- &-input {
60
- line-height: 1.5;
61
- border: none;
62
- padding: 0;
63
- color: inherit;
64
- background: transparent;
65
- outline: none;
66
- }
67
- &-tags {
68
- max-width: 100%;
69
- }
70
- &-badge {
71
- white-space: normal;
72
- overflow-wrap: break-word;
73
- word-break: break-word;
74
- }
75
- }
76
- </style>
77
- <script>
78
- import UiBadge from './Badge.vue';
79
- import FormComponent from './utils/FormComponent';
80
-
81
- export default {
82
- components: {
83
- UiBadge,
84
- },
85
- mixins: [FormComponent],
86
- props: {
87
- /**
88
- * @model
89
- */
90
- value: {
91
- type: Array,
92
- default() {
93
- return [];
94
- },
95
- },
96
- /**
97
- * Filters new values before adding function(values:Array, valuesNew:Array):Array
98
- */
99
- valueFilter: {
100
- type: Function,
101
- default(values, valuesNew) {
102
- return valuesNew.filter((v, i, a) => a.indexOf(v) === i && !values.includes(v));
103
- },
104
- },
105
- /**
106
- * Delimiter
107
- */
108
- delimiter: {
109
- type: String,
110
- default: ',',
111
- },
112
- },
113
- data() {
114
- return {
115
- newTag: '',
116
- inputBinds: {
117
- placeholder: this.placeholder,
118
- readonly: this.readonly,
119
- },
120
- inputEvents: {
121
- input: this.onInputInput,
122
- focus: this.onInputFocus,
123
- blur: this.onInputBlur,
124
- keyup: e => e.key == 'Enter' && this.onInputEnter(e),
125
- },
126
- };
127
- },
128
- methods: {
129
- setNewTag(value) {
130
- this.newTag = value;
131
- },
132
- addTag() {
133
- let newTags = this.valueFilter(
134
- this.value,
135
- this.newTag.split(this.delimiter).map(tag => tag.trim())
136
- );
137
- if (!newTags.length) {
138
- return;
139
- }
140
- let tags = [...this.value, ...newTags];
141
- /**
142
- * Input event
143
- * @property {Array} tags
144
- */
145
- this.$emit('input', tags);
146
- /**
147
- * Change event
148
- * @property {Array} tags
149
- */
150
- this.$emit('change', tags);
151
- this.newTag = '';
152
- },
153
- removeTag(tag) {
154
- let tags = this.value.filter(t => t !== tag);
155
- /**
156
- * Input event
157
- * @property {Array} tags
158
- */
159
- this.$emit('input', tags);
160
- /**
161
- * Change event
162
- * @property {Array} tags
163
- */
164
- this.$emit('change', tags);
165
- },
166
- onRootFocus(e) {
167
- let input = this.getInputRef();
168
- input && input.focus();
169
- },
170
- onInputInput(e) {
171
- this.newTag = e.target.value;
172
- },
173
- onInputFocus(e) {
174
- this.rootHasFocus = true;
175
- },
176
- onInputBlur(e) {
177
- this.rootHasFocus = false;
178
- },
179
- onInputEnter(e) {
180
- this.addTag();
181
- },
182
- },
183
- };
184
- </script>
1
+ <template>
2
+ <div class="ui-input-tags form-elem" :class="cssClass" @focus="onRootFocus" tabindex="0">
3
+ <div class="ui-input-tags-tags" v-if="value.length">
4
+ <!--
5
+ @slot Tag slot
6
+ @binding {String} tag tag
7
+ @binding {Function} remove remove tag function(tag)
8
+ -->
9
+ <slot name="tag" v-for="tag in value" v-bind="{ tag, remove: removeTag }">
10
+ <ui-badge
11
+ class="ui-input-tags-badge mar-none mar-right-2 mar-bot-2 pull-left"
12
+ theme="primary"
13
+ size="small"
14
+ :key="tag"
15
+ removable
16
+ @remove="removeTag(tag)"
17
+ >
18
+ <span>{{ tag }}</span>
19
+ </ui-badge>
20
+ </slot>
21
+ </div>
22
+ <!--
23
+ @slot Custom input slot
24
+ @binding {String} id input id attribute value
25
+ @binding {String} value input value
26
+ @binding {Function} addTag function to add tag
27
+ @binding {Function} setValue function to set the 'value' function(value)
28
+ @binding {Object} inputBinds input props (use v-bind)
29
+ @binding {Object} inputEvents input events (use v-on)
30
+ -->
31
+ <slot
32
+ name="input"
33
+ v-bind="{
34
+ id: inputId,
35
+ value: newTag,
36
+ addTag,
37
+ setValue: setNewTag,
38
+ inputBinds,
39
+ inputEvents,
40
+ }"
41
+ >
42
+ <input
43
+ :id="inputId"
44
+ class="ui-input-tags-input w-100"
45
+ :class="{ 'mar-top-2': value.length }"
46
+ type="text"
47
+ tabindex="-1"
48
+ :value="newTag"
49
+ v-bind="inputBinds"
50
+ v-on="inputEvents"
51
+ />
52
+ </slot>
53
+ </div>
54
+ </template>
55
+ <style lang="less" scoped>
56
+ .ui-input-tags {
57
+ display: inline-flex;
58
+ flex-wrap: wrap;
59
+ &-input {
60
+ line-height: 1.5;
61
+ border: none;
62
+ padding: 0;
63
+ color: inherit;
64
+ background: transparent;
65
+ outline: none;
66
+ }
67
+ &-tags {
68
+ max-width: 100%;
69
+ }
70
+ &-badge {
71
+ white-space: normal;
72
+ overflow-wrap: break-word;
73
+ word-break: break-word;
74
+ }
75
+ }
76
+ </style>
77
+ <script>
78
+ import UiBadge from './Badge.vue';
79
+ import FormComponent from './utils/FormComponent';
80
+
81
+ export default {
82
+ components: {
83
+ UiBadge,
84
+ },
85
+ mixins: [FormComponent],
86
+ props: {
87
+ /**
88
+ * @model
89
+ */
90
+ value: {
91
+ type: Array,
92
+ default() {
93
+ return [];
94
+ },
95
+ },
96
+ /**
97
+ * Filters new values before adding function(values:Array, valuesNew:Array):Array
98
+ */
99
+ valueFilter: {
100
+ type: Function,
101
+ default(values, valuesNew) {
102
+ return valuesNew.filter((v, i, a) => a.indexOf(v) === i && !values.includes(v));
103
+ },
104
+ },
105
+ /**
106
+ * Delimiter
107
+ */
108
+ delimiter: {
109
+ type: String,
110
+ default: ',',
111
+ },
112
+ },
113
+ data() {
114
+ return {
115
+ newTag: '',
116
+ inputBinds: {
117
+ placeholder: this.placeholder,
118
+ readonly: this.readonly,
119
+ },
120
+ inputEvents: {
121
+ input: this.onInputInput,
122
+ focus: this.onInputFocus,
123
+ blur: this.onInputBlur,
124
+ keyup: e => e.key == 'Enter' && this.onInputEnter(e),
125
+ },
126
+ };
127
+ },
128
+ methods: {
129
+ setNewTag(value) {
130
+ this.newTag = value;
131
+ },
132
+ addTag() {
133
+ let newTags = this.valueFilter(
134
+ this.value,
135
+ this.newTag.split(this.delimiter).map(tag => tag.trim())
136
+ );
137
+ if (!newTags.length) {
138
+ return;
139
+ }
140
+ let tags = [...this.value, ...newTags];
141
+ /**
142
+ * Input event
143
+ * @property {Array} tags
144
+ */
145
+ this.$emit('input', tags);
146
+ /**
147
+ * Change event
148
+ * @property {Array} tags
149
+ */
150
+ this.$emit('change', tags);
151
+ this.newTag = '';
152
+ },
153
+ removeTag(tag) {
154
+ let tags = this.value.filter(t => t !== tag);
155
+ /**
156
+ * Input event
157
+ * @property {Array} tags
158
+ */
159
+ this.$emit('input', tags);
160
+ /**
161
+ * Change event
162
+ * @property {Array} tags
163
+ */
164
+ this.$emit('change', tags);
165
+ },
166
+ onRootFocus(e) {
167
+ let input = this.getInputRef();
168
+ input && input.focus();
169
+ },
170
+ onInputInput(e) {
171
+ this.newTag = e.target.value;
172
+ },
173
+ onInputFocus(e) {
174
+ this.rootHasFocus = true;
175
+ },
176
+ onInputBlur(e) {
177
+ this.rootHasFocus = false;
178
+ },
179
+ onInputEnter(e) {
180
+ this.addTag();
181
+ },
182
+ },
183
+ };
184
+ </script>
@@ -1,25 +1,25 @@
1
- Simple example
2
-
3
- ```vue
4
- <template>
5
- <div class="pad-l5">
6
- <p>value: {{ model }}</p>
7
- <input-time-picker class="w-f1" v-model="model" v-bind="props"></input-time-picker>
8
- </div>
9
- </template>
10
- <script>
11
- export default {
12
- data() {
13
- return {
14
- model: '16:45',
15
- props: {
16
- placeholder: 'Pick a time',
17
- timepicker: {
18
- step: { h: 1, m: 5 },
19
- },
20
- },
21
- };
22
- },
23
- };
24
- </script>
25
- ```
1
+ Simple example
2
+
3
+ ```vue
4
+ <template>
5
+ <div class="pad-l5">
6
+ <p>value: {{ model }}</p>
7
+ <input-time-picker class="w-f1" v-model="model" v-bind="props"></input-time-picker>
8
+ </div>
9
+ </template>
10
+ <script>
11
+ export default {
12
+ data() {
13
+ return {
14
+ model: '16:45',
15
+ props: {
16
+ placeholder: 'Pick a time',
17
+ timepicker: {
18
+ step: { h: 1, m: 5 },
19
+ },
20
+ },
21
+ };
22
+ },
23
+ };
24
+ </script>
25
+ ```