layers-design-system 2.4.0 → 2.5.1

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 +78496 -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/src/assets/button-text-editor/double-quotes.svg +0 -4
  8. package/src/assets/button-text-editor/remove-formatting.svg +0 -5
  9. package/src/assets/button-text-editor/title.svg +0 -4
  10. package/src/assets/failed-to-load/failed-to-load.svg +0 -60
  11. package/src/assets/l-presentation/external-apps.png +0 -0
  12. package/src/assets/l-presentation/notification.png +0 -0
  13. package/src/assets/search-topics/empty-tags.svg +0 -59
  14. package/src/components/LAlert/docs.vue +0 -81
  15. package/src/components/LAlert/index.vue +0 -43
  16. package/src/components/LAttachmentChip/docs.vue +0 -84
  17. package/src/components/LAttachmentChip/index.vue +0 -179
  18. package/src/components/LBox/docs.vue +0 -26
  19. package/src/components/LBox/index.vue +0 -19
  20. package/src/components/LBoxHeader/index.vue +0 -24
  21. package/src/components/LBreadcrumb/docs.vue +0 -21
  22. package/src/components/LBreadcrumb/index.vue +0 -22
  23. package/src/components/LBreadcrumbItem/index.vue +0 -7
  24. package/src/components/LButton/docs.vue +0 -205
  25. package/src/components/LButton/index.vue +0 -369
  26. package/src/components/LButtonGroup/index.vue +0 -7
  27. package/src/components/LCarousel/docs.vue +0 -32
  28. package/src/components/LCarousel/index.vue +0 -88
  29. package/src/components/LCheckbox/docs.vue +0 -62
  30. package/src/components/LCheckbox/index.vue +0 -34
  31. package/src/components/LCheckboxButton/index.vue +0 -30
  32. package/src/components/LCheckboxGroup/index.vue +0 -53
  33. package/src/components/LChip/docs.vue +0 -113
  34. package/src/components/LChip/index.vue +0 -78
  35. package/src/components/LCircularLoader/docs.vue +0 -30
  36. package/src/components/LCircularLoader/index.vue +0 -97
  37. package/src/components/LCollapse/docs.vue +0 -68
  38. package/src/components/LCollapse/index.vue +0 -13
  39. package/src/components/LCollapseItem/index.vue +0 -28
  40. package/src/components/LDatePicker/docs.vue +0 -66
  41. package/src/components/LDatePicker/index.vue +0 -63
  42. package/src/components/LDialog/docs.vue +0 -36
  43. package/src/components/LDialog/index.vue +0 -37
  44. package/src/components/LDropdown/index.vue +0 -7
  45. package/src/components/LDropdownItem/index.vue +0 -13
  46. package/src/components/LDropdownMenu/docs.vue +0 -44
  47. package/src/components/LDropdownMenu/index.vue +0 -12
  48. package/src/components/LFailedToLoad/docs.vue +0 -37
  49. package/src/components/LFailedToLoad/index.vue +0 -61
  50. package/src/components/LForm/index.vue +0 -7
  51. package/src/components/LFormItem/index.vue +0 -12
  52. package/src/components/LHelperBox/assets/link.svg +0 -4
  53. package/src/components/LHelperBox/assets/open-envelope.svg +0 -9
  54. package/src/components/LHelperBox/docs.vue +0 -29
  55. package/src/components/LHelperBox/index.vue +0 -83
  56. package/src/components/LIcon/docs.vue +0 -174
  57. package/src/components/LIcon/index.vue +0 -55
  58. package/src/components/LImage/index.vue +0 -7
  59. package/src/components/LImageViewer/docs.vue +0 -111
  60. package/src/components/LImageViewer/index.vue +0 -449
  61. package/src/components/LInput/docs.vue +0 -43
  62. package/src/components/LInput/index.vue +0 -60
  63. package/src/components/LLinearProgress/docs.vue +0 -21
  64. package/src/components/LLinearProgress/index.vue +0 -74
  65. package/src/components/LNotice/docs.vue +0 -26
  66. package/src/components/LNotice/index.vue +0 -86
  67. package/src/components/LNotification/index.vue +0 -182
  68. package/src/components/LOption/index.vue +0 -7
  69. package/src/components/LOptionGroup/index.vue +0 -7
  70. package/src/components/LPresentation/docs.vue +0 -35
  71. package/src/components/LPresentation/index.vue +0 -182
  72. package/src/components/LProgress/index.vue +0 -7
  73. package/src/components/LPromptDialog/index.vue +0 -82
  74. package/src/components/LRadio/docs.vue +0 -54
  75. package/src/components/LRadio/index.vue +0 -13
  76. package/src/components/LRadioButton/index.vue +0 -30
  77. package/src/components/LRadioGroup/index.vue +0 -54
  78. package/src/components/LSearchBar/AddFilterButton.vue +0 -71
  79. package/src/components/LSearchBar/Filters/Editors/AmountEditor.vue +0 -110
  80. package/src/components/LSearchBar/Filters/Editors/DateEditor.vue +0 -146
  81. package/src/components/LSearchBar/Filters/Editors/NumberEditor.vue +0 -141
  82. package/src/components/LSearchBar/Filters/Editors/StringEditor.vue +0 -140
  83. package/src/components/LSearchBar/Filters/Editors/index.js +0 -16
  84. package/src/components/LSearchBar/Filters/FilterChip.vue +0 -105
  85. package/src/components/LSearchBar/Filters/Views/AmountView.vue +0 -28
  86. package/src/components/LSearchBar/Filters/Views/DateView.vue +0 -46
  87. package/src/components/LSearchBar/Filters/Views/NumberView.vue +0 -24
  88. package/src/components/LSearchBar/Filters/Views/StringView.vue +0 -47
  89. package/src/components/LSearchBar/Filters/Views/index.js +0 -16
  90. package/src/components/LSearchBar/docs.vue +0 -60
  91. package/src/components/LSearchBar/index.vue +0 -240
  92. package/src/components/LSearchTopics/RecentTermSearched.vue +0 -30
  93. package/src/components/LSearchTopics/TopicItem.vue +0 -346
  94. package/src/components/LSearchTopics/docs/drawer.vue +0 -254
  95. package/src/components/LSearchTopics/docs.vue +0 -60
  96. package/src/components/LSearchTopics/header.vue +0 -199
  97. package/src/components/LSearchTopics/helpers/showDialogConfirmation.js +0 -30
  98. package/src/components/LSearchTopics/helpers/showDiscardChangesDialog.js +0 -27
  99. package/src/components/LSearchTopics/index.vue +0 -750
  100. package/src/components/LSelect/docs.vue +0 -129
  101. package/src/components/LSelect/index.vue +0 -9
  102. package/src/components/LSlider/index.vue +0 -7
  103. package/src/components/LSwitch/docs.vue +0 -24
  104. package/src/components/LSwitch/index.vue +0 -60
  105. package/src/components/LTabPane/index.vue +0 -7
  106. package/src/components/LTable/FieldTypes/AmountView.vue +0 -16
  107. package/src/components/LTable/FieldTypes/DateView.vue +0 -18
  108. package/src/components/LTable/FieldTypes/EmailView.vue +0 -8
  109. package/src/components/LTable/FieldTypes/NumberView.vue +0 -13
  110. package/src/components/LTable/FieldTypes/PaymentStatusView.vue +0 -8
  111. package/src/components/LTable/FieldTypes/StringView.vue +0 -24
  112. package/src/components/LTable/FieldTypes/index.js +0 -18
  113. package/src/components/LTable/LTableBody.vue +0 -245
  114. package/src/components/LTable/LTableBodySpacer.vue +0 -17
  115. package/src/components/LTable/LTableEndspace.vue +0 -20
  116. package/src/components/LTable/LTableHeader.vue +0 -155
  117. package/src/components/LTable/LTableHeaderCell.vue +0 -188
  118. package/src/components/LTable/LTableHeaderLoader.vue +0 -62
  119. package/src/components/LTable/LTableHeaderResizer.vue +0 -162
  120. package/src/components/LTable/LTableLoadMore.vue +0 -56
  121. package/src/components/LTable/LTablePagination.vue +0 -174
  122. package/src/components/LTable/LTableReloader.vue +0 -61
  123. package/src/components/LTable/ListAdapter.js +0 -74
  124. package/src/components/LTable/docs.vue +0 -111
  125. package/src/components/LTable/helpers.js +0 -194
  126. package/src/components/LTable/index.vue +0 -961
  127. package/src/components/LTabs/docs.vue +0 -28
  128. package/src/components/LTabs/index.vue +0 -37
  129. package/src/components/LTargetChip/docs.vue +0 -86
  130. package/src/components/LTargetChip/index.vue +0 -64
  131. package/src/components/LTargetInput/docs.vue +0 -72
  132. package/src/components/LTargetInput/index.vue +0 -78
  133. package/src/components/LTextEditor/FloatingLink.vue +0 -91
  134. package/src/components/LTextEditor/LinkBox.vue +0 -94
  135. package/src/components/LTextEditor/docs.vue +0 -32
  136. package/src/components/LTextEditor/extensions/LayersBlockquote.js +0 -12
  137. package/src/components/LTextEditor/extensions/LayersBold.js +0 -11
  138. package/src/components/LTextEditor/extensions/LayersBreakLine.js +0 -16
  139. package/src/components/LTextEditor/extensions/LayersBubbleMenu.js +0 -10
  140. package/src/components/LTextEditor/extensions/LayersBulletList.js +0 -12
  141. package/src/components/LTextEditor/extensions/LayersHeading.js +0 -13
  142. package/src/components/LTextEditor/extensions/LayersHistory.js +0 -10
  143. package/src/components/LTextEditor/extensions/LayersItalic.js +0 -11
  144. package/src/components/LTextEditor/extensions/LayersLink.js +0 -29
  145. package/src/components/LTextEditor/extensions/LayersOrderedList.js +0 -12
  146. package/src/components/LTextEditor/extensions/LayersParagraph.js +0 -44
  147. package/src/components/LTextEditor/extensions/LayersPlaceholder.js +0 -11
  148. package/src/components/LTextEditor/extensions/LayersUnderline.js +0 -29
  149. package/src/components/LTextEditor/helpers/addProtocol.js +0 -5
  150. package/src/components/LTextEditor/helpers/removeEmptyTags.js +0 -5
  151. package/src/components/LTextEditor/index.vue +0 -421
  152. package/src/components/LTimeSelect/docs.vue +0 -41
  153. package/src/components/LTimeSelect/index.vue +0 -49
  154. package/src/components/LToggleButtonGroup/index.vue +0 -87
  155. package/src/components/LTooltip/docs.vue +0 -66
  156. package/src/components/LTooltip/index.vue +0 -28
  157. package/src/components/LTransitionExpand/docs.vue +0 -26
  158. package/src/components/LTransitionExpand/index.vue +0 -88
  159. package/src/components/LUpload/index.vue +0 -7
  160. package/src/docs/Colors.vue +0 -50
  161. package/src/docs/Home.vue +0 -11
  162. package/src/docs/Notifications.vue +0 -88
  163. package/src/docs/index.vue +0 -76
  164. package/src/docs/routes.js +0 -20
  165. package/src/helpers/Colors.js +0 -79
  166. package/src/helpers/FieldTypeComponents.js +0 -43
  167. package/src/helpers/Icons.js +0 -67
  168. package/src/helpers/Notification.js +0 -94
  169. package/src/helpers/PrettySize.js +0 -25
  170. package/src/helpers/RegisterElementUIComponents.js +0 -9
  171. package/src/helpers/Schemas.js +0 -18
  172. package/src/helpers/util.js +0 -15
  173. package/src/main-docs.js +0 -132
  174. package/src/main.js +0 -100
  175. package/src/style/colors.scss +0 -31
  176. package/src/style/element-variables.scss +0 -21
  177. package/src/style/icons.scss +0 -5
  178. package/src/style/layers-variables.scss +0 -73
  179. package/src/style/layout.scss +0 -2288
  180. package/src/style/main.scss +0 -11
  181. package/src/style/notifications.scss +0 -88
  182. package/src/style/transitions.scss +0 -43
  183. package/src/style/typography.scss +0 -155
  184. package/vue.config.js +0 -14
  185. /package/{public → dist}/favicon.ico +0 -0
  186. /package/{public → dist}/index.html +0 -0
