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,61 +1,84 @@
1
- const scrollIntoView = c => {
2
- if (!c || !c.parentNode) {
3
- return;
4
- }
5
- let p = c.parentNode;
6
- let ph = p.offsetHeight;
7
- let py = p.scrollTop;
8
- let ch = c.offsetHeight;
9
- let cy = c.offsetTop;
10
- if (cy < py) {
11
- p.scrollTop = cy;
12
- } else if (cy > py + ph - ch) {
13
- p.scrollTop = cy - ph + ch;
14
- }
15
- };
16
-
17
- let ID = 1;
18
- const nextId = prefix => `${prefix}-${ID++}`;
19
- const isDateValid = d => d instanceof Date && !isNaN(d.getTime());
20
-
21
- const Key = {
22
- UP: 'ArrowUp',
23
- DOWN: 'ArrowDown',
24
- ENTER: 'Enter',
25
- ESC: 'Escape',
26
- };
27
-
28
- const Position = {
29
- LEFT: 'left',
30
- RIGHT: 'right',
31
- TOP: 'top',
32
- BOTTOM: 'bottom',
33
- START: 'start',
34
- END: 'end',
35
- };
36
-
37
- const debounce = (func, delay) => {
38
- let timeout;
39
- return function executedFunction(...args) {
40
- const later = () => {
41
- clearTimeout(timeout);
42
- func(...args);
43
- };
44
- clearTimeout(timeout);
45
- timeout = setTimeout(later, delay);
46
- };
47
- };
48
-
49
- /**
50
- * @param {Element} target
51
- * @param {IntersectionObserverCallback} callback
52
- * @param {IntersectionObserverInit} options
53
- * @return {{ observer:IntersectionObserver, stop:Function }}
54
- */
55
- const useIntersectionObserver = (target, callback, options) => {
56
- const observer = new IntersectionObserver(callback, options);
57
- observer.observe(target);
58
- return { observer, stop: () => observer.disconnect() };
59
- };
60
-
61
- export { scrollIntoView, isDateValid, nextId, Key, Position, debounce, useIntersectionObserver };
1
+ const scrollIntoView = c => {
2
+ if (!c || !c.parentNode) {
3
+ return;
4
+ }
5
+ let p = c.parentNode;
6
+ let ph = p.offsetHeight;
7
+ let py = p.scrollTop;
8
+ let ch = c.offsetHeight;
9
+ let cy = c.offsetTop;
10
+ if (cy < py) {
11
+ p.scrollTop = cy;
12
+ } else if (cy > py + ph - ch) {
13
+ p.scrollTop = cy - ph + ch;
14
+ }
15
+ };
16
+
17
+ let ID = 1;
18
+ const nextId = prefix => `${prefix}-${ID++}`;
19
+ const isDateValid = d => d instanceof Date && !isNaN(d.getTime());
20
+
21
+ const Key = {
22
+ UP: 'ArrowUp',
23
+ DOWN: 'ArrowDown',
24
+ ENTER: 'Enter',
25
+ ESC: 'Escape',
26
+ };
27
+
28
+ const Position = {
29
+ LEFT: 'left',
30
+ RIGHT: 'right',
31
+ TOP: 'top',
32
+ BOTTOM: 'bottom',
33
+ START: 'start',
34
+ END: 'end',
35
+ };
36
+
37
+ const debounce = (func, delay) => {
38
+ let timeout;
39
+ return function executedFunction(...args) {
40
+ const later = () => {
41
+ clearTimeout(timeout);
42
+ func(...args);
43
+ };
44
+ clearTimeout(timeout);
45
+ timeout = setTimeout(later, delay);
46
+ };
47
+ };
48
+
49
+ /**
50
+ * @param {Element} target
51
+ * @param {IntersectionObserverCallback} callback
52
+ * @param {IntersectionObserverInit} options
53
+ * @return {{ observer:IntersectionObserver, stop:Function }}
54
+ */
55
+ const useIntersectionObserver = (target, callback, options) => {
56
+ const observer = new IntersectionObserver(callback, options);
57
+ observer.observe(target);
58
+ return { observer, stop: () => observer.disconnect() };
59
+ };
60
+
61
+ /**
62
+ * @param {number} x - x-axis coordinate
63
+ * @param {number} y - y-axis coordinate
64
+ * @return {function: DOMRect}
65
+ */
66
+ const generateGetBoundingClientRect = (x = 0, y = 0) => () => ({
67
+ width: 0,
68
+ height: 0,
69
+ top: y,
70
+ right: x,
71
+ bottom: y,
72
+ left: x,
73
+ });
74
+
75
+ export {
76
+ scrollIntoView,
77
+ isDateValid,
78
+ nextId,
79
+ Key,
80
+ Position,
81
+ debounce,
82
+ useIntersectionObserver,
83
+ generateGetBoundingClientRect,
84
+ };
@@ -1,81 +1,99 @@
1
- import { nextId, Position } from './Helpers';
2
-
3
- export default {
4
- props: {
5
- /**
6
- * z-index
7
- */
8
- zIndex: {
9
- type: Number,
10
- default: 1010,
11
- },
12
- /**
13
- * Dropdown append to body
14
- */
15
- appendToBody: {
16
- type: Boolean,
17
- default: true,
18
- },
19
- /**
20
- * Position, values of the popover:
21
- * bl, br, tl, tr - bottom-left, bottom-right, top-left, top-right
22
- * @values bl, br, tl, tr, top, top-start, top-end, left, left-start, left-end, right, right-start, right-end, bottom, bottom-start, bottom-end
23
- */
24
- position: {
25
- type: String,
26
- default: `${Position.BOTTOM}-${Position.START}`,
27
- },
28
- /**
29
- * Position offset [ x, y ] where:
30
- * x - skidding (offset along target)
31
- * y - distance (offset away from target)
32
- */
33
- positionOffset: {
34
- type: Array,
35
- default() {
36
- return [1, 1];
37
- },
38
- },
39
- /**
40
- * Auto width
41
- */
42
- autoWidth: {
43
- type: Boolean,
44
- default: false,
45
- },
46
- },
47
- data() {
48
- return {
49
- popoverShow: false,
50
- popoverTargetId: nextId('popover-target'),
51
- };
52
- },
53
- computed: {
54
- popoverTarget() {
55
- return `[data-popover=${this.popoverTargetId}]`;
56
- },
57
- popoverOptions() {
58
- let {
59
- zIndex,
60
- appendToBody,
61
- position,
62
- positionOffset,
63
- autoWidth,
64
- popoverTarget: target,
65
- } = this;
66
- return {
67
- zIndex,
68
- appendToBody,
69
- position,
70
- positionOffset,
71
- autoWidth,
72
- target,
73
- };
74
- },
75
- },
76
- methods: {
77
- togglePopover() {
78
- this.popoverShow = !this.popoverShow;
79
- },
80
- },
81
- };
1
+ import { nextId, Position } from './Helpers';
2
+
3
+ export default {
4
+ props: {
5
+ /**
6
+ * z-index
7
+ */
8
+ zIndex: {
9
+ type: Number,
10
+ default: 1010,
11
+ },
12
+ /**
13
+ * Dropdown append to body
14
+ */
15
+ appendToBody: {
16
+ type: Boolean,
17
+ default: true,
18
+ },
19
+ /**
20
+ * Position, values of the popover:
21
+ * bl, br, tl, tr - bottom-left, bottom-right, top-left, top-right
22
+ * @values bl, br, tl, tr, top, top-start, top-end, left, left-start, left-end, right, right-start, right-end, bottom, bottom-start, bottom-end
23
+ */
24
+ position: {
25
+ type: String,
26
+ default: `${Position.BOTTOM}-${Position.START}`,
27
+ },
28
+ /**
29
+ * Position offset [ x, y ] where:
30
+ * x - skidding (offset along target)
31
+ * y - distance (offset away from target)
32
+ */
33
+ positionOffset: {
34
+ type: Array,
35
+ default() {
36
+ return [1, 1];
37
+ },
38
+ },
39
+ /**
40
+ * Auto width
41
+ */
42
+ autoWidth: {
43
+ type: Boolean,
44
+ default: false,
45
+ },
46
+ /**
47
+ * Should follow the cursor
48
+ */
49
+ shouldFollowCursor: {
50
+ type: Boolean,
51
+ default: false
52
+ },
53
+ /**
54
+ * Cursor coordinates [ x, y ]
55
+ */
56
+ cursorCoordinates: {
57
+ type: Array,
58
+ default: () => [0, 0]
59
+ }
60
+ },
61
+ data() {
62
+ return {
63
+ popoverShow: false,
64
+ popoverTargetId: nextId('popover-target'),
65
+ };
66
+ },
67
+ computed: {
68
+ popoverTarget() {
69
+ return `[data-popover=${this.popoverTargetId}]`;
70
+ },
71
+ popoverOptions() {
72
+ let {
73
+ zIndex,
74
+ appendToBody,
75
+ position,
76
+ positionOffset,
77
+ autoWidth,
78
+ popoverTarget: target,
79
+ shouldFollowCursor,
80
+ cursorCoordinates
81
+ } = this;
82
+ return {
83
+ zIndex,
84
+ appendToBody,
85
+ position,
86
+ positionOffset,
87
+ autoWidth,
88
+ target,
89
+ shouldFollowCursor,
90
+ cursorCoordinates
91
+ };
92
+ },
93
+ },
94
+ methods: {
95
+ togglePopover() {
96
+ this.popoverShow = !this.popoverShow;
97
+ },
98
+ },
99
+ };
package/src/main.js CHANGED
@@ -1,8 +1,8 @@
1
- import Vue from 'vue';
2
- import App from './App.vue';
3
-
4
- Vue.config.productionTip = false;
5
-
6
- new Vue({
7
- render: h => h(App)
8
- }).$mount('#app');
1
+ import Vue from 'vue';
2
+ import App from './App.vue';
3
+
4
+ Vue.config.productionTip = false;
5
+
6
+ new Vue({
7
+ render: h => h(App)
8
+ }).$mount('#app');
@@ -1,37 +1,37 @@
1
- const path = require('path');
2
- const { version } = require('./package.json');
3
-
4
- module.exports = {
5
- components: 'src/components/ui/[A-Z]*.vue',
6
- require: ['goodt-framework-css'],
7
- title: 'UI',
8
- version,
9
- styleguideDir: 'docs',
10
- getComponentPathLine(componentPath) {
11
- const name = path.basename(componentPath, '.vue');
12
- return `import { ${name} } from 'goodteditor-ui';`;
13
- },
14
- template: {
15
- head: {
16
- links: [
17
- {
18
- rel: 'stylesheet',
19
- href:
20
- 'https://cdn.materialdesignicons.com/5.4.55/css/materialdesignicons.min.css',
21
- crossorigin: 'anonymous',
22
- },
23
- {
24
- rel: 'stylesheet',
25
- href:
26
- 'https://materialdesignicons.com/cdn/light/0.2.63/css/materialdesignicons-light.min.css',
27
- crossorigin: 'anonymous',
28
- },
29
- ],
30
- },
31
- body: {
32
- raw: `<script src="https://unpkg.com/dayjs@1.9.6/dayjs.min.js"></script>
33
- <script src="https://unpkg.com/dayjs@1.9.6/locale/ru.js"></script>
34
- <script src="https://unpkg.com/dayjs@1.9.6/plugin/customParseFormat.js"></script>`,
35
- },
36
- },
37
- };
1
+ const path = require('path');
2
+ const { version } = require('./package.json');
3
+
4
+ module.exports = {
5
+ components: 'src/components/ui/[A-Z]*.vue',
6
+ require: ['goodt-framework-css'],
7
+ title: 'UI',
8
+ version,
9
+ styleguideDir: 'docs',
10
+ getComponentPathLine(componentPath) {
11
+ const name = path.basename(componentPath, '.vue');
12
+ return `import { ${name} } from 'goodteditor-ui';`;
13
+ },
14
+ template: {
15
+ head: {
16
+ links: [
17
+ {
18
+ rel: 'stylesheet',
19
+ href:
20
+ 'https://cdn.materialdesignicons.com/5.4.55/css/materialdesignicons.min.css',
21
+ crossorigin: 'anonymous',
22
+ },
23
+ {
24
+ rel: 'stylesheet',
25
+ href:
26
+ 'https://materialdesignicons.com/cdn/light/0.2.63/css/materialdesignicons-light.min.css',
27
+ crossorigin: 'anonymous',
28
+ },
29
+ ],
30
+ },
31
+ body: {
32
+ raw: `<script src="https://unpkg.com/dayjs@1.9.6/dayjs.min.js"></script>
33
+ <script src="https://unpkg.com/dayjs@1.9.6/locale/ru.js"></script>
34
+ <script src="https://unpkg.com/dayjs@1.9.6/plugin/customParseFormat.js"></script>`,
35
+ },
36
+ },
37
+ };
package/vue.config.js CHANGED
@@ -1,8 +1,8 @@
1
- /* eslint-disable */
2
- module.exports = {
3
- devServer: {
4
- port: 3000
5
- },
6
- filenameHashing: true,
7
- lintOnSave: true
8
- };
1
+ /* eslint-disable */
2
+ module.exports = {
3
+ devServer: {
4
+ port: 3000
5
+ },
6
+ filenameHashing: true,
7
+ lintOnSave: true
8
+ };
@@ -1,51 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <code_scheme name="Project" version="173">
3
- <HTMLCodeStyleSettings>
4
- <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
5
- <option name="HTML_QUOTE_STYLE" value="Single" />
6
- <option name="HTML_ENFORCE_QUOTES" value="true" />
7
- </HTMLCodeStyleSettings>
8
- <JSCodeStyleSettings version="0">
9
- <option name="FORCE_SEMICOLON_STYLE" value="true" />
10
- <option name="SPACE_WITHIN_ARRAY_INITIALIZER_BRACKETS" value="true" />
11
- <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
12
- <option name="USE_DOUBLE_QUOTES" value="false" />
13
- <option name="FORCE_QUOTE_STYlE" value="true" />
14
- <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
15
- <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
16
- <option name="SPACES_WITHIN_IMPORTS" value="true" />
17
- </JSCodeStyleSettings>
18
- <TypeScriptCodeStyleSettings version="0">
19
- <option name="FORCE_SEMICOLON_STYLE" value="true" />
20
- <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
21
- <option name="USE_DOUBLE_QUOTES" value="false" />
22
- <option name="FORCE_QUOTE_STYlE" value="true" />
23
- <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
24
- <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
25
- <option name="SPACES_WITHIN_IMPORTS" value="true" />
26
- </TypeScriptCodeStyleSettings>
27
- <VueCodeStyleSettings>
28
- <option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
29
- <option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
30
- </VueCodeStyleSettings>
31
- <codeStyleSettings language="HTML">
32
- <option name="SOFT_MARGINS" value="100" />
33
- <indentOptions>
34
- <option name="CONTINUATION_INDENT_SIZE" value="4" />
35
- </indentOptions>
36
- </codeStyleSettings>
37
- <codeStyleSettings language="JavaScript">
38
- <option name="SOFT_MARGINS" value="100" />
39
- </codeStyleSettings>
40
- <codeStyleSettings language="TypeScript">
41
- <option name="SOFT_MARGINS" value="100" />
42
- </codeStyleSettings>
43
- <codeStyleSettings language="Vue">
44
- <option name="SOFT_MARGINS" value="100" />
45
- <indentOptions>
46
- <option name="INDENT_SIZE" value="4" />
47
- <option name="TAB_SIZE" value="4" />
48
- </indentOptions>
49
- </codeStyleSettings>
50
- </code_scheme>
51
- </component>
@@ -1,5 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <state>
3
- <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
- </state>
5
- </component>
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/temp" />
6
- <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
- <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
- </content>
9
- <orderEntry type="inheritedJdk" />
10
- <orderEntry type="sourceFolder" forTests="false" />
11
- </component>
12
- </module>
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
- </profile>
6
- </component>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/goodt-ui.iml" filepath="$PROJECT_DIR$/.idea/goodt-ui.iml" />
6
- </modules>
7
- </component>
8
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
- </component>
6
- </project>