layers-design-system 2.0.11 → 2.2.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.
- package/package.json +1 -1
- package/src/components/LNotification/index.vue +1 -1
- package/src/components/LSearchBar/Filters/Editors/index.js +4 -4
- package/src/components/LSearchBar/Filters/Views/index.js +4 -4
- package/src/components/LSearchBar/index.vue +2 -2
- package/src/components/LTable/FieldTypes/index.js +5 -5
- package/src/components/LTable/LTableHeader.vue +2 -2
- package/src/components/LTable/LTableHeaderCell.vue +1 -1
- package/src/components/LTable/index.vue +7 -7
- package/src/components/LTextEditor/index.vue +108 -111
- package/src/main.js +62 -50
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import StringEditor from "./StringEditor";
|
|
2
|
-
import AmountEditor from "./AmountEditor";
|
|
3
|
-
import NumberEditor from "./NumberEditor";
|
|
4
|
-
import DateEditor from "./DateEditor";
|
|
1
|
+
import StringEditor from "./StringEditor.vue";
|
|
2
|
+
import AmountEditor from "./AmountEditor.vue";
|
|
3
|
+
import NumberEditor from "./NumberEditor.vue";
|
|
4
|
+
import DateEditor from "./DateEditor.vue";
|
|
5
5
|
|
|
6
6
|
import { FieldTypeComponents } from '../../../../helpers/FieldTypeComponents'
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import StringView from "./StringView";
|
|
2
|
-
import AmountView from "./AmountView";
|
|
3
|
-
import NumberView from "./NumberView";
|
|
4
|
-
import DateView from "./DateView";
|
|
1
|
+
import StringView from "./StringView.vue";
|
|
2
|
+
import AmountView from "./AmountView.vue";
|
|
3
|
+
import NumberView from "./NumberView.vue";
|
|
4
|
+
import DateView from "./DateView.vue";
|
|
5
5
|
|
|
6
6
|
import { FieldTypeComponents } from '../../../../helpers/FieldTypeComponents'
|
|
7
7
|
|
|
@@ -49,8 +49,8 @@ import isEqual from "lodash/isEqual";
|
|
|
49
49
|
import findIndex from "lodash/findIndex";
|
|
50
50
|
import find from "lodash/find";
|
|
51
51
|
|
|
52
|
-
import AddFilterButton from "./AddFilterButton";
|
|
53
|
-
import FilterChip from "./Filters/FilterChip";
|
|
52
|
+
import AddFilterButton from "./AddFilterButton.vue";
|
|
53
|
+
import FilterChip from "./Filters/FilterChip.vue";
|
|
54
54
|
|
|
55
55
|
export default {
|
|
56
56
|
tagName: "l-search-bar",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import StringView from "./StringView";
|
|
2
|
-
import NumberView from "./NumberView";
|
|
3
|
-
import AmountView from "./AmountView";
|
|
4
|
-
import EmailView from "./EmailView";
|
|
5
|
-
import DateView from "./DateView";
|
|
1
|
+
import StringView from "./StringView.vue";
|
|
2
|
+
import NumberView from "./NumberView.vue";
|
|
3
|
+
import AmountView from "./AmountView.vue";
|
|
4
|
+
import EmailView from "./EmailView.vue";
|
|
5
|
+
import DateView from "./DateView.vue";
|
|
6
6
|
|
|
7
7
|
import { FieldTypeComponents } from '../../../helpers/FieldTypeComponents'
|
|
8
8
|
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
</template>
|
|
32
32
|
|
|
33
33
|
<script>
|
|
34
|
-
import LTableHeaderCell from "./LTableHeaderCell";
|
|
35
|
-
import LTableHeaderLoader from "./LTableHeaderLoader";
|
|
34
|
+
import LTableHeaderCell from "./LTableHeaderCell.vue";
|
|
35
|
+
import LTableHeaderLoader from "./LTableHeaderLoader.vue";
|
|
36
36
|
|
|
37
37
|
export default {
|
|
38
38
|
components: { LTableHeaderCell, LTableHeaderLoader },
|
|
@@ -78,13 +78,13 @@
|
|
|
78
78
|
import FieldTypes from "./FieldTypes";
|
|
79
79
|
FieldTypes.register();
|
|
80
80
|
|
|
81
|
-
import LTableBody from "./LTableBody";
|
|
82
|
-
import LTableHeader from "./LTableHeader";
|
|
83
|
-
import LTableEndspace from "./LTableEndspace"
|
|
84
|
-
import LTableLoadMore from "./LTableLoadMore";
|
|
85
|
-
import LTableReloader from "./LTableReloader";
|
|
86
|
-
import LTableBodySpacer from "./LTableBodySpacer";
|
|
87
|
-
import LTablePagination from "./LTablePagination";
|
|
81
|
+
import LTableBody from "./LTableBody.vue";
|
|
82
|
+
import LTableHeader from "./LTableHeader.vue";
|
|
83
|
+
import LTableEndspace from "./LTableEndspace.vue"
|
|
84
|
+
import LTableLoadMore from "./LTableLoadMore.vue";
|
|
85
|
+
import LTableReloader from "./LTableReloader.vue";
|
|
86
|
+
import LTableBodySpacer from "./LTableBodySpacer.vue";
|
|
87
|
+
import LTablePagination from "./LTablePagination.vue";
|
|
88
88
|
|
|
89
89
|
import {changeSelection} from './helpers'
|
|
90
90
|
|
|
@@ -63,37 +63,36 @@
|
|
|
63
63
|
</template>
|
|
64
64
|
|
|
65
65
|
<script>
|
|
66
|
-
import { Editor, EditorContent, BubbleMenu } from
|
|
67
|
-
import Document from
|
|
68
|
-
import Text from
|
|
69
|
-
import ListItem from
|
|
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
70
|
|
|
71
71
|
//Layers Custom Extensions
|
|
72
|
-
import LayersParagraph from
|
|
73
|
-
import LayersBold from
|
|
74
|
-
import LayersItalic from
|
|
75
|
-
import LayersUnderline from
|
|
76
|
-
import LayersHeading from
|
|
77
|
-
import LayersBulletList from
|
|
78
|
-
import LayersOrderedList from
|
|
79
|
-
import LayersBlockquote from
|
|
80
|
-
import LayersLink from
|
|
81
|
-
import LayersPlaceholder from
|
|
82
|
-
import LayersBreakLine from
|
|
83
|
-
import LayersHistory from
|
|
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
84
|
|
|
85
85
|
//Custom Components
|
|
86
|
-
import LinkBox from
|
|
87
|
-
import FloatingLink from
|
|
86
|
+
import LinkBox from "./LinkBox.vue";
|
|
87
|
+
import FloatingLink from "./FloatingLink.vue";
|
|
88
88
|
|
|
89
89
|
//Helpers
|
|
90
|
-
import
|
|
91
|
-
import
|
|
92
|
-
import
|
|
93
|
-
import Autolinker from 'autolinker'
|
|
90
|
+
import removeEmptyTags from "./helpers/removeEmptyTags.js";
|
|
91
|
+
import DOMPurify from "dompurify";
|
|
92
|
+
import Autolinker from "autolinker";
|
|
94
93
|
|
|
95
94
|
export default {
|
|
96
|
-
tagName:
|
|
95
|
+
tagName: "l-text-editor",
|
|
97
96
|
|
|
98
97
|
props: {
|
|
99
98
|
value: String,
|
|
@@ -111,77 +110,77 @@ export default {
|
|
|
111
110
|
editor: null,
|
|
112
111
|
markUps: [
|
|
113
112
|
{
|
|
114
|
-
name:
|
|
115
|
-
tooltip:
|
|
116
|
-
icon:
|
|
113
|
+
name: "bold",
|
|
114
|
+
tooltip: "Negrito",
|
|
115
|
+
icon: "uil-bold",
|
|
117
116
|
},
|
|
118
117
|
{
|
|
119
|
-
name:
|
|
120
|
-
tooltip:
|
|
121
|
-
icon:
|
|
118
|
+
name: "italic",
|
|
119
|
+
tooltip: "Itálico",
|
|
120
|
+
icon: "uil-italic",
|
|
122
121
|
},
|
|
123
122
|
{
|
|
124
|
-
name:
|
|
125
|
-
tooltip:
|
|
126
|
-
icon:
|
|
123
|
+
name: "underline",
|
|
124
|
+
tooltip: "Sublinhado",
|
|
125
|
+
icon: "uil-underline",
|
|
127
126
|
},
|
|
128
127
|
{
|
|
129
|
-
name:
|
|
130
|
-
tooltip:
|
|
131
|
-
icon: require(
|
|
128
|
+
name: "heading",
|
|
129
|
+
tooltip: "Título",
|
|
130
|
+
icon: require("../../assets/button-text-editor/title.svg"),
|
|
132
131
|
},
|
|
133
132
|
{
|
|
134
|
-
name:
|
|
135
|
-
tooltip:
|
|
136
|
-
icon:
|
|
133
|
+
name: "bulletList",
|
|
134
|
+
tooltip: "Lista com marcadores",
|
|
135
|
+
icon: "uil-list-ul",
|
|
137
136
|
},
|
|
138
137
|
{
|
|
139
|
-
name:
|
|
140
|
-
tooltip:
|
|
141
|
-
icon:
|
|
138
|
+
name: "orderedList",
|
|
139
|
+
tooltip: "Lista numerada",
|
|
140
|
+
icon: "uil-list-ol-alt",
|
|
142
141
|
},
|
|
143
142
|
{
|
|
144
|
-
name:
|
|
145
|
-
tooltip:
|
|
146
|
-
icon:
|
|
143
|
+
name: "link",
|
|
144
|
+
tooltip: "Inserir link",
|
|
145
|
+
icon: "uil-link-alt",
|
|
147
146
|
},
|
|
148
147
|
{
|
|
149
|
-
name:
|
|
150
|
-
tooltip:
|
|
151
|
-
icon: require(
|
|
148
|
+
name: "blockquote",
|
|
149
|
+
tooltip: "Citação",
|
|
150
|
+
icon: require("../../assets/button-text-editor/double-quotes.svg"),
|
|
152
151
|
},
|
|
153
152
|
{
|
|
154
|
-
name:
|
|
155
|
-
tooltip:
|
|
156
|
-
icon: require(
|
|
153
|
+
name: "removeFormatting",
|
|
154
|
+
tooltip: "Remover formatação",
|
|
155
|
+
icon: require("../../assets/button-text-editor/remove-formatting.svg"),
|
|
157
156
|
},
|
|
158
157
|
],
|
|
159
158
|
showLinkBox: false,
|
|
160
159
|
isEditorFocused: null,
|
|
161
160
|
tooltipDelay: 125,
|
|
162
|
-
}
|
|
161
|
+
};
|
|
163
162
|
},
|
|
164
163
|
|
|
165
164
|
methods: {
|
|
166
165
|
isUnicon(value) {
|
|
167
|
-
return value.startsWith(
|
|
166
|
+
return value.startsWith("uil-");
|
|
168
167
|
},
|
|
169
168
|
|
|
170
169
|
markUpText(type) {
|
|
171
|
-
if (type ===
|
|
172
|
-
this.toggleLinkBox()
|
|
173
|
-
return
|
|
170
|
+
if (type === "link") {
|
|
171
|
+
this.toggleLinkBox();
|
|
172
|
+
return;
|
|
174
173
|
}
|
|
175
|
-
const commandChain = this.editor.chain().focus()
|
|
176
|
-
commandChain.setMarkUp(type).run()
|
|
174
|
+
const commandChain = this.editor.chain().focus();
|
|
175
|
+
commandChain.setMarkUp(type).run();
|
|
177
176
|
},
|
|
178
177
|
|
|
179
178
|
toggleLinkBox() {
|
|
180
|
-
this.showLinkBox = !this.showLinkBox
|
|
179
|
+
this.showLinkBox = !this.showLinkBox;
|
|
181
180
|
},
|
|
182
181
|
closeLinkBox() {
|
|
183
|
-
this.editor.commands.focus()
|
|
184
|
-
this.toggleLinkBox()
|
|
182
|
+
this.editor.commands.focus();
|
|
183
|
+
this.toggleLinkBox();
|
|
185
184
|
},
|
|
186
185
|
|
|
187
186
|
markUpLink(info) {
|
|
@@ -189,91 +188,89 @@ export default {
|
|
|
189
188
|
this.editor
|
|
190
189
|
.chain()
|
|
191
190
|
.focus()
|
|
192
|
-
.extendMarkRange(
|
|
193
|
-
.setLink({ href: info.url, target:
|
|
194
|
-
.run()
|
|
191
|
+
.extendMarkRange("link")
|
|
192
|
+
.setLink({ href: info.url, target: "_blank" })
|
|
193
|
+
.run();
|
|
195
194
|
} else {
|
|
196
|
-
this.editor.commands.insertContent(
|
|
195
|
+
this.editor.commands.insertContent(Autolinker.link(info.insertedText));
|
|
197
196
|
}
|
|
198
197
|
},
|
|
199
198
|
markOffLink() {
|
|
200
|
-
this.editor
|
|
201
|
-
.chain()
|
|
202
|
-
.focus()
|
|
203
|
-
.extendMarkRange('link')
|
|
204
|
-
.unsetLink()
|
|
205
|
-
.run()
|
|
199
|
+
this.editor.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
206
200
|
},
|
|
207
201
|
|
|
208
202
|
hasSomeMarkUpActive() {
|
|
209
|
-
const textEditorContent = this.editor.getJSON().content
|
|
210
|
-
const textEditorMarkUps = this.markUps.map((markUp) => markUp.name)
|
|
203
|
+
const textEditorContent = this.editor.getJSON().content;
|
|
204
|
+
const textEditorMarkUps = this.markUps.map((markUp) => markUp.name);
|
|
211
205
|
|
|
212
|
-
const textNodesActive = textEditorContent.map((node) => node.type)
|
|
206
|
+
const textNodesActive = textEditorContent.map((node) => node.type);
|
|
213
207
|
|
|
214
208
|
const hasSomeNode = textNodesActive.some((node) =>
|
|
215
209
|
textEditorMarkUps.includes(node)
|
|
216
|
-
)
|
|
210
|
+
);
|
|
217
211
|
const hasSomeMark = textEditorContent.some((node) => {
|
|
218
|
-
if (node.hasOwnProperty(
|
|
219
|
-
return node.content.some((content) =>
|
|
212
|
+
if (node.hasOwnProperty("content")) {
|
|
213
|
+
return node.content.some((content) =>
|
|
214
|
+
content.hasOwnProperty("marks")
|
|
215
|
+
);
|
|
220
216
|
}
|
|
221
|
-
})
|
|
217
|
+
});
|
|
222
218
|
|
|
223
|
-
return hasSomeNode || hasSomeMark
|
|
219
|
+
return hasSomeNode || hasSomeMark;
|
|
224
220
|
},
|
|
225
221
|
|
|
226
222
|
addSpaceToFinalParagraphTag(text) {
|
|
227
|
-
return text.replace(/<\/p>/g,
|
|
223
|
+
return text.replace(/<\/p>/g, " </p>");
|
|
228
224
|
},
|
|
229
225
|
},
|
|
230
226
|
|
|
231
227
|
computed: {
|
|
232
228
|
previousURL() {
|
|
233
|
-
return this.editor.getAttributes(
|
|
229
|
+
return this.editor.getAttributes("link").href;
|
|
234
230
|
},
|
|
235
231
|
showFloatingLink() {
|
|
236
|
-
return this.editor.isActive(
|
|
232
|
+
return this.editor.isActive("link");
|
|
237
233
|
},
|
|
238
234
|
finalText() {
|
|
239
|
-
const textEditorHTML = this.editor.getHTML()
|
|
240
|
-
const textEditorHTMLSpaced =
|
|
241
|
-
|
|
235
|
+
const textEditorHTML = this.editor.getHTML();
|
|
236
|
+
const textEditorHTMLSpaced =
|
|
237
|
+
this.addSpaceToFinalParagraphTag(textEditorHTML);
|
|
238
|
+
const textEditorHTMLWithLinks = Autolinker.link(textEditorHTMLSpaced);
|
|
242
239
|
|
|
243
240
|
return DOMPurify.sanitize(removeEmptyTags(textEditorHTMLWithLinks), {
|
|
244
|
-
ADD_ATTR: [
|
|
245
|
-
})
|
|
241
|
+
ADD_ATTR: ["target"],
|
|
242
|
+
});
|
|
246
243
|
},
|
|
247
244
|
currentTextSelection() {
|
|
248
|
-
const { view, state } = this.editor
|
|
249
|
-
const { from, to } = view.state.selection
|
|
250
|
-
return state.doc.textBetween(from, to,
|
|
245
|
+
const { view, state } = this.editor;
|
|
246
|
+
const { from, to } = view.state.selection;
|
|
247
|
+
return state.doc.textBetween(from, to, "");
|
|
251
248
|
},
|
|
252
249
|
arrowXPosition() {
|
|
253
|
-
const arrowWidth = 16.8 //px
|
|
254
|
-
const buttonLink = this.$refs.link[0].$el
|
|
250
|
+
const arrowWidth = 16.8; //px
|
|
251
|
+
const buttonLink = this.$refs.link[0].$el;
|
|
255
252
|
|
|
256
253
|
//formula to position the arrow based on the button link position
|
|
257
254
|
const arrowLeftOffset =
|
|
258
|
-
buttonLink.offsetLeft + (buttonLink.offsetWidth - arrowWidth) / 2
|
|
259
|
-
return { left: `${arrowLeftOffset}px` }
|
|
255
|
+
buttonLink.offsetLeft + (buttonLink.offsetWidth - arrowWidth) / 2;
|
|
256
|
+
return { left: `${arrowLeftOffset}px` };
|
|
260
257
|
},
|
|
261
258
|
linkBoxPosition() {
|
|
262
|
-
const linkBoxWidth = 456 //px
|
|
263
|
-
const textEditorWidth = this.$refs.texteditor.$el.offsetWidth
|
|
264
|
-
const buttonLink = this.$refs.link[0].$el
|
|
265
|
-
let linkBoxLeftOffset
|
|
266
|
-
const overflowLimit = 500
|
|
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;
|
|
267
264
|
|
|
268
265
|
if (textEditorWidth > overflowLimit) {
|
|
269
266
|
//formula to position the link box based on the screen width
|
|
270
|
-
linkBoxLeftOffset = `${
|
|
271
|
-
buttonLink.offsetWidth / 2 -
|
|
272
|
-
|
|
267
|
+
linkBoxLeftOffset = `${
|
|
268
|
+
buttonLink.offsetLeft + buttonLink.offsetWidth / 2 - linkBoxWidth / 2
|
|
269
|
+
}px`;
|
|
273
270
|
} else {
|
|
274
|
-
linkBoxLeftOffset =
|
|
271
|
+
linkBoxLeftOffset = "1rem";
|
|
275
272
|
}
|
|
276
|
-
return { left: linkBoxLeftOffset }
|
|
273
|
+
return { left: linkBoxLeftOffset };
|
|
277
274
|
},
|
|
278
275
|
},
|
|
279
276
|
|
|
@@ -299,23 +296,23 @@ export default {
|
|
|
299
296
|
content: this.value,
|
|
300
297
|
autofocus: false,
|
|
301
298
|
onUpdate: () => {
|
|
302
|
-
this.$emit(
|
|
303
|
-
this.$emit(
|
|
299
|
+
this.$emit("input", this.finalText);
|
|
300
|
+
this.$emit("useMarkUp", this.hasSomeMarkUpActive());
|
|
304
301
|
},
|
|
305
302
|
onFocus: () => {
|
|
306
|
-
this.isEditorFocused = true
|
|
307
|
-
this.$emit(
|
|
303
|
+
this.isEditorFocused = true;
|
|
304
|
+
this.$emit("focus", true);
|
|
308
305
|
},
|
|
309
306
|
onBlur: () => {
|
|
310
|
-
this.isEditorFocused = false
|
|
307
|
+
this.isEditorFocused = false;
|
|
311
308
|
},
|
|
312
|
-
})
|
|
309
|
+
});
|
|
313
310
|
},
|
|
314
311
|
|
|
315
312
|
beforeDestroy() {
|
|
316
|
-
this.editor.destroy()
|
|
313
|
+
this.editor.destroy();
|
|
317
314
|
},
|
|
318
|
-
}
|
|
315
|
+
};
|
|
319
316
|
</script>
|
|
320
317
|
|
|
321
318
|
<style scoped>
|
package/src/main.js
CHANGED
|
@@ -1,80 +1,92 @@
|
|
|
1
|
-
import lang from
|
|
2
|
-
import locale from
|
|
3
|
-
import
|
|
4
|
-
import dayjs from
|
|
5
|
-
import localizedFormatPlugin from
|
|
1
|
+
import lang from "element-ui/lib/locale/lang/pt-br";
|
|
2
|
+
import locale from "element-ui/lib/locale";
|
|
3
|
+
import "dayjs/locale/pt-br";
|
|
4
|
+
import dayjs from "dayjs";
|
|
5
|
+
import localizedFormatPlugin from "dayjs/plugin/localizedFormat";
|
|
6
6
|
|
|
7
|
-
import
|
|
8
|
-
import Colors from
|
|
9
|
-
import Icons from
|
|
10
|
-
import Schemas from
|
|
11
|
-
import Notification from
|
|
12
|
-
import FieldTypeComponents from
|
|
13
|
-
import RegisterElementUIComponents from
|
|
7
|
+
import "./style/main.scss";
|
|
8
|
+
import Colors from "./helpers/Colors";
|
|
9
|
+
import Icons from "./helpers/Icons";
|
|
10
|
+
import Schemas from "./helpers/Schemas";
|
|
11
|
+
import Notification from "./helpers/Notification";
|
|
12
|
+
import FieldTypeComponents from "./helpers/FieldTypeComponents";
|
|
13
|
+
import RegisterElementUIComponents from "./helpers/RegisterElementUIComponents";
|
|
14
14
|
|
|
15
15
|
// Vant
|
|
16
|
-
import Vant from
|
|
17
|
-
import
|
|
16
|
+
import Vant from "vant";
|
|
17
|
+
import "vant/lib/index.css";
|
|
18
18
|
// Zoomer
|
|
19
|
-
import VueZoomer from
|
|
19
|
+
import VueZoomer from "vue-zoomer";
|
|
20
20
|
|
|
21
|
-
const LayersDesignSystem = {}
|
|
22
|
-
LayersDesignSystem.install = function(Vue) {
|
|
23
|
-
Vue.prototype.$L = {}
|
|
21
|
+
const LayersDesignSystem = {};
|
|
22
|
+
LayersDesignSystem.install = function (Vue) {
|
|
23
|
+
Vue.prototype.$L = {};
|
|
24
24
|
|
|
25
|
-
Vue.use(Vant)
|
|
26
|
-
Vue.use(VueZoomer)
|
|
27
|
-
Vue.use(Colors)
|
|
28
|
-
Vue.use(Icons)
|
|
29
|
-
Vue.use(Schemas)
|
|
30
|
-
Vue.use(FieldTypeComponents)
|
|
31
|
-
Vue.use(RegisterElementUIComponents)
|
|
25
|
+
Vue.use(Vant);
|
|
26
|
+
Vue.use(VueZoomer);
|
|
27
|
+
Vue.use(Colors);
|
|
28
|
+
Vue.use(Icons);
|
|
29
|
+
Vue.use(Schemas);
|
|
30
|
+
Vue.use(FieldTypeComponents);
|
|
31
|
+
Vue.use(RegisterElementUIComponents);
|
|
32
32
|
|
|
33
|
-
locale.use(lang)
|
|
34
|
-
dayjs.extend(localizedFormatPlugin)
|
|
33
|
+
locale.use(lang);
|
|
34
|
+
dayjs.extend(localizedFormatPlugin);
|
|
35
35
|
|
|
36
36
|
Vue.mixin({
|
|
37
37
|
mounted() {
|
|
38
|
-
this.__layers_addClassName()
|
|
38
|
+
this.__layers_addClassName();
|
|
39
39
|
},
|
|
40
40
|
updated() {
|
|
41
|
-
this.__layers_addClassName()
|
|
41
|
+
this.__layers_addClassName();
|
|
42
42
|
},
|
|
43
43
|
methods: {
|
|
44
44
|
__layers_addClassName() {
|
|
45
45
|
if (!this.__layers_addedClassName) {
|
|
46
|
-
const tagName = this.$options.tagName ||
|
|
46
|
+
const tagName = this.$options.tagName || "";
|
|
47
47
|
if (/^l-/.test(tagName) && this.$el.classList) {
|
|
48
|
-
this.$el.classList.add(tagName)
|
|
48
|
+
this.$el.classList.add(tagName);
|
|
49
49
|
}
|
|
50
|
-
// this.__layers_addedClassName = true
|
|
51
50
|
}
|
|
52
51
|
},
|
|
53
52
|
},
|
|
54
|
-
})
|
|
53
|
+
});
|
|
55
54
|
|
|
56
|
-
Vue.prototype.$notify = function(params) {
|
|
57
|
-
const isClickable = params.onClick && params.onClick instanceof Function
|
|
55
|
+
Vue.prototype.$notify = function (params) {
|
|
56
|
+
const isClickable = params.onClick && params.onClick instanceof Function;
|
|
58
57
|
const customClasses = [
|
|
59
58
|
params.customClass,
|
|
60
59
|
params.type,
|
|
61
|
-
!params.customClass && !params.type &&
|
|
62
|
-
isClickable &&
|
|
63
|
-
]
|
|
60
|
+
!params.customClass && !params.type && "default",
|
|
61
|
+
isClickable && "cursor-pointer",
|
|
62
|
+
];
|
|
64
63
|
|
|
65
64
|
return Notification({
|
|
66
65
|
...params,
|
|
67
|
-
customClass: customClasses.filter((customClass) => customClass).join(
|
|
68
|
-
})
|
|
69
|
-
}
|
|
66
|
+
customClass: customClasses.filter((customClass) => customClass).join(" "),
|
|
67
|
+
});
|
|
68
|
+
};
|
|
70
69
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
70
|
+
if (typeof require !== "undefined") {
|
|
71
|
+
const requireComponent = require.context(
|
|
72
|
+
"./components",
|
|
73
|
+
true,
|
|
74
|
+
/index.vue$/
|
|
75
|
+
);
|
|
76
|
+
requireComponent.keys().forEach((path) => {
|
|
77
|
+
const component = requireComponent(path).default;
|
|
78
|
+
if (!component.tagName) throw new Error(`Missing tagName for ${path}`);
|
|
79
|
+
Vue.component(component.tagName, component);
|
|
80
|
+
});
|
|
81
|
+
} else {
|
|
82
|
+
const components = import.meta.glob("./components/**/index.vue", {
|
|
83
|
+
eager: true,
|
|
84
|
+
});
|
|
85
|
+
for (const componentModule of Object.values(components)) {
|
|
86
|
+
Vue.component(componentModule.default.tagName, componentModule.default);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
78
90
|
|
|
79
|
-
export { Notification }
|
|
80
|
-
export default LayersDesignSystem
|
|
91
|
+
export { Notification };
|
|
92
|
+
export default LayersDesignSystem;
|