goodteditor-ui 1.0.26 → 1.0.27

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 +349 -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,105 +1,105 @@
1
- ```vue
2
- <template>
3
- <div class="pad-l5">
4
- <ui-file-selector v-bind="props" @change="onFileSelect">
5
- <div class="btn btn-primary btn-small">select file</div>
6
- </ui-file-selector>
7
- <pre>{{ files }}</pre>
8
- </div>
9
- </template>
10
- <script>
11
- import UiFileSelector from './FileSelector.vue';
12
-
13
- export default {
14
- components: { UiFileSelector },
15
- data() {
16
- return {
17
- files: [],
18
- props: {
19
- multiple: false,
20
- accept: '',
21
- },
22
- };
23
- },
24
- methods: {
25
- onFileSelect(files) {
26
- this.files = files.map(({ name, type, size }) => ({ name, type, size }));
27
- },
28
- },
29
- };
30
- </script>
31
- ```
32
-
33
- Advanced demo: multiple image selection with preview
34
-
35
- ```vue
36
- <template>
37
- <div class="pad-l5">
38
- <div class="d-flex block">
39
- <ui-file-selector ref="file-selector" v-bind="props" @change="onFileSelect">
40
- <div class="btn btn-primary btn-small">
41
- <template v-if="files.length">images selected: ({{ files.length }})</template>
42
- <template v-else>select images</template>
43
- </div>
44
- </ui-file-selector>
45
- <div class="btn btn-outline btn-small mar-h-3" v-if="files.length" @click="resetFiles">
46
- reset
47
- </div>
48
- </div>
49
- <table class="table table-vmid w-6-12">
50
- <tr v-for="meta in filesMeta" :key="meta.name">
51
- <td class="table-w-auto">
52
- <ui-image :src="meta.preview" style="display:block; width:2rem">
53
- <div><i class="preloader"></i></div>
54
- </ui-image>
55
- </td>
56
- <td>{{ meta.name }}</td>
57
- <td>
58
- <small>({{ meta.size }}kb)</small>
59
- </td>
60
- </tr>
61
- </table>
62
- </div>
63
- </template>
64
- <script>
65
- import UiFileSelector from './FileSelector.vue';
66
- import UiImage from './Image.vue';
67
-
68
- // b -> kb util
69
- const toKb = n => Math.round((n / 1024) * 10) / 10;
70
-
71
- export default {
72
- components: { UiFileSelector, UiImage },
73
- data() {
74
- return {
75
- files: [],
76
- props: {
77
- multiple: true,
78
- accept: 'image/png,image/jpeg,image/gif',
79
- },
80
- };
81
- },
82
- computed: {
83
- filesMeta() {
84
- return this.files.map(file => {
85
- const { name, type, size } = file;
86
- return {
87
- name,
88
- type,
89
- size: toKb(size),
90
- preview: file,
91
- };
92
- });
93
- },
94
- },
95
- methods: {
96
- resetFiles() {
97
- this.files = [];
98
- },
99
- onFileSelect(files) {
100
- this.files = files;
101
- },
102
- },
103
- };
104
- </script>
105
- ```
1
+ ```vue
2
+ <template>
3
+ <div class="pad-l5">
4
+ <ui-file-selector v-bind="props" @change="onFileSelect">
5
+ <div class="btn btn-primary btn-small">select file</div>
6
+ </ui-file-selector>
7
+ <pre>{{ files }}</pre>
8
+ </div>
9
+ </template>
10
+ <script>
11
+ import UiFileSelector from './FileSelector.vue';
12
+
13
+ export default {
14
+ components: { UiFileSelector },
15
+ data() {
16
+ return {
17
+ files: [],
18
+ props: {
19
+ multiple: false,
20
+ accept: '',
21
+ },
22
+ };
23
+ },
24
+ methods: {
25
+ onFileSelect(files) {
26
+ this.files = files.map(({ name, type, size }) => ({ name, type, size }));
27
+ },
28
+ },
29
+ };
30
+ </script>
31
+ ```
32
+
33
+ Advanced demo: multiple image selection with preview
34
+
35
+ ```vue
36
+ <template>
37
+ <div class="pad-l5">
38
+ <div class="d-flex block">
39
+ <ui-file-selector ref="file-selector" v-bind="props" @change="onFileSelect">
40
+ <div class="btn btn-primary btn-small">
41
+ <template v-if="files.length">images selected: ({{ files.length }})</template>
42
+ <template v-else>select images</template>
43
+ </div>
44
+ </ui-file-selector>
45
+ <div class="btn btn-outline btn-small mar-h-3" v-if="files.length" @click="resetFiles">
46
+ reset
47
+ </div>
48
+ </div>
49
+ <table class="table table-vmid w-6-12">
50
+ <tr v-for="meta in filesMeta" :key="meta.name">
51
+ <td class="table-w-auto">
52
+ <ui-image :src="meta.preview" style="display:block; width:2rem">
53
+ <div><i class="preloader"></i></div>
54
+ </ui-image>
55
+ </td>
56
+ <td>{{ meta.name }}</td>
57
+ <td>
58
+ <small>({{ meta.size }}kb)</small>
59
+ </td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ </template>
64
+ <script>
65
+ import UiFileSelector from './FileSelector.vue';
66
+ import UiImage from './Image.vue';
67
+
68
+ // b -> kb util
69
+ const toKb = n => Math.round((n / 1024) * 10) / 10;
70
+
71
+ export default {
72
+ components: { UiFileSelector, UiImage },
73
+ data() {
74
+ return {
75
+ files: [],
76
+ props: {
77
+ multiple: true,
78
+ accept: 'image/png,image/jpeg,image/gif',
79
+ },
80
+ };
81
+ },
82
+ computed: {
83
+ filesMeta() {
84
+ return this.files.map(file => {
85
+ const { name, type, size } = file;
86
+ return {
87
+ name,
88
+ type,
89
+ size: toKb(size),
90
+ preview: file,
91
+ };
92
+ });
93
+ },
94
+ },
95
+ methods: {
96
+ resetFiles() {
97
+ this.files = [];
98
+ },
99
+ onFileSelect(files) {
100
+ this.files = files;
101
+ },
102
+ },
103
+ };
104
+ </script>
105
+ ```
@@ -1,82 +1,82 @@
1
- <template>
2
- <div class="ui-file-selector">
3
- <!--
4
- @slot default slot
5
- @binding {File[]} files selected files
6
- -->
7
- <slot v-bind="{ files }">select files</slot>
8
- <input
9
- class="ui-file-selector-input pos-abs pos-top-left w-100 h-100"
10
- type="file"
11
- v-bind="{ accept, multiple }"
12
- @change="onFilesChanged"
13
- />
14
- </div>
15
- </template>
16
- <style lang="less" scoped>
17
- .ui-file-selector {
18
- position: relative;
19
- display: inline-flex;
20
- align-items: center;
21
- &-input {
22
- cursor: pointer;
23
- overflow: hidden;
24
- opacity: 0;
25
- &::file-selector-button {
26
- width: 100%;
27
- height: 100%;
28
- visibility: hidden;
29
- }
30
- &::file-selector-label {
31
- display: none;
32
- }
33
- }
34
- }
35
- </style>
36
- <script>
37
- export default {
38
- props: {
39
- /**
40
- * html5 accept attr (a comma-separated list of one or more file types, or unique file type specifiers, describing which file types to allow.)
41
- */
42
- accept: {
43
- type: String,
44
- default: '',
45
- },
46
- /**
47
- * html5 miltiple attr (single/multiple file selection)
48
- */
49
- multiple: {
50
- type: Boolean,
51
- default: false,
52
- },
53
- },
54
- data() {
55
- return {
56
- files: [],
57
- };
58
- },
59
- methods: {
60
- /**
61
- * @public
62
- * Resets selected files (emits 'change' event)
63
- */
64
- reset() {
65
- this.files = [];
66
- this.emitChange();
67
- },
68
- emitChange() {
69
- /**
70
- * Files change event (dispatched whenever files change)
71
- * @property {File[]} files
72
- */
73
- this.$emit('change', this.files);
74
- },
75
- onFilesChanged(e) {
76
- const files = [...e.target.files];
77
- this.files = files;
78
- this.emitChange();
79
- },
80
- },
81
- };
82
- </script>
1
+ <template>
2
+ <div class="ui-file-selector">
3
+ <!--
4
+ @slot default slot
5
+ @binding {File[]} files selected files
6
+ -->
7
+ <slot v-bind="{ files }">select files</slot>
8
+ <input
9
+ class="ui-file-selector-input pos-abs pos-top-left w-100 h-100"
10
+ type="file"
11
+ v-bind="{ accept, multiple }"
12
+ @change="onFilesChanged"
13
+ />
14
+ </div>
15
+ </template>
16
+ <style lang="less" scoped>
17
+ .ui-file-selector {
18
+ position: relative;
19
+ display: inline-flex;
20
+ align-items: center;
21
+ &-input {
22
+ cursor: pointer;
23
+ overflow: hidden;
24
+ opacity: 0;
25
+ &::file-selector-button {
26
+ width: 100%;
27
+ height: 100%;
28
+ visibility: hidden;
29
+ }
30
+ &::file-selector-label {
31
+ display: none;
32
+ }
33
+ }
34
+ }
35
+ </style>
36
+ <script>
37
+ export default {
38
+ props: {
39
+ /**
40
+ * html5 accept attr (a comma-separated list of one or more file types, or unique file type specifiers, describing which file types to allow.)
41
+ */
42
+ accept: {
43
+ type: String,
44
+ default: '',
45
+ },
46
+ /**
47
+ * html5 miltiple attr (single/multiple file selection)
48
+ */
49
+ multiple: {
50
+ type: Boolean,
51
+ default: false,
52
+ },
53
+ },
54
+ data() {
55
+ return {
56
+ files: [],
57
+ };
58
+ },
59
+ methods: {
60
+ /**
61
+ * @public
62
+ * Resets selected files (emits 'change' event)
63
+ */
64
+ reset() {
65
+ this.files = [];
66
+ this.emitChange();
67
+ },
68
+ emitChange() {
69
+ /**
70
+ * Files change event (dispatched whenever files change)
71
+ * @property {File[]} files
72
+ */
73
+ this.$emit('change', this.files);
74
+ },
75
+ onFilesChanged(e) {
76
+ const files = [...e.target.files];
77
+ this.files = files;
78
+ this.emitChange();
79
+ },
80
+ },
81
+ };
82
+ </script>
@@ -1,130 +1,130 @@
1
- ```vue
2
- <template>
3
- <div class="pad-l5">
4
- <div class="tile">
5
- <ui-grid class="tile-body" v-bind="props">
6
- <template #avatar="{ style }">
7
- <img
8
- class="avatar avatar-3 round"
9
- src="https://picsum.photos/150/150"
10
- :style="style"
11
- />
12
- </template>
13
- <template #info="{ style }">
14
- <div :style="style">
15
- <div class="text-bold">John Wick</div>
16
- <div class="text-xsmall">john.wick@site.com</div>
17
- </div>
18
- </template>
19
- <template #status="{ style }">
20
- <div class="text-xsmall color-green" :style="style">online</div>
21
- </template>
22
- </ui-grid>
23
- </div>
24
- </div>
25
- </template>
26
- <script>
27
- import UiGrid from './Grid.vue';
28
-
29
- export default {
30
- components: { UiGrid },
31
- data() {
32
- return {
33
- props: {
34
- areas: [['avatar', 'info', 'status']],
35
- cols: ['auto', '1fr', 'auto'],
36
- rows: ['1fr'],
37
- gap: ['1rem'],
38
- },
39
- };
40
- },
41
- };
42
- </script>
43
- ```
44
-
45
- Using wrapper element
46
-
47
- ```vue
48
- <template>
49
- <div class="pad-l5">
50
- <div class="tile">
51
- <ui-grid class="tile-body" v-bind="props">
52
- <template #avatar>
53
- <img class="avatar avatar-3 round" src="https://picsum.photos/150/150" />
54
- </template>
55
- <template #info>
56
- <div class="text-bold">John Wick</div>
57
- <div class="text-xsmall">john.wick@site.com</div>
58
- </template>
59
- <template #status>
60
- <div class="text-xsmall color-green">online</div>
61
- </template>
62
- </ui-grid>
63
- </div>
64
- </div>
65
- </template>
66
- <script>
67
- import UiGrid from './Grid.vue';
68
-
69
- export default {
70
- components: { UiGrid },
71
- data() {
72
- return {
73
- props: {
74
- areas: [['avatar', 'info', 'status']],
75
- cols: ['auto', '1fr', 'auto'],
76
- rows: ['1fr'],
77
- gap: ['1rem'],
78
- wrapTag: 'div',
79
- },
80
- };
81
- },
82
- };
83
- </script>
84
- ```
85
-
86
- ```vue
87
- <template>
88
- <div class="pad-l5">
89
- <ui-grid v-bind="props">
90
- <template v-for="name in areaNames" v-slot:[name]="{ style }">
91
- <div class="box" :style="style">
92
- <code>{{ name }}</code>
93
- </div>
94
- </template>
95
- </ui-grid>
96
- </div>
97
- </template>
98
- <script>
99
- import UiGrid from './Grid.vue';
100
-
101
- export default {
102
- components: { UiGrid },
103
- data() {
104
- return {
105
- props: {
106
- areas: [
107
- ['area1', 'area3', 'area5'],
108
- ['area1', 'area4', 'area5'],
109
- ['area1', 'area2', 'area2'],
110
- ],
111
- cols: ['auto', '1fr', 'auto'],
112
- rows: ['1fr'],
113
- gap: ['1rem'],
114
- },
115
- };
116
- },
117
- computed: {
118
- areaNames() {
119
- return [...new Set(this.props.areas.flat())];
120
- },
121
- },
122
- };
123
- </script>
124
- <style scopped>
125
- .box {
126
- padding: 1rem;
127
- background: #eee;
128
- }
129
- </style>
130
- ```
1
+ ```vue
2
+ <template>
3
+ <div class="pad-l5">
4
+ <div class="tile">
5
+ <ui-grid class="tile-body" v-bind="props">
6
+ <template #avatar="{ style }">
7
+ <img
8
+ class="avatar avatar-3 round"
9
+ src="https://picsum.photos/150/150"
10
+ :style="style"
11
+ />
12
+ </template>
13
+ <template #info="{ style }">
14
+ <div :style="style">
15
+ <div class="text-bold">John Wick</div>
16
+ <div class="text-xsmall">john.wick@site.com</div>
17
+ </div>
18
+ </template>
19
+ <template #status="{ style }">
20
+ <div class="text-xsmall color-green" :style="style">online</div>
21
+ </template>
22
+ </ui-grid>
23
+ </div>
24
+ </div>
25
+ </template>
26
+ <script>
27
+ import UiGrid from './Grid.vue';
28
+
29
+ export default {
30
+ components: { UiGrid },
31
+ data() {
32
+ return {
33
+ props: {
34
+ areas: [['avatar', 'info', 'status']],
35
+ cols: ['auto', '1fr', 'auto'],
36
+ rows: ['1fr'],
37
+ gap: ['1rem'],
38
+ },
39
+ };
40
+ },
41
+ };
42
+ </script>
43
+ ```
44
+
45
+ Using wrapper element
46
+
47
+ ```vue
48
+ <template>
49
+ <div class="pad-l5">
50
+ <div class="tile">
51
+ <ui-grid class="tile-body" v-bind="props">
52
+ <template #avatar>
53
+ <img class="avatar avatar-3 round" src="https://picsum.photos/150/150" />
54
+ </template>
55
+ <template #info>
56
+ <div class="text-bold">John Wick</div>
57
+ <div class="text-xsmall">john.wick@site.com</div>
58
+ </template>
59
+ <template #status>
60
+ <div class="text-xsmall color-green">online</div>
61
+ </template>
62
+ </ui-grid>
63
+ </div>
64
+ </div>
65
+ </template>
66
+ <script>
67
+ import UiGrid from './Grid.vue';
68
+
69
+ export default {
70
+ components: { UiGrid },
71
+ data() {
72
+ return {
73
+ props: {
74
+ areas: [['avatar', 'info', 'status']],
75
+ cols: ['auto', '1fr', 'auto'],
76
+ rows: ['1fr'],
77
+ gap: ['1rem'],
78
+ wrapTag: 'div',
79
+ },
80
+ };
81
+ },
82
+ };
83
+ </script>
84
+ ```
85
+
86
+ ```vue
87
+ <template>
88
+ <div class="pad-l5">
89
+ <ui-grid v-bind="props">
90
+ <template v-for="name in areaNames" v-slot:[name]="{ style }">
91
+ <div class="box" :style="style">
92
+ <code>{{ name }}</code>
93
+ </div>
94
+ </template>
95
+ </ui-grid>
96
+ </div>
97
+ </template>
98
+ <script>
99
+ import UiGrid from './Grid.vue';
100
+
101
+ export default {
102
+ components: { UiGrid },
103
+ data() {
104
+ return {
105
+ props: {
106
+ areas: [
107
+ ['area1', 'area3', 'area5'],
108
+ ['area1', 'area4', 'area5'],
109
+ ['area1', 'area2', 'area2'],
110
+ ],
111
+ cols: ['auto', '1fr', 'auto'],
112
+ rows: ['1fr'],
113
+ gap: ['1rem'],
114
+ },
115
+ };
116
+ },
117
+ computed: {
118
+ areaNames() {
119
+ return [...new Set(this.props.areas.flat())];
120
+ },
121
+ },
122
+ };
123
+ </script>
124
+ <style scopped>
125
+ .box {
126
+ padding: 1rem;
127
+ background: #eee;
128
+ }
129
+ </style>
130
+ ```