@@ -1,29 +0,0 @@
1
- import Link from '@tiptap/extension-link'
2
-
3
- const defaultClass = 'color-link'
4
- const defaultInlineStyle = 'text-decoration: underline'
5
-
6
- const LayersLink = Link.extend({
7
- defaultOptions: {
8
- ...Link.options,
9
- openOnClick: false,
10
- },
11
-
12
- priority: 1,
13
-
14
- addAttributes() {
15
- return {
16
- class: {
17
- default: defaultClass,
18
- parseHTML: (a) => (a.class = defaultClass),
19
- },
20
- style: {
21
- default: defaultInlineStyle,
22
- parseHTML: (a) => (a.style = defaultInlineStyle),
23
- },
24
- href: { default: '' },
25
- }
26
- },
27
- })
28
-
29
- export default LayersLink
@@ -1,12 +0,0 @@
1
- import OrderedList from '@tiptap/extension-ordered-list'
2
-
3
- const LayersOrderedList = OrderedList.extend({
4
- addAttributes() {
5
- return {
6
- class: { default: 'color-lead-light pl-4' },
7
- style: { default: 'list-style-type: decimal' },
8
- }
9
- },
10
- })
11
-
12
- export default LayersOrderedList
@@ -1,44 +0,0 @@
1
- import Paragraph from '@tiptap/extension-paragraph'
2
-
3
- const defaultInlineStyle = 'min-height: 1.4em; overflow-wrap: break-word;'
4
-
5
- const LayersParagraph = Paragraph.extend({
6
- addAttributes() {
7
- return {
8
- class: { default: 'l-text-regular l-text-left color-lead-light my-3' },
9
- style: {
10
- default: defaultInlineStyle,
11
- parseHTML: (paragraph) => (paragraph.style = defaultInlineStyle),
12
- },
13
- }
14
- },
15
-
16
- addCommands() {
17
- return {
18
- setMarkUp: (type) => ({ commands, chain }) => {
19
- switch (type) {
20
- case 'bold':
21
- return commands.toggleBold()
22
- case 'italic':
23
- return commands.toggleItalic()
24
- case 'underline':
25
- return commands.toggleUnderline()
26
- case 'heading':
27
- return commands.toggleHeading({ level: 1 })
28
- case 'bulletList':
29
- return commands.toggleBulletList()
30
- case 'orderedList':
31
- return commands.toggleOrderedList()
32
- case 'blockquote':
33
- return commands.toggleBlockquote()
34
- case 'removeFormatting':
35
- return chain()
36
- .unsetAllMarks()
37
- .clearNodes()
38
- }
39
- },
40
- }
41
- },
42
- })
43
-
44
- export default LayersParagraph
@@ -1,11 +0,0 @@
1
- import Placeholder from '@tiptap/extension-placeholder'
2
-
3
- const LayersPlaceholder = Placeholder.extend({
4
- defaultOptions: {
5
- ...Placeholder.options,
6
- emptyEditorClass: 'is-editor-empty color-gray-60',
7
- placeholder: 'Escreva a descrição aqui',
8
- },
9
- })
10
-
11
- export default LayersPlaceholder
@@ -1,29 +0,0 @@
1
- import Underline from '@tiptap/extension-underline'
2
-
3
- const defaultClass = ''
4
-
5
- const LayersUnderline = Underline.extend({
6
- addAttributes() {
7
- return {
8
- class: {
9
- default: defaultClass,
10
- parseHTML: (u) => (u.style = defaultClass),
11
- },
12
- }
13
- },
14
-
15
- parseHTML() {
16
- return [
17
- {
18
- tag: 'u',
19
- },
20
- {
21
- style: 'border-bottom',
22
- getAttrs: (borderValue) =>
23
- borderValue !== undefined || borderValue !== 0,
24
- },
25
- ]
26
- },
27
- })
28
-
29
- export default LayersUnderline
@@ -1,5 +0,0 @@
1
- export function addProtocol(link) {
2
- return link.startsWith('http://') || link.startsWith('https://')
3
- ? link
4
- : 'https://' + link
5
- }
@@ -1,5 +0,0 @@
1
- const emptyTagRegex = /<(\w+).[^>]*>\s*<\/\1>/g
2
-
3
- export default function removeEmptyTags(text) {
4
- return text.replace(emptyTagRegex, '')
5
- }
@@ -1,421 +0,0 @@
1
- <template>
2
- <section class="wrapper-text-editor">
3
- <BubbleMenu
4
- :editor="editor"
5
- :tippyOptions="{ zIndex: 1000 }"
6
- :shouldShow="({ editor }) => editor.isActive('link')"
7
- v-if="showFloatingLink"
8
- >
9
- <FloatingLink
10
- :data-link="editor.getAttributes('link').href"
11
- @edit="toggleLinkBox()"
12
- @remove="markOffLink()"
13
- />
14
- </BubbleMenu>
15
-
16
- <EditorContent :editor="editor" ref="texteditor" />
17
- <div class="wrapper-editor-features">
18
- <div class="wrapper-scroll">
19
- <div
20
- class="wrapper-buttons py-2 pl-3 pr-4 l-d-flex row l-d-justify-content-start l-d-align-item-center"
21
- >
22
- <l-tooltip
23
- v-for="markUp in markUps"
24
- :key="markUp.name"
25
- :content="markUp.tooltip"
26
- class="item"
27
- :open-delay="tooltipDelay"
28
- >
29
- <l-button
30
- @click="markUpText(markUp.name)"
31
- class="button-text-editor"
32
- :class="{ 'is-active': editor.isActive(markUp.name) }"
33
- size="small"
34
- square
35
- :ref="markUp.name"
36
- >
37
- <l-icon
38
- v-if="isUnicon(markUp.icon)"
39
- size="24"
40
- :icon="markUp.icon"
41
- ></l-icon>
42
- <img
43
- v-else
44
- :src="markUp.icon"
45
- :class="{ 'icon-active': editor.isActive(markUp.name) }"
46
- />
47
- </l-button>
48
- </l-tooltip>
49
- </div>
50
- </div>
51
- <template v-if="showLinkBox">
52
- <span class="link-box-arrow" :style="[arrowXPosition]" />
53
- <LinkBox
54
- class="link-box-position"
55
- @close="closeLinkBox()"
56
- @setLink="markUpLink($event)"
57
- :previousURL="previousURL"
58
- :style="[linkBoxPosition]"
59
- />
60
- </template>
61
- </div>
62
- </section>
63
- </template>
64
-
65
- <script>
66
- import { Editor, EditorContent, BubbleMenu } from "@tiptap/vue-2";
67
- import Document from "@tiptap/extension-document";
68
- import Text from "@tiptap/extension-text";
69
- import ListItem from "@tiptap/extension-list-item";
70
-
71
- //Layers Custom Extensions
72
- import LayersParagraph from "./extensions/LayersParagraph";
73
- import LayersBold from "./extensions/LayersBold";
74
- import LayersItalic from "./extensions/LayersItalic";
75
- import LayersUnderline from "./extensions/LayersUnderline";
76
- import LayersHeading from "./extensions/LayersHeading";
77
- import LayersBulletList from "./extensions/LayersBulletList";
78
- import LayersOrderedList from "./extensions/LayersOrderedList";
79
- import LayersBlockquote from "./extensions/LayersBlockquote";
80
- import LayersLink from "./extensions/LayersLink";
81
- import LayersPlaceholder from "./extensions/LayersPlaceholder";
82
- import LayersBreakLine from "./extensions/LayersBreakLine";
83
- import LayersHistory from "./extensions/LayersHistory";
84
-
85
- //Custom Components
86
- import LinkBox from "./LinkBox.vue";
87
- import FloatingLink from "./FloatingLink.vue";
88
-
89
- //Helpers
90
- import removeEmptyTags from "./helpers/removeEmptyTags.js";
91
- import DOMPurify from "dompurify";
92
- import Autolinker from "autolinker";
93
-
94
- export default {
95
- tagName: "l-text-editor",
96
-
97
- props: {
98
- value: String,
99
- },
100
-
101
- components: {
102
- EditorContent,
103
- LinkBox,
104
- BubbleMenu,
105
- FloatingLink,
106
- },
107
-
108
- data() {
109
- return {
110
- editor: null,
111
- markUps: [
112
- {
113
- name: "bold",
114
- tooltip: "Negrito",
115
- icon: "uil-bold",
116
- },
117
- {
118
- name: "italic",
119
- tooltip: "Itálico",
120
- icon: "uil-italic",
121
- },
122
- {
123
- name: "underline",
124
- tooltip: "Sublinhado",
125
- icon: "uil-underline",
126
- },
127
- {
128
- name: "heading",
129
- tooltip: "Título",
130
- icon: require("../../assets/button-text-editor/title.svg"),
131
- },
132
- {
133
- name: "bulletList",
134
- tooltip: "Lista com marcadores",
135
- icon: "uil-list-ul",
136
- },
137
- {
138
- name: "orderedList",
139
- tooltip: "Lista numerada",
140
- icon: "uil-list-ol-alt",
141
- },
142
- {
143
- name: "link",
144
- tooltip: "Inserir link",
145
- icon: "uil-link-alt",
146
- },
147
- {
148
- name: "blockquote",
149
- tooltip: "Citação",
150
- icon: require("../../assets/button-text-editor/double-quotes.svg"),
151
- },
152
- {
153
- name: "removeFormatting",
154
- tooltip: "Remover formatação",
155
- icon: require("../../assets/button-text-editor/remove-formatting.svg"),
156
- },
157
- ],
158
- showLinkBox: false,
159
- isEditorFocused: null,
160
- tooltipDelay: 125,
161
- };
162
- },
163
-
164
- methods: {
165
- isUnicon(value) {
166
- return value.startsWith("uil-");
167
- },
168
-
169
- markUpText(type) {
170
- if (type === "link") {
171
- this.toggleLinkBox();
172
- return;
173
- }
174
- const commandChain = this.editor.chain().focus();
175
- commandChain.setMarkUp(type).run();
176
- },
177
-
178
- toggleLinkBox() {
179
- this.showLinkBox = !this.showLinkBox;
180
- },
181
- closeLinkBox() {
182
- this.editor.commands.focus();
183
- this.toggleLinkBox();
184
- },
185
-
186
- markUpLink(info) {
187
- if (this.currentTextSelection || this.previousURL) {
188
- this.editor
189
- .chain()
190
- .focus()
191
- .extendMarkRange("link")
192
- .setLink({ href: info.url, target: "_blank" })
193
- .run();
194
- } else {
195
- this.editor.commands.insertContent(Autolinker.link(info.insertedText));
196
- }
197
- },
198
- markOffLink() {
199
- this.editor.chain().focus().extendMarkRange("link").unsetLink().run();
200
- },
201
-
202
- hasSomeMarkUpActive() {
203
- const textEditorContent = this.editor.getJSON().content;
204
- const textEditorMarkUps = this.markUps.map((markUp) => markUp.name);
205
-
206
- const textNodesActive = textEditorContent.map((node) => node.type);
207
-
208
- const hasSomeNode = textNodesActive.some((node) =>
209
- textEditorMarkUps.includes(node)
210
- );
211
- const hasSomeMark = textEditorContent.some((node) => {
212
- if (node.hasOwnProperty("content")) {
213
- return node.content.some((content) =>
214
- content.hasOwnProperty("marks")
215
- );
216
- }
217
- });
218
-
219
- return hasSomeNode || hasSomeMark;
220
- },
221
-
222
- addSpaceToFinalParagraphTag(text) {
223
- return text.replace(/<\/p>/g, " </p>");
224
- },
225
- },
226
-
227
- computed: {
228
- previousURL() {
229
- return this.editor.getAttributes("link").href;
230
- },
231
- showFloatingLink() {
232
- return this.editor.isActive("link");
233
- },
234
- finalText() {
235
- const textEditorHTML = this.editor.getHTML();
236
- const textEditorHTMLSpaced =
237
- this.addSpaceToFinalParagraphTag(textEditorHTML);
238
- const textEditorHTMLWithLinks = Autolinker.link(textEditorHTMLSpaced);
239
-
240
- return DOMPurify.sanitize(removeEmptyTags(textEditorHTMLWithLinks), {
241
- ADD_ATTR: ["target"],
242
- });
243
- },
244
- currentTextSelection() {
245
- const { view, state } = this.editor;
246
- const { from, to } = view.state.selection;
247
- return state.doc.textBetween(from, to, "");
248
- },
249
- arrowXPosition() {
250
- const arrowWidth = 16.8; //px
251
- const buttonLink = this.$refs.link[0].$el;
252
-
253
- //formula to position the arrow based on the button link position
254
- const arrowLeftOffset =
255
- buttonLink.offsetLeft + (buttonLink.offsetWidth - arrowWidth) / 2;
256
- return { left: `${arrowLeftOffset}px` };
257
- },
258
- linkBoxPosition() {
259
- const linkBoxWidth = 456; //px
260
- const textEditorWidth = this.$refs.texteditor.$el.offsetWidth;
261
- const buttonLink = this.$refs.link[0].$el;
262
- let linkBoxLeftOffset;
263
- const overflowLimit = 500;
264
-
265
- if (textEditorWidth > overflowLimit) {
266
- //formula to position the link box based on the screen width
267
- linkBoxLeftOffset = `${
268
- buttonLink.offsetLeft + buttonLink.offsetWidth / 2 - linkBoxWidth / 2
269
- }px`;
270
- } else {
271
- linkBoxLeftOffset = "1rem";
272
- }
273
- return { left: linkBoxLeftOffset };
274
- },
275
- },
276
-
277
- beforeMount() {
278
- this.editor = new Editor({
279
- extensions: [
280
- Document,
281
- Text,
282
- ListItem,
283
- LayersParagraph,
284
- LayersBold,
285
- LayersItalic,
286
- LayersUnderline,
287
- LayersHeading,
288
- LayersBulletList,
289
- LayersOrderedList,
290
- LayersBlockquote,
291
- LayersLink,
292
- LayersPlaceholder,
293
- LayersBreakLine,
294
- LayersHistory,
295
- ],
296
- content: this.value,
297
- autofocus: false,
298
- onUpdate: () => {
299
- this.$emit("input", this.finalText);
300
- this.$emit("useMarkUp", this.hasSomeMarkUpActive());
301
- },
302
- onFocus: () => {
303
- this.isEditorFocused = true;
304
- this.$emit("focus", true);
305
- },
306
- onBlur: () => {
307
- this.isEditorFocused = false;
308
- },
309
- });
310
- },
311
-
312
- beforeDestroy() {
313
- this.editor.destroy();
314
- },
315
- };
316
- </script>
317
-
318
- <style scoped>
319
- .wrapper-text-editor {
320
- background-color: var(--white);
321
- position: relative;
322
- }
323
-
324
- .wrapper-text-editor >>> .ProseMirror:focus {
325
- outline: none;
326
- }
327
-
328
- .wrapper-text-editor >>> .ProseMirror {
329
- min-height: 84px;
330
- padding: 0 1rem;
331
- }
332
-
333
- .wrapper-text-editor >>> .ProseMirror p.is-editor-empty:first-child::before {
334
- content: attr(data-placeholder);
335
- float: left;
336
- pointer-events: none;
337
- height: 0;
338
- }
339
-
340
- hr.input-separator {
341
- padding: 0px;
342
- border-bottom: 1px solid;
343
- border-top: 0px;
344
- margin-right: -16px;
345
- margin-left: -16px;
346
- }
347
-
348
- .wrapper-editor-features {
349
- position: sticky;
350
- bottom: 0;
351
- z-index: 1010;
352
- }
353
-
354
- .wrapper-scroll {
355
- border-top: 1px solid var(--color-gray-30);
356
- border-bottom: 1px solid var(--color-gray-30);
357
- background-color: var(--white);
358
- }
359
-
360
- .wrapper-buttons {
361
- width: 100%;
362
- position: relative;
363
- }
364
-
365
- .button-text-editor {
366
- border-width: 0px;
367
- min-width: 32px;
368
- min-height: 32px;
369
- }
370
-
371
- .button-text-editor:hover,
372
- .button-text-editor:focus {
373
- border-width: 1px;
374
- }
375
-
376
- .button-text-editor:active {
377
- background-color: var(--color-gray-40) !important;
378
- }
379
-
380
- .button-text-editor.is-active {
381
- background-color: var(--color-link-light);
382
- color: var(--color-link);
383
- border-width: 0px;
384
- }
385
-
386
- .button-text-editor.is-active:focus,
387
- .button-text-editor.is-active:hover {
388
- background-color: var(--color-link-light) !important;
389
- color: var(--color-link) !important;
390
- }
391
-
392
- .icon-active {
393
- filter: invert(48%) sepia(58%) saturate(3781%) hue-rotate(195deg)
394
- brightness(99%) contrast(94%);
395
- }
396
-
397
- .link-box-arrow {
398
- display: block;
399
- width: 12px;
400
- height: 12px;
401
- border-right: 1px solid var(--color-gray-30);
402
- border-bottom: 1px solid var(--color-gray-30);
403
- background-color: var(--white);
404
- transform: rotate(45deg);
405
- position: absolute;
406
- bottom: 51px;
407
- z-index: 1502;
408
- }
409
-
410
- .link-box-position {
411
- position: absolute;
412
- bottom: 57px;
413
- z-index: 1500;
414
- }
415
-
416
- @media screen and (max-width: 400px) {
417
- .wrapper-scroll {
418
- overflow-x: scroll;
419
- }
420
- }
421
- </style>
@@ -1,41 +0,0 @@
1
- <template>
2
- <div>
3
- <h1>Time Select</h1>
4
-
5
- <div class="row">
6
- <l-time-select
7
- v-model="value"
8
- :picker-options="{
9
- start: '08:30',
10
- step: '00:15',
11
- end: '18:30'
12
- }">
13
- </l-time-select>
14
- </div>
15
-
16
- <div style="margin-top: 12px">Sem ícone</div>
17
- <div class="row">
18
- <l-time-select
19
- v-model="value2"
20
- hideIcon
21
- :picker-options="{
22
- start: '08:30',
23
- step: '00:15',
24
- end: '18:30'
25
- }">
26
- </l-time-select>
27
- </div>
28
- </div>
29
- </template>
30
-
31
- <script>
32
- export default {
33
- name: "TimeSelect",
34
- data() {
35
- return {
36
- value: "",
37
- value2: "",
38
- };
39
- }
40
- };
41
- </script>
@@ -1,49 +0,0 @@
1
- <script>
2
- import { TimeSelect } from "element-ui";
3
- export default {
4
- tagName: "l-time-select",
5
- extends: TimeSelect,
6
- props: {
7
- prefixIcon: { type: String, default: () => "uil-clock" },
8
- clearIcon: { type: String, default: () => "uil-multiply" },
9
- hideIcon: { type: Boolean, default: () => false },
10
- placeholder: { type: String, default: () => "Horário" },
11
- clearable: { type: Boolean, default: () => false },
12
- },
13
-
14
- mounted() {
15
- if(this.hideIcon) this.$el.classList.add("hide-icon")
16
- }
17
- };
18
- </script>
19
- <style>
20
- .l-time-select.el-date-editor.el-input.hide-icon {
21
- width: 80px;
22
- }
23
- .l-time-select.el-date-editor.el-input.hide-icon > .el-input__prefix {
24
- display: none;
25
- }
26
- .l-time-select.el-date-editor.el-input.hide-icon .el-input__inner{
27
- padding-left: 12px !important;
28
- padding-right: 12px !important;
29
- }
30
-
31
-
32
- .l-time-select.el-date-editor.el-input {
33
- width: 130px;
34
- }
35
- .l-time-select .el-input__prefix {
36
- margin-left: 6px !important;
37
- font-size: 18px !important;
38
- color: var(--color-gray-70);
39
- }
40
- .l-time-select .el-input__inner {
41
- padding-left: 38px !important;
42
- }
43
-
44
- .l-time-select .el-input__icon.el-range__icon.uil-clock {
45
- font-size: 18px;
46
- margin-left: -3px;
47
- color: var(--color-gray-70);
48
- }
49
- </style>