layers-design-system 2.4.0 → 2.6.0

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 (186) hide show
  1. package/dist/layers-design-system.js +78505 -0
  2. package/dist/layers-design-system.umd.cjs +285 -0
  3. package/dist/style.css +1 -0
  4. package/package.json +26 -12
  5. package/.nvmrc +0 -1
  6. package/babel.config.js +0 -5
  7. package/public/favicon.ico +0 -0
  8. package/public/index.html +0 -20
  9. package/src/assets/button-text-editor/double-quotes.svg +0 -4
  10. package/src/assets/button-text-editor/remove-formatting.svg +0 -5
  11. package/src/assets/button-text-editor/title.svg +0 -4
  12. package/src/assets/failed-to-load/failed-to-load.svg +0 -60
  13. package/src/assets/l-presentation/external-apps.png +0 -0
  14. package/src/assets/l-presentation/notification.png +0 -0
  15. package/src/assets/search-topics/empty-tags.svg +0 -59
  16. package/src/components/LAlert/docs.vue +0 -81
  17. package/src/components/LAlert/index.vue +0 -43
  18. package/src/components/LAttachmentChip/docs.vue +0 -84
  19. package/src/components/LAttachmentChip/index.vue +0 -179
  20. package/src/components/LBox/docs.vue +0 -26
  21. package/src/components/LBox/index.vue +0 -19
  22. package/src/components/LBoxHeader/index.vue +0 -24
  23. package/src/components/LBreadcrumb/docs.vue +0 -21
  24. package/src/components/LBreadcrumb/index.vue +0 -22
  25. package/src/components/LBreadcrumbItem/index.vue +0 -7
  26. package/src/components/LButton/docs.vue +0 -205
  27. package/src/components/LButton/index.vue +0 -369
  28. package/src/components/LButtonGroup/index.vue +0 -7
  29. package/src/components/LCarousel/docs.vue +0 -32
  30. package/src/components/LCarousel/index.vue +0 -88
  31. package/src/components/LCheckbox/docs.vue +0 -62
  32. package/src/components/LCheckbox/index.vue +0 -34
  33. package/src/components/LCheckboxButton/index.vue +0 -30
  34. package/src/components/LCheckboxGroup/index.vue +0 -53
  35. package/src/components/LChip/docs.vue +0 -113
  36. package/src/components/LChip/index.vue +0 -78
  37. package/src/components/LCircularLoader/docs.vue +0 -30
  38. package/src/components/LCircularLoader/index.vue +0 -97
  39. package/src/components/LCollapse/docs.vue +0 -68
  40. package/src/components/LCollapse/index.vue +0 -13
  41. package/src/components/LCollapseItem/index.vue +0 -28
  42. package/src/components/LDatePicker/docs.vue +0 -66
  43. package/src/components/LDatePicker/index.vue +0 -63
  44. package/src/components/LDialog/docs.vue +0 -36
  45. package/src/components/LDialog/index.vue +0 -37
  46. package/src/components/LDropdown/index.vue +0 -7
  47. package/src/components/LDropdownItem/index.vue +0 -13
  48. package/src/components/LDropdownMenu/docs.vue +0 -44
  49. package/src/components/LDropdownMenu/index.vue +0 -12
  50. package/src/components/LFailedToLoad/docs.vue +0 -37
  51. package/src/components/LFailedToLoad/index.vue +0 -61
  52. package/src/components/LForm/index.vue +0 -7
  53. package/src/components/LFormItem/index.vue +0 -12
  54. package/src/components/LHelperBox/assets/link.svg +0 -4
  55. package/src/components/LHelperBox/assets/open-envelope.svg +0 -9
  56. package/src/components/LHelperBox/docs.vue +0 -29
  57. package/src/components/LHelperBox/index.vue +0 -83
  58. package/src/components/LIcon/docs.vue +0 -174
  59. package/src/components/LIcon/index.vue +0 -55
  60. package/src/components/LImage/index.vue +0 -7
  61. package/src/components/LImageViewer/docs.vue +0 -111
  62. package/src/components/LImageViewer/index.vue +0 -449
  63. package/src/components/LInput/docs.vue +0 -43
  64. package/src/components/LInput/index.vue +0 -60
  65. package/src/components/LLinearProgress/docs.vue +0 -21
  66. package/src/components/LLinearProgress/index.vue +0 -74
  67. package/src/components/LNotice/docs.vue +0 -26
  68. package/src/components/LNotice/index.vue +0 -86
  69. package/src/components/LNotification/index.vue +0 -182
  70. package/src/components/LOption/index.vue +0 -7
  71. package/src/components/LOptionGroup/index.vue +0 -7
  72. package/src/components/LPresentation/docs.vue +0 -35
  73. package/src/components/LPresentation/index.vue +0 -182
  74. package/src/components/LProgress/index.vue +0 -7
  75. package/src/components/LPromptDialog/index.vue +0 -82
  76. package/src/components/LRadio/docs.vue +0 -54
  77. package/src/components/LRadio/index.vue +0 -13
  78. package/src/components/LRadioButton/index.vue +0 -30
  79. package/src/components/LRadioGroup/index.vue +0 -54
  80. package/src/components/LSearchBar/AddFilterButton.vue +0 -71
  81. package/src/components/LSearchBar/Filters/Editors/AmountEditor.vue +0 -110
  82. package/src/components/LSearchBar/Filters/Editors/DateEditor.vue +0 -146
  83. package/src/components/LSearchBar/Filters/Editors/NumberEditor.vue +0 -141
  84. package/src/components/LSearchBar/Filters/Editors/StringEditor.vue +0 -140
  85. package/src/components/LSearchBar/Filters/Editors/index.js +0 -16
  86. package/src/components/LSearchBar/Filters/FilterChip.vue +0 -105
  87. package/src/components/LSearchBar/Filters/Views/AmountView.vue +0 -28
  88. package/src/components/LSearchBar/Filters/Views/DateView.vue +0 -46
  89. package/src/components/LSearchBar/Filters/Views/NumberView.vue +0 -24
  90. package/src/components/LSearchBar/Filters/Views/StringView.vue +0 -47
  91. package/src/components/LSearchBar/Filters/Views/index.js +0 -16
  92. package/src/components/LSearchBar/docs.vue +0 -60
  93. package/src/components/LSearchBar/index.vue +0 -240
  94. package/src/components/LSearchTopics/RecentTermSearched.vue +0 -30
  95. package/src/components/LSearchTopics/TopicItem.vue +0 -346
  96. package/src/components/LSearchTopics/docs/drawer.vue +0 -254
  97. package/src/components/LSearchTopics/docs.vue +0 -60
  98. package/src/components/LSearchTopics/header.vue +0 -199
  99. package/src/components/LSearchTopics/helpers/showDialogConfirmation.js +0 -30
  100. package/src/components/LSearchTopics/helpers/showDiscardChangesDialog.js +0 -27
  101. package/src/components/LSearchTopics/index.vue +0 -750
  102. package/src/components/LSelect/docs.vue +0 -129
  103. package/src/components/LSelect/index.vue +0 -9
  104. package/src/components/LSlider/index.vue +0 -7
  105. package/src/components/LSwitch/docs.vue +0 -24
  106. package/src/components/LSwitch/index.vue +0 -60
  107. package/src/components/LTabPane/index.vue +0 -7
  108. package/src/components/LTable/FieldTypes/AmountView.vue +0 -16
  109. package/src/components/LTable/FieldTypes/DateView.vue +0 -18
  110. package/src/components/LTable/FieldTypes/EmailView.vue +0 -8
  111. package/src/components/LTable/FieldTypes/NumberView.vue +0 -13
  112. package/src/components/LTable/FieldTypes/PaymentStatusView.vue +0 -8
  113. package/src/components/LTable/FieldTypes/StringView.vue +0 -24
  114. package/src/components/LTable/FieldTypes/index.js +0 -18
  115. package/src/components/LTable/LTableBody.vue +0 -245
  116. package/src/components/LTable/LTableBodySpacer.vue +0 -17
  117. package/src/components/LTable/LTableEndspace.vue +0 -20
  118. package/src/components/LTable/LTableHeader.vue +0 -155
  119. package/src/components/LTable/LTableHeaderCell.vue +0 -188
  120. package/src/components/LTable/LTableHeaderLoader.vue +0 -62
  121. package/src/components/LTable/LTableHeaderResizer.vue +0 -162
  122. package/src/components/LTable/LTableLoadMore.vue +0 -56
  123. package/src/components/LTable/LTablePagination.vue +0 -174
  124. package/src/components/LTable/LTableReloader.vue +0 -61
  125. package/src/components/LTable/ListAdapter.js +0 -74
  126. package/src/components/LTable/docs.vue +0 -111
  127. package/src/components/LTable/helpers.js +0 -194
  128. package/src/components/LTable/index.vue +0 -961
  129. package/src/components/LTabs/docs.vue +0 -28
  130. package/src/components/LTabs/index.vue +0 -37
  131. package/src/components/LTargetChip/docs.vue +0 -86
  132. package/src/components/LTargetChip/index.vue +0 -64
  133. package/src/components/LTargetInput/docs.vue +0 -72
  134. package/src/components/LTargetInput/index.vue +0 -78
  135. package/src/components/LTextEditor/FloatingLink.vue +0 -91
  136. package/src/components/LTextEditor/LinkBox.vue +0 -94
  137. package/src/components/LTextEditor/docs.vue +0 -32
  138. package/src/components/LTextEditor/extensions/LayersBlockquote.js +0 -12
  139. package/src/components/LTextEditor/extensions/LayersBold.js +0 -11
  140. package/src/components/LTextEditor/extensions/LayersBreakLine.js +0 -16
  141. package/src/components/LTextEditor/extensions/LayersBubbleMenu.js +0 -10
  142. package/src/components/LTextEditor/extensions/LayersBulletList.js +0 -12
  143. package/src/components/LTextEditor/extensions/LayersHeading.js +0 -13
  144. package/src/components/LTextEditor/extensions/LayersHistory.js +0 -10
  145. package/src/components/LTextEditor/extensions/LayersItalic.js +0 -11
  146. package/src/components/LTextEditor/extensions/LayersLink.js +0 -29
  147. package/src/components/LTextEditor/extensions/LayersOrderedList.js +0 -12
  148. package/src/components/LTextEditor/extensions/LayersParagraph.js +0 -44
  149. package/src/components/LTextEditor/extensions/LayersPlaceholder.js +0 -11
  150. package/src/components/LTextEditor/extensions/LayersUnderline.js +0 -29
  151. package/src/components/LTextEditor/helpers/addProtocol.js +0 -5
  152. package/src/components/LTextEditor/helpers/removeEmptyTags.js +0 -5
  153. package/src/components/LTextEditor/index.vue +0 -421
  154. package/src/components/LTimeSelect/docs.vue +0 -41
  155. package/src/components/LTimeSelect/index.vue +0 -49
  156. package/src/components/LToggleButtonGroup/index.vue +0 -87
  157. package/src/components/LTooltip/docs.vue +0 -66
  158. package/src/components/LTooltip/index.vue +0 -28
  159. package/src/components/LTransitionExpand/docs.vue +0 -26
  160. package/src/components/LTransitionExpand/index.vue +0 -88
  161. package/src/components/LUpload/index.vue +0 -7
  162. package/src/docs/Colors.vue +0 -50
  163. package/src/docs/Home.vue +0 -11
  164. package/src/docs/Notifications.vue +0 -88
  165. package/src/docs/index.vue +0 -76
  166. package/src/docs/routes.js +0 -20
  167. package/src/helpers/Colors.js +0 -79
  168. package/src/helpers/FieldTypeComponents.js +0 -43
  169. package/src/helpers/Icons.js +0 -67
  170. package/src/helpers/Notification.js +0 -94
  171. package/src/helpers/PrettySize.js +0 -25
  172. package/src/helpers/RegisterElementUIComponents.js +0 -9
  173. package/src/helpers/Schemas.js +0 -18
  174. package/src/helpers/util.js +0 -15
  175. package/src/main-docs.js +0 -132
  176. package/src/main.js +0 -100
  177. package/src/style/colors.scss +0 -31
  178. package/src/style/element-variables.scss +0 -21
  179. package/src/style/icons.scss +0 -5
  180. package/src/style/layers-variables.scss +0 -73
  181. package/src/style/layout.scss +0 -2288
  182. package/src/style/main.scss +0 -11
  183. package/src/style/notifications.scss +0 -88
  184. package/src/style/transitions.scss +0 -43
  185. package/src/style/typography.scss +0 -155
  186. package/vue.config.js +0 -14
@@ -1,28 +0,0 @@
1
- <template>
2
- <div id="app">
3
- <h1>Tabs</h1>
4
-
5
- <div>
6
- <h2>Basic</h2>
7
-
8
- <l-tabs v-model="activeName">
9
- <l-tab-pane label="User" name="first">User</l-tab-pane>
10
- <l-tab-pane label="Config" name="second">Config</l-tab-pane>
11
- <l-tab-pane label="Role" name="third">Role</l-tab-pane>
12
- <l-tab-pane label="Task" name="fourth">Task</l-tab-pane>
13
- </l-tabs>
14
- </div>
15
- </div>
16
- </template>
17
-
18
- <script>
19
- export default {
20
- name: "Tabs",
21
-
22
- data() {
23
- return {
24
- activeName: "first",
25
- };
26
- }
27
- };
28
- </script>
@@ -1,37 +0,0 @@
1
- <script>
2
- import { Tabs } from "element-ui";
3
- export default {
4
- tagName: "l-tabs",
5
- extends: Tabs,
6
- methods: {
7
- calcPaneInstances(isForceUpdate = false) {
8
- if (this.$slots.default) {
9
- const paneSlots = this.$slots.default.filter(
10
- (vnode) =>
11
- vnode.tag &&
12
- vnode.componentOptions &&
13
- vnode.componentOptions.Ctor.options.tagName === "l-tab-pane"
14
- );
15
- // update indeed
16
- const panes = paneSlots.map(
17
- ({ componentInstance }) => componentInstance
18
- );
19
- const panesChanged = !(
20
- panes.length === this.panes.length &&
21
- panes.every((pane, index) => pane === this.panes[index])
22
- );
23
- if (isForceUpdate || panesChanged) {
24
- this.panes = panes;
25
- }
26
- } else if (this.panes.length !== 0) {
27
- this.panes = [];
28
- }
29
- },
30
- },
31
- };
32
- </script>
33
- <style>
34
- .l-tabs .el-tabs__item:not(.is-active) {
35
- color: var(--color-gray-70);
36
- }
37
- </style>
@@ -1,86 +0,0 @@
1
- <template>
2
- <div id="app">
3
- <h1>Target Chip</h1>
4
-
5
- <div>
6
- <div class="row">
7
- <ul>
8
- <li>
9
- <l-target-chip class="ml-3 mt-3" kind="user" name="Usuário Teste" />
10
- </li>
11
- <li>
12
- <l-target-chip class="ml-3 mt-3" kind="member" name="Aluno Teste" />
13
- </li>
14
- <li>
15
- <l-target-chip class="ml-3 mt-3" kind="group" name="Turma Teste" />
16
- </li>
17
- <li>
18
- <l-target-chip class="ml-3 mt-3" kind="tag" name="Marcador Teste" />
19
- </li>
20
- <li>
21
- <l-target-chip
22
- :count="1"
23
- class="ml-3 mt-3"
24
- kind="community"
25
- name="Comunidade Teste"
26
- />
27
- <l-target-chip
28
- :count="2"
29
- class="ml-3 mt-3"
30
- kind="community"
31
- name="Comunidade Teste"
32
- />
33
- <l-target-chip
34
- :count="3"
35
- class="ml-3 mt-3"
36
- kind="community"
37
- name="Comunidade Teste"
38
- />
39
- </li>
40
- <li>
41
- <l-target-chip class="ml-3 mt-3" kind="role" name="Administrador" />
42
- <l-target-chip class="ml-3 mt-3" kind="role" name="Professor" />
43
- <l-target-chip class="ml-3 mt-3" kind="role" name="Responsável" />
44
- </li>
45
- <li>
46
- <l-target-chip
47
- v-if="showTargetChip"
48
- closeable
49
- @remove="showTargetChip = false"
50
- class="ml-3 mt-3"
51
- kind="tag"
52
- name="Marcador Teste"
53
- />
54
- <l-button
55
- class="ml-3 mt-3"
56
- v-if="!showTargetChip"
57
- @click="showTargetChip = true"
58
- >
59
- mostrar
60
- </l-button>
61
- </li>
62
- </ul>
63
- </div>
64
- </div>
65
- </div>
66
- </template>
67
-
68
- <script>
69
- export default {
70
- name: 'TargetChip',
71
- data: () => {
72
- return {
73
- showTargetChip: true,
74
- }
75
- },
76
- }
77
- </script>
78
-
79
- <style scoped>
80
- ul li {
81
- margin: 8px 0;
82
- }
83
- .teste {
84
- margin-right: 8px;
85
- }
86
- </style>
@@ -1,64 +0,0 @@
1
- <template>
2
- <l-chip style="height: 24px" bold fill :color="color" :icon="icon">
3
- <div class="l-d-flex l-align-items">
4
- {{ count }}
5
- {{ name }}
6
- <l-icon
7
- @click="$emit('remove')"
8
- class="l-d-flex l-align-items-center ml-1 mr-0"
9
- style="cursor: pointer"
10
- size="15"
11
- v-if="closeable"
12
- >
13
- uis-times-circle
14
- </l-icon>
15
- </div>
16
- </l-chip>
17
- </template>
18
- <script>
19
- export default {
20
- tagName: 'l-target-chip',
21
- name: 'LTargetChip',
22
- props: {
23
- kind: {
24
- type: String,
25
- required: true,
26
- },
27
- closeable: {
28
- type: Boolean,
29
- default: false,
30
- },
31
- name: {
32
- type: String,
33
- required: true,
34
- },
35
- count: {
36
- type: Number,
37
- },
38
- },
39
- computed: {
40
- color: function() {
41
- return (
42
- {
43
- member: 'purple',
44
- group: 'aqua',
45
- user: 'link',
46
- tag: 'warning',
47
- community: 'danger',
48
- role: 'lead-light',
49
- }[this.kind] || 'lead'
50
- )
51
- },
52
- icon: function() {
53
- return {
54
- member: 'uil-graduation-cap',
55
- group: 'uil-users-alt',
56
- user: 'uil-user',
57
- tag: 'uil-tag-alt',
58
- role: 'uil-user',
59
- community: 'uil-channel',
60
- }[this.kind]
61
- },
62
- },
63
- }
64
- </script>
@@ -1,72 +0,0 @@
1
- <template>
2
- <div id="app">
3
- <h1>Target Input</h1>
4
-
5
- <h3 class="mt-5">Non-editable</h3>
6
- <l-target-input
7
- :topics="topics"
8
- ></l-target-input>
9
- <h3 class="mt-3">Editable</h3>
10
- <l-target-input
11
- :topics="topics"
12
- :limit="5"
13
- editable
14
- ></l-target-input>
15
- </div>
16
- </template>
17
-
18
- <script>
19
- export default {
20
- name: 'TargetInput',
21
- data: () => {
22
- return {
23
- topics: [
24
- {
25
- name: 'Aluno',
26
- id: '123',
27
- kind: 'member'
28
- },
29
- {
30
- name: 'Aluno 2',
31
- id: '234',
32
- kind: 'member'
33
- },
34
- {
35
- name: 'User',
36
- id: 'u123',
37
- kind: 'user'
38
- },
39
- {
40
- name: 'Turma',
41
- id: 't123',
42
- kind: 'group'
43
- },
44
- {
45
- name: 'Marcador',
46
- id: 'm123',
47
- kind: 'tag'
48
- },
49
- {
50
- name: 'Marcador 2',
51
- id: 'm234',
52
- kind: 'tag'
53
- },
54
- {
55
- name: 'Marcador 3',
56
- id: 'm345',
57
- kind: 'tag'
58
- }
59
- ],
60
- }
61
- },
62
- }
63
- </script>
64
-
65
- <style scoped>
66
- ul li {
67
- margin: 8px 0;
68
- }
69
- .teste {
70
- margin-right: 8px;
71
- }
72
- </style>
@@ -1,78 +0,0 @@
1
- <template>
2
- <div
3
- :class="'l-target-input' + (editable? ' editable' : '') "
4
- v-if="topics && topics.length"
5
- >
6
- <l-target-chip
7
- v-for="topic in topicsToShow"
8
- :kind="topic.kind"
9
- :name="topic.name"
10
- :key="topic.id"
11
- class="mr-2 mb-2"
12
- />
13
- <l-chip
14
- color="purple"
15
- class="mb-2"
16
- fill
17
- hide-icon
18
- v-if="topics.length > this.limit"
19
- >
20
- {{ moreTopicsText }}
21
- </l-chip>
22
- </div>
23
- </template>
24
-
25
- <script>
26
-
27
- export default {
28
- tagName: 'l-target-input',
29
- name: 'LTargetInput',
30
-
31
- props: {
32
- topics: {
33
- type: Array,
34
- required: true
35
- },
36
- limit: {
37
- type: Number,
38
- default: 3,
39
- },
40
- editable: {
41
- type: Boolean,
42
- default: false,
43
- }
44
- },
45
-
46
- computed: {
47
- topicsToShow() {
48
- return this.topics.slice(0, this.limit)
49
- },
50
-
51
- moreTopicsText() {
52
- const isPlural = this.topics.length - this.limit > 1
53
- return (
54
- `+ ${this.topics.length - this.limit} destinatário` +
55
- (isPlural ? 's' : '')
56
- )
57
- }
58
- }
59
- }
60
- </script>
61
-
62
- <style scoped>
63
- .l-target-input {
64
- display: flex;
65
- justify-content: left;
66
- flex-wrap: wrap;
67
- flex-direction: initial;
68
- align-items: center;
69
- min-height: 24px;
70
- }
71
- .editable {
72
- border: 1px solid var(--gray-50);
73
- border-radius: 5px;
74
- cursor: pointer;
75
- padding-left: 8px;
76
- padding-top: 8px;
77
- }
78
- </style>
@@ -1,91 +0,0 @@
1
- <template>
2
- <div
3
- class="wrapper-floating-link l-ra-1 px-2 py-2 row l-align-items-center l-align-content-center"
4
- >
5
- <l-icon size="24" class="color-lead-light mr-2" icon="uil-globe" />
6
- <l-tooltip class="item color-link" :content="tooltipLink">
7
- <a
8
- class="l-flex-grow-1 h6 color-link l-ellipsis"
9
- target="_blank"
10
- rel="nofollow noopener noreferrer"
11
- style="display: inline"
12
- :href="dataLink"
13
- :open-delay="tooltipDelay"
14
- >
15
- {{ dataLink }}
16
- </a>
17
- </l-tooltip>
18
- <l-tooltip
19
- class="item"
20
- v-for="(button, idx) in boxButtons"
21
- :key="idx"
22
- :content="button.tooltip"
23
- :open-delay="tooltipDelay"
24
- >
25
- <l-icon
26
- size="20"
27
- class="color-lead-light ml-2"
28
- :icon="button.icon"
29
- @click="actionButtonBased(button.event)"
30
- ></l-icon
31
- ></l-tooltip>
32
- </div>
33
- </template>
34
-
35
- <script>
36
- export default {
37
- props: { dataLink: String },
38
-
39
- data() {
40
- return {
41
- boxButtons: [
42
- {
43
- tooltip: 'Editar link',
44
- icon: 'uil-edit',
45
- event: 'edit',
46
- },
47
- {
48
- tooltip: 'Remover link',
49
- icon: 'uil-link-broken',
50
- event: 'remove',
51
- },
52
- ],
53
- tooltipDelay: 125,
54
- }
55
- },
56
-
57
- methods: {
58
- actionButtonBased(value) {
59
- this.$emit(value)
60
- },
61
- },
62
-
63
- computed: {
64
- tooltipLink() {
65
- if (this.dataLink.length >= 60) {
66
- return this.dataLink.slice(0, 60) + '...'
67
- } else {
68
- return this.dataLink
69
- }
70
- },
71
- },
72
- }
73
- </script>
74
-
75
- <style scoped>
76
- .wrapper-floating-link {
77
- border: 1px solid var(--color-gray-50);
78
- min-height: 24px;
79
- justify-content: start;
80
- background-color: var(--white);
81
- box-sizing: content-box;
82
- }
83
-
84
- .wrapper-floating-link >>> .uil-globe {
85
- cursor: default;
86
- }
87
-
88
- .wrapper-floating-link >>> * {
89
- cursor: pointer;
90
- }
91
- </style>
@@ -1,94 +0,0 @@
1
- <template>
2
- <l-box class="link-box column">
3
- <div class="wrapper-input mb-3">
4
- <l-input
5
- v-model="linkToAppend"
6
- placeholder="Insira um link"
7
- :error="linkError"
8
- autofocus
9
- style="box-sizing: border-box"
10
- >
11
- </l-input>
12
- <div class="l-input-error-message" v-if="linkError">
13
- Insira um link válido
14
- </div>
15
- </div>
16
- <div class="wrapper-buttons row l-justify-content-end">
17
- <l-button size="small" @click="$emit('close')">Cancelar</l-button>
18
- <l-button
19
- size="small"
20
- type="primary"
21
- @click="insertLink()"
22
- :disabled="disableButton"
23
- >Inserir</l-button
24
- >
25
- </div>
26
- </l-box>
27
- </template>
28
-
29
- <script>
30
- import Autolinker from 'autolinker'
31
- import { addProtocol } from './helpers/addProtocol'
32
-
33
- export default {
34
- props: {
35
- previousURL: String,
36
- },
37
-
38
- data() {
39
- return {
40
- linkToAppend: this.previousURL,
41
- linkError: '',
42
- }
43
- },
44
-
45
- methods: {
46
- insertLink() {
47
- if (this.isLinkValid(this.linkToAppend)) {
48
- this.linkError = false
49
- this.$emit('setLink', {
50
- url: addProtocol(this.linkToAppend),
51
- insertedText: this.linkToAppend,
52
- })
53
- this.$emit('close')
54
- } else {
55
- this.linkError = true
56
- }
57
- },
58
-
59
- isLinkValid(link) {
60
- const validating = Autolinker.link(link, {
61
- email: false,
62
- })
63
- return validating.includes('href')
64
- },
65
- },
66
-
67
- computed: {
68
- disableButton() {
69
- return this.linkToAppend === '' || this.linkToAppend === undefined
70
- },
71
- },
72
- }
73
- </script>
74
-
75
- <style scoped>
76
- .wrapper-link-box {
77
- position: relative;
78
- }
79
-
80
- .link-box {
81
- width: min(calc(100vw - 2rem), 456px);
82
- padding: 16px;
83
- position: relative;
84
- box-sizing: border-box;
85
- }
86
-
87
- .l-input-error-message {
88
- color: var(--color-danger);
89
- font-weight: 600;
90
- font-size: 12px;
91
- line-height: 130%;
92
- margin-top: 2px;
93
- }
94
- </style>
@@ -1,32 +0,0 @@
1
- <template>
2
- <div id="app">
3
- <h1>Text Editor</h1>
4
-
5
- <l-text-editor v-model="textEditorContent" />
6
-
7
- <section>
8
- <h1>Output Text</h1>
9
- <div v-html="textEditorContent"></div>
10
- </section>
11
-
12
- <section>
13
- <h1>Output HTML</h1>
14
- <div>
15
- <code>{{ textEditorContent }}</code>
16
- </div>
17
- </section>
18
- </div>
19
- </template>
20
-
21
- <script>
22
- export default {
23
- name: 'TextEditor',
24
- data() {
25
- return {
26
- textEditorContent: 'Text for test 3.0 ',
27
- }
28
- },
29
- }
30
- </script>
31
-
32
- <style></style>
@@ -1,12 +0,0 @@
1
- import Blockquote from '@tiptap/extension-blockquote'
2
-
3
- const LayersBlockquote = Blockquote.extend({
4
- addAttributes() {
5
- return {
6
- class: { default: 'px-3 mx-0 my-2' },
7
- style: { default: 'border-left: 3px solid var(--color-gray-50)'}
8
- }
9
- },
10
- })
11
-
12
- export default LayersBlockquote
@@ -1,11 +0,0 @@
1
- import Bold from '@tiptap/extension-bold'
2
-
3
- const LayersBold = Bold.extend({
4
- addAttributes() {
5
- return {
6
- class: { default: 'l-bold' },
7
- }
8
- },
9
- })
10
-
11
- export default LayersBold
@@ -1,16 +0,0 @@
1
- import HardBreak from '@tiptap/extension-hard-break'
2
-
3
- const LayersBreakLine = HardBreak.extend({
4
- defaultOptions: {
5
- ...HardBreak.options,
6
- keepMarks: false,
7
- },
8
-
9
- addKeyboardShortcuts() {
10
- return {
11
- 'Shift-Enter': () => this.editor.commands.setHardBreak(),
12
- }
13
- },
14
- })
15
-
16
- export default LayersBreakLine
@@ -1,10 +0,0 @@
1
- import BubbleMenu from '@tiptap/extension-bubble-menu'
2
-
3
- const LayersBubbleMenu = BubbleMenu.extend({
4
- element: document.querySelector('#bubble-menu'),
5
- tippyOptions: {
6
- zIndex: 1000,
7
- },
8
- })
9
-
10
- export default LayersBubbleMenu
@@ -1,12 +0,0 @@
1
- import BulletList from '@tiptap/extension-bullet-list'
2
-
3
- const LayersBulletList = BulletList.extend({
4
- addAttributes() {
5
- return {
6
- class: { default: 'color-lead-light pl-4' },
7
- style: { default: 'list-style-type: disc;' },
8
- }
9
- },
10
- })
11
-
12
- export default LayersBulletList
@@ -1,13 +0,0 @@
1
- import Heading from '@tiptap/extension-heading'
2
-
3
- const LayersHeading = Heading.extend({
4
- defaultOptions: {
5
- ...Heading.options,
6
- levels: [1],
7
- HTMLAttributes: {
8
- class: 'l-h3 color-lead-light',
9
- },
10
- },
11
- })
12
-
13
- export default LayersHeading
@@ -1,10 +0,0 @@
1
- import History from '@tiptap/extension-history'
2
-
3
- const LayersHistory = History.extend({
4
- defaultOptions: {
5
- ...History.options,
6
- newGroupDelay: 150,
7
- },
8
- })
9
-
10
- export default LayersHistory
@@ -1,11 +0,0 @@
1
- import Italic from '@tiptap/extension-italic'
2
-
3
- const LayersItalic = Italic.extend({
4
- addAttributes() {
5
- return {
6
- class: { default: '' },
7
- }
8
- },
9
- })
10
-
11
- export default LayersItalic