@avakhula/ui 0.0.505 → 0.0.510-alpha-spa.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.
- package/.babelrc.json +0 -0
- package/.eslintrc.cjs +0 -0
- package/.nvmrc +0 -0
- package/.storybook/main.js +0 -0
- package/.storybook/preview-head.html +0 -0
- package/.storybook/preview.js +0 -0
- package/dist/index.css +1 -0
- package/dist/index.es.js +22382 -0
- package/dist/index.umd.js +238 -0
- package/package.json +11 -10
- package/src/App.vue +16 -127
- package/src/assets/scss/mixins/dropdown-list-item.scss +9 -4
- package/src/assets/scss/mixins/tooltip-position.scss +7 -0
- package/src/assets/scss/mixins.scss +2 -2
- package/src/assets/scss/style.scss +4 -4
- package/src/assets/scss/typography.scss +3 -3
- package/src/assets/scss/variables/colors.json +0 -0
- package/src/assets/scss/variables/colors.scss +0 -0
- package/src/assets/scss/variables/shadows.json +0 -0
- package/src/assets/scss/variables/shadows.scss +0 -0
- package/src/components/Accordion/Accordion.scss +3 -3
- package/src/components/Accordion/Accordion.stories.js +0 -0
- package/src/components/Accordion/Accordion.vue +2 -2
- package/src/components/Accordion/Acordion.spec.js +0 -0
- package/src/components/Accordion/readme.mdx +0 -0
- package/src/components/Alert/Alert.spec.js +0 -0
- package/src/components/Alert/Alert.stories.js +0 -0
- package/src/components/Alert/Alert.vue +6 -1
- package/src/components/Alert/alert.scss +8 -3
- package/src/components/Alert/constants.js +0 -0
- package/src/components/Alert/readme.mdx +0 -0
- package/src/components/Avatar/Avatar.stories.js +5 -1
- package/src/components/Avatar/Avatar.vue +27 -4
- package/src/components/Avatar/constants.js +6 -0
- package/src/components/Badge/Badge.spec.js +0 -0
- package/src/components/Badge/Badge.vue +2 -2
- package/src/components/Badge/readme.mdx +0 -0
- package/src/components/Breadcrumbs/Breadcrumbs.vue +24 -9
- package/src/components/Breadcrumbs/breadcrumbs.scss +5 -5
- package/src/components/Breadcrumbs/breadcrumbs.stories.js +0 -0
- package/src/components/Button/Button.spec.js +0 -0
- package/src/components/Button/Button.vue +20 -4
- package/src/components/Button/button.scss +8 -3
- package/src/components/Button/readme.mdx +0 -0
- package/src/components/ButtonGroup/ButtonGroup.stories.js +0 -0
- package/src/components/ButtonGroup/readme.mdx +0 -0
- package/src/components/Chips/Chips.stories.js +30 -0
- package/src/components/Chips/Chips.vue +125 -0
- package/src/components/Dropdown/Dropdown.spec.js +0 -0
- package/src/components/Dropdown/Dropdown.stories.js +0 -0
- package/src/components/Dropdown/Dropdown.vue +3 -3
- package/src/components/Dropdown/DropdownDivider.vue +1 -1
- package/src/components/Dropdown/DropdownItem.vue +27 -5
- package/src/components/Dropdown/DropdownList.stories.js +0 -0
- package/src/components/Dropdown/DropdownList.vue +6 -2
- package/src/components/Dropdown/readme.mdx +0 -0
- package/src/components/Form/CharactersCount.vue +12 -9
- package/src/components/Form/Checkbox/Checkbox.scss +4 -4
- package/src/components/Form/Checkbox/Checkbox.stories.js +0 -0
- package/src/components/Form/Checkbox/Checkbox.vue +25 -12
- package/src/components/Form/Checkbox/readme.mdx +0 -0
- package/src/components/Form/CheckboxGroup/CheckboxGroup.stories.js +0 -0
- package/src/components/Form/CheckboxGroup/CheckboxGroup.vue +15 -0
- package/src/components/Form/CheckboxGroup/readme.mdx +2 -0
- package/src/components/Form/DatePicker/DatePicker.scss +356 -265
- package/src/components/Form/DatePicker/DatePicker.stories.js +0 -0
- package/src/components/Form/DatePicker/DatePicker.vue +73 -18
- package/src/components/Form/DatePicker/readme.mdx +0 -0
- package/src/components/Form/FormGroup/FormGroup.vue +5 -5
- package/src/components/Form/FormGroup/FormGroupSet.vue +1 -1
- package/src/components/Form/Input/Input.stories.js +0 -0
- package/src/components/Form/Input/Input.vue +120 -14
- package/src/components/Form/Input/constants.js +0 -0
- package/src/components/Form/Input/input.scss +64 -5
- package/src/components/Form/Input/readme.mdx +0 -0
- package/src/components/Form/Label/Label.stories.js +0 -0
- package/src/components/Form/Label/Label.vue +24 -12
- package/src/components/Form/Label/readme.mdx +0 -0
- package/src/components/Form/PhoneInput/PhoneInput.stories.js +0 -0
- package/src/components/Form/PhoneInput/PhoneInput.vue +77 -28
- package/src/components/Form/PhoneInput/phoneInput.scss +42 -10
- package/src/components/Form/PhoneInput/readme.mdx +0 -0
- package/src/components/Form/Radio/Radio.stories.js +0 -0
- package/src/components/Form/Radio/Radio.vue +17 -45
- package/src/components/Form/Radio/radio.scss +8 -5
- package/src/components/Form/Radio/readme.mdx +0 -0
- package/src/components/Form/TextEditor/TextEditor.stories.js +0 -0
- package/src/components/Form/TextEditor/TextEditor.vue +92 -138
- package/src/components/Form/TextEditor/Toolbar.vue +723 -0
- package/src/components/Form/TextEditor/icons/toolbarIcons.js +8 -0
- package/src/components/Form/TextEditor/plugins/imageBlot.js +23 -0
- package/src/components/Form/TextEditor/readme.mdx +0 -0
- package/src/components/Form/TextEditor/setupTextEditor.js +71 -0
- package/src/components/Form/TextEditor/textEditor.scss +15 -339
- package/src/components/Form/Textarea/Textarea.spec.js +0 -0
- package/src/components/Form/Textarea/Textarea.stories.js +0 -0
- package/src/components/Form/Textarea/Textarea.vue +28 -10
- package/src/components/Form/Textarea/readme.mdx +0 -0
- package/src/components/Form/Textarea/textarea.scss +33 -5
- package/src/components/Form/Toggle/Toggle.stories.js +0 -0
- package/src/components/Form/Toggle/Toggle.vue +1 -1
- package/src/components/Form/Toggle/readme.mdx +0 -0
- package/src/components/Form/Toggle/toggle.scss +3 -3
- package/src/components/IconButton/IconButton.scss +13 -2
- package/src/components/IconButton/IconButton.vue +11 -4
- package/src/components/IconButton/readme.mdx +0 -0
- package/src/components/List.vue +1 -1
- package/src/components/Modal/Modal.stories.js +0 -0
- package/src/components/Modal/Modal.vue +109 -40
- package/src/components/Modal/constants.js +0 -0
- package/src/components/Modal/readme.mdx +0 -0
- package/src/components/Pagination/LimitSelector.vue +5 -0
- package/src/components/Pagination/Pagination.vue +37 -5
- package/src/components/Pagination/pagination.scss +20 -4
- package/src/components/Panel/Panel.stories.js +0 -0
- package/src/components/Panel/Panel.vue +72 -6
- package/src/components/Popover/Popover.vue +27 -10
- package/src/components/Popover/constants.js +0 -0
- package/src/components/Popover/popover.scss +4 -4
- package/src/components/Popover/readme.mdx +0 -0
- package/src/components/ProgressBar/ProgressBar.vue +1 -1
- package/src/components/ProgressBar/constants.js +0 -0
- package/src/components/ProgressBar/progressBar.scss +1 -1
- package/src/components/ProgressBar/readme.mdx +0 -0
- package/src/components/Sorting/Sorting.stories.js +0 -0
- package/src/components/Sorting/Sorting.vue +25 -27
- package/src/components/Sorting/sorting.scss +5 -5
- package/src/components/SplitButton/SplitButton.stories.js +0 -0
- package/src/components/SplitButton/SplitButton.vue +52 -9
- package/src/components/SplitButton/SplitButtonItem.vue +14 -2
- package/src/components/SplitButton/readme.mdx +0 -0
- package/src/components/SplitButton/splitButton.scss +3 -3
- package/src/components/StatusIndicator/StatusIndicator.stories.js +0 -0
- package/src/components/StatusIndicator/StatusIndicator.vue +2 -2
- package/src/components/StatusIndicator/constants.js +0 -0
- package/src/components/StatusIndicator/icons.js +0 -0
- package/src/components/StatusIndicator/readme.mdx +0 -0
- package/src/components/Table/Cells/Cell.vue +2 -2
- package/src/components/Table/Cells/CheckboxCell.vue +0 -0
- package/src/components/Table/Row.vue +1 -1
- package/src/components/Table/Table.stories.js +0 -0
- package/src/components/Table/Table.vue +0 -0
- package/src/components/Tabs/Tab.vue +4 -0
- package/src/components/Tabs/TabDropdown.vue +1 -1
- package/src/components/Tabs/Tabs.stories.js +0 -0
- package/src/components/Tabs/Tabs.vue +21 -6
- package/src/components/Tabs/tabs.scss +12 -6
- package/src/components/TagPill/TagPill.stories.js +0 -0
- package/src/components/TagPill/TagPill.vue +8 -2
- package/src/components/TagPill/readme.mdx +0 -0
- package/src/components/ToggleTip/ToggleTip.vue +1 -1
- package/src/components/ToggleTip/constants.js +0 -0
- package/src/components/ToggleTip/readme.mdx +0 -0
- package/src/components/ToggleTip/toggleTip.scss +5 -5
- package/src/components/Tooltip/Tooltip.vue +4 -4
- package/src/components/Tooltip/readme.mdx +0 -0
- package/src/components/TreeSelect/Option.vue +59 -25
- package/src/components/TreeSelect/Select.stories.js +0 -0
- package/src/components/TreeSelect/Select.vue +283 -148
- package/src/components/TreeSelect/TreeSelect.stories.js +0 -0
- package/src/components/TreeSelect/mixins/InfinityLoaderMixin.js +40 -0
- package/src/components/TreeSelect/scss/option.scss +37 -6
- package/src/components/TreeSelect/scss/select.scss +97 -6
- package/src/constants/keyCodes.js +1 -0
- package/src/directives/outside/outside.stories.js +0 -0
- package/src/directives/outside/readme.mdx +0 -0
- package/src/directives/tooltip/TooltipController.js +2 -0
- package/src/directives/tooltip/readme.mdx +0 -0
- package/src/directives/tooltip/textOverflowTooltip.js +3 -1
- package/src/directives/tooltip/tooltip.js +61 -0
- package/src/directives/tooltip/tooltip.stories.js +0 -0
- package/src/helpers/debounce.js +23 -0
- package/src/helpers/removeEvents.js +0 -0
- package/src/helpers/stripHtml.js +4 -0
- package/src/index.js +7 -0
- package/src/main.js +0 -0
- package/src/mixins/expandAnimation.js +0 -0
- package/src/scripts/parseScssVariables.js +0 -0
- package/src/stories/link.readme.mdx +0 -0
- package/src/stories/variables/colors.stories.js +0 -0
- package/src/stories/variables/shadows.stories.js +0 -0
- package/static/docks/button.pdf +0 -0
- package/static/favicon.ico +0 -0
- package/vite.config.js +3 -9
- package/dist/index.js +0 -20786
- package/dist/index.umd.cjs +0 -227
- package/dist/style.css +0 -1
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
disable: disable,
|
|
8
8
|
}"
|
|
9
9
|
>
|
|
10
|
+
|
|
10
11
|
<ib-character-count
|
|
11
12
|
v-if="characterLimit"
|
|
12
13
|
:character-limit="characterLimit"
|
|
@@ -23,170 +24,72 @@
|
|
|
23
24
|
{{ characterLimitErrorMessage }}
|
|
24
25
|
</ib-alert>
|
|
25
26
|
|
|
27
|
+
<input :name="name" type="hidden" :disabled="disable" :value="data">
|
|
28
|
+
|
|
26
29
|
<div class="ib-text-editor-wrapper" :class="{ disable: disable }">
|
|
27
30
|
<div
|
|
28
31
|
class="ib-text-editor"
|
|
29
|
-
:style="{ height: height ? height + 'px' : '' }"
|
|
30
32
|
ref="wrapper"
|
|
31
33
|
>
|
|
32
34
|
<QuillEditor
|
|
35
|
+
aria-label="text-editor"
|
|
33
36
|
@textChange="onChange"
|
|
34
37
|
@blur="onBlur"
|
|
35
38
|
@focus="onFocus"
|
|
36
39
|
ref="quill"
|
|
37
|
-
toolbar="#toolbar"
|
|
38
40
|
v-model:content="data"
|
|
39
41
|
contentType="html"
|
|
40
42
|
:options="config"
|
|
41
43
|
:modules="modules"
|
|
42
44
|
></QuillEditor>
|
|
43
45
|
</div>
|
|
44
|
-
<div id="toolbar" class="toolbar" ref="toolbar">
|
|
45
|
-
<div class="toolbar-group header-toolbar-group">
|
|
46
|
-
<select class="ql-header">
|
|
47
|
-
<option value="1"></option>
|
|
48
|
-
<option value="2"></option>
|
|
49
|
-
<option value="3"></option>
|
|
50
|
-
<option value="4"></option>
|
|
51
|
-
<option value="5"></option>
|
|
52
|
-
<option value="6"></option>
|
|
53
|
-
<option selected></option>
|
|
54
|
-
</select>
|
|
55
|
-
</div>
|
|
56
|
-
|
|
57
|
-
<div class="toolbar-group">
|
|
58
|
-
<ib-icon-button
|
|
59
|
-
class="toolbar-item ql-bold"
|
|
60
|
-
kind="ghost"
|
|
61
|
-
></ib-icon-button>
|
|
62
|
-
<ib-icon-button
|
|
63
|
-
class="toolbar-item ql-italic"
|
|
64
|
-
kind="ghost"
|
|
65
|
-
></ib-icon-button>
|
|
66
|
-
<ib-icon-button
|
|
67
|
-
class="toolbar-item ql-underline"
|
|
68
|
-
kind="ghost"
|
|
69
|
-
></ib-icon-button>
|
|
70
|
-
<ib-icon-button
|
|
71
|
-
class="toolbar-item ql-strike"
|
|
72
|
-
kind="ghost"
|
|
73
|
-
></ib-icon-button>
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
<div class="toolbar-group">
|
|
77
|
-
<select class="ql-background"></select>
|
|
78
|
-
<select class="ql-color"></select>
|
|
79
|
-
</div>
|
|
80
|
-
|
|
81
|
-
<div class="toolbar-group">
|
|
82
|
-
<ib-icon-button
|
|
83
|
-
class="toolbar-item ql-code-block"
|
|
84
|
-
kind="ghost"
|
|
85
|
-
></ib-icon-button>
|
|
86
|
-
<ib-icon-button
|
|
87
|
-
class="toolbar-item ql-link"
|
|
88
|
-
kind="ghost"
|
|
89
|
-
></ib-icon-button>
|
|
90
|
-
</div>
|
|
91
|
-
|
|
92
|
-
<div class="toolbar-group">
|
|
93
|
-
<ib-icon-button
|
|
94
|
-
class="toolbar-item ql-align"
|
|
95
|
-
kind="ghost"
|
|
96
|
-
></ib-icon-button>
|
|
97
|
-
<ib-icon-button
|
|
98
|
-
class="ql-align toolbar-item"
|
|
99
|
-
value="center"
|
|
100
|
-
kind="ghost"
|
|
101
|
-
></ib-icon-button>
|
|
102
|
-
<ib-icon-button
|
|
103
|
-
class="ql-align toolbar-item"
|
|
104
|
-
value="right"
|
|
105
|
-
kind="ghost"
|
|
106
|
-
></ib-icon-button>
|
|
107
|
-
<ib-icon-button
|
|
108
|
-
class="ql-align toolbar-item"
|
|
109
|
-
value="justify"
|
|
110
|
-
kind="ghost"
|
|
111
|
-
></ib-icon-button>
|
|
112
|
-
</div>
|
|
113
|
-
|
|
114
|
-
<div class="toolbar-group">
|
|
115
|
-
<ib-icon-button
|
|
116
|
-
class="ql-list toolbar-item"
|
|
117
|
-
value="ordered"
|
|
118
|
-
kind="ghost"
|
|
119
|
-
></ib-icon-button>
|
|
120
|
-
<ib-icon-button
|
|
121
|
-
class="ql-list toolbar-item"
|
|
122
|
-
value="bullet"
|
|
123
|
-
kind="ghost"
|
|
124
|
-
></ib-icon-button>
|
|
125
46
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
47
|
+
<Toolbar
|
|
48
|
+
id="toolbar"
|
|
49
|
+
class="toolbar"
|
|
50
|
+
ref="toolbar"
|
|
51
|
+
:placeholders="placeholders"
|
|
52
|
+
:uid="uid"
|
|
53
|
+
:hidden-elements="hiddenElements"
|
|
54
|
+
/>
|
|
132
55
|
</div>
|
|
133
56
|
</div>
|
|
134
57
|
</template>
|
|
135
58
|
|
|
136
59
|
<script>
|
|
137
|
-
|
|
60
|
+
|
|
61
|
+
import {Quill, QuillEditor} from "@vueup/vue-quill";
|
|
138
62
|
import IbIconButton from "../../IconButton/IconButton.vue";
|
|
139
63
|
import IbAlert from "../../Alert/Alert.vue";
|
|
140
64
|
import IbCharacterCount from "../CharactersCount.vue";
|
|
141
|
-
import
|
|
65
|
+
import Toolbar from "./Toolbar.vue";
|
|
66
|
+
import { stripHtml } from "../../../helpers/stripHtml";
|
|
67
|
+
import getPlaceholderModule from 'quill-placeholder-module';
|
|
142
68
|
import "@vueup/vue-quill/dist/vue-quill.snow.css";
|
|
69
|
+
import { setupTextEditor } from "./setupTextEditor";
|
|
143
70
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
UNDERLINE,
|
|
148
|
-
STRIKE,
|
|
149
|
-
CODE,
|
|
150
|
-
LINK,
|
|
151
|
-
ALIGN_LEFT,
|
|
152
|
-
ALIGN_CENTER,
|
|
153
|
-
ALIGN_RIGHT,
|
|
154
|
-
ALIGN_JUSTIFY,
|
|
155
|
-
LIST_ORDERED,
|
|
156
|
-
LIST_BULLET,
|
|
157
|
-
LIST_ALPHABET,
|
|
158
|
-
} from "./icons/toolbarIcons";
|
|
159
|
-
|
|
160
|
-
const icons = Quill.import("ui/icons");
|
|
161
|
-
icons.bold = BOLD;
|
|
162
|
-
icons.italic = ITALIC;
|
|
163
|
-
icons.underline = UNDERLINE;
|
|
164
|
-
icons.strike = STRIKE;
|
|
165
|
-
icons["code-block"] = CODE;
|
|
166
|
-
icons.link = LINK;
|
|
167
|
-
icons.align[""] = ALIGN_LEFT;
|
|
168
|
-
icons.align.center = ALIGN_CENTER;
|
|
169
|
-
icons.align.right = ALIGN_RIGHT;
|
|
170
|
-
icons.align.justify = ALIGN_JUSTIFY;
|
|
171
|
-
icons.list.ordered = LIST_ORDERED;
|
|
172
|
-
icons.list.bullet = LIST_BULLET;
|
|
173
|
-
icons["alphabet-list"] = LIST_ALPHABET;
|
|
71
|
+
Quill.register('modules/placeholder', getPlaceholderModule(Quill, {
|
|
72
|
+
className: 'ql-placeholder-content'
|
|
73
|
+
}))
|
|
174
74
|
|
|
175
|
-
Quill.register({
|
|
176
|
-
"formats/alphabet-list": AlphabetList,
|
|
177
|
-
"formats/alphabet-list/item": AlphabetListItem,
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
Quill.register(icons);
|
|
181
75
|
Quill.debug("error");
|
|
76
|
+
setupTextEditor();
|
|
182
77
|
|
|
183
78
|
export default {
|
|
184
79
|
name: "IbTextEditor",
|
|
185
80
|
props: {
|
|
81
|
+
name: {
|
|
82
|
+
type: String,
|
|
83
|
+
required: true
|
|
84
|
+
},
|
|
186
85
|
placeholder: {
|
|
187
86
|
type: String,
|
|
188
87
|
default: "",
|
|
189
88
|
},
|
|
89
|
+
placeholders: {
|
|
90
|
+
type: Array,
|
|
91
|
+
default: () => []
|
|
92
|
+
},
|
|
190
93
|
modelValue: {
|
|
191
94
|
type: String,
|
|
192
95
|
},
|
|
@@ -230,14 +133,13 @@ export default {
|
|
|
230
133
|
type: String,
|
|
231
134
|
default: "",
|
|
232
135
|
},
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
136
|
+
hiddenElements: {
|
|
137
|
+
type: Array,
|
|
138
|
+
default: () => ['font-size', 'image']
|
|
139
|
+
}
|
|
236
140
|
},
|
|
141
|
+
emits: ['onOverLimitHandler', 'update:modelValue', 'change', 'blur'],
|
|
237
142
|
mounted() {
|
|
238
|
-
// Reset default styles for toolbar
|
|
239
|
-
this.$refs.toolbar.classList.remove("ql-toolbar");
|
|
240
|
-
|
|
241
143
|
// Change default placeholder for link input
|
|
242
144
|
const input = this.$refs.wrapper.querySelector("input[data-link]");
|
|
243
145
|
input.dataset.link = "Enter Link";
|
|
@@ -256,24 +158,61 @@ export default {
|
|
|
256
158
|
this.data = val;
|
|
257
159
|
},
|
|
258
160
|
data(val) {
|
|
259
|
-
this
|
|
161
|
+
const cleanedData = this.cleanPlaceholderSpans(val);
|
|
162
|
+
this.$emit("update:modelValue", cleanedData);
|
|
260
163
|
},
|
|
164
|
+
characterOverLimit(value) {
|
|
165
|
+
this.$emit('onOverLimitHandler', value);
|
|
166
|
+
}
|
|
261
167
|
},
|
|
262
168
|
methods: {
|
|
263
169
|
onChange() {
|
|
170
|
+
let data = this.cleanPlaceholderSpans(this.data);
|
|
171
|
+
this.data = this.patchListStylePosition(data);
|
|
172
|
+
|
|
264
173
|
this.updateCharacterLength();
|
|
265
174
|
this.$emit("change", this.data);
|
|
266
175
|
},
|
|
267
176
|
onBlur(instance) {
|
|
268
|
-
this.$emit("blur", this.data, instance);
|
|
177
|
+
this.$emit("blur", this.cleanPlaceholderSpans(this.data), instance);
|
|
269
178
|
this.isFocus = false;
|
|
270
179
|
},
|
|
271
180
|
onFocus() {
|
|
272
181
|
this.isFocus = true;
|
|
273
182
|
},
|
|
274
183
|
updateCharacterLength() {
|
|
275
|
-
this.characterLength = this
|
|
184
|
+
this.characterLength = stripHtml(this.data).length;
|
|
276
185
|
},
|
|
186
|
+
cleanPlaceholderSpans(html) {
|
|
187
|
+
if (!html) return html;
|
|
188
|
+
|
|
189
|
+
let prevHtml;
|
|
190
|
+
do {
|
|
191
|
+
prevHtml = html;
|
|
192
|
+
html = html.replace(/<span contenteditable="false">([\s\S]*?)<\/span>/g, (_, content) => {
|
|
193
|
+
return content.replace(/[\u200B-\u200F\uFEFF]/g, '');
|
|
194
|
+
});
|
|
195
|
+
} while (prevHtml !== html);
|
|
196
|
+
|
|
197
|
+
return html;
|
|
198
|
+
},
|
|
199
|
+
patchListStylePosition(html) {
|
|
200
|
+
const tmp = document.createElement('div');
|
|
201
|
+
tmp.innerHTML = html;
|
|
202
|
+
|
|
203
|
+
tmp.querySelectorAll('ul[style*="text-align"], ol[style*="text-align"], li[style*="text-align"]').forEach(el => {
|
|
204
|
+
const style = el.getAttribute('style') ?? '';
|
|
205
|
+
|
|
206
|
+
if (!/list-style-position\s*:\s*inside/i.test(style)) {
|
|
207
|
+
const newStyle =
|
|
208
|
+
(style.trim().endsWith(';') || style.trim() === '' ? style : style + ';') +
|
|
209
|
+
' list-style-position: inside;';
|
|
210
|
+
el.setAttribute('style', newStyle);
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
return tmp.innerHTML;
|
|
215
|
+
}
|
|
277
216
|
},
|
|
278
217
|
computed: {
|
|
279
218
|
config() {
|
|
@@ -281,6 +220,17 @@ export default {
|
|
|
281
220
|
placeholder: this.data.length ? "" : this.placeholder,
|
|
282
221
|
readOnly: this.readOnly ? this.readOnly : this.disable,
|
|
283
222
|
enable: this.enable,
|
|
223
|
+
modules: {
|
|
224
|
+
toolbar: {
|
|
225
|
+
container: '#toolbar',
|
|
226
|
+
handlers: { 'image': this.imageButtonClickHandler }
|
|
227
|
+
},
|
|
228
|
+
placeholder: {
|
|
229
|
+
delimiters: ['{{', '}}'],
|
|
230
|
+
placeholders: this.placeholders
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
|
|
284
234
|
};
|
|
285
235
|
|
|
286
236
|
return Object.assign(config, this.options);
|
|
@@ -290,16 +240,20 @@ export default {
|
|
|
290
240
|
!!this.characterLimit && this.characterLength > this.characterLimit
|
|
291
241
|
);
|
|
292
242
|
},
|
|
243
|
+
uid() {
|
|
244
|
+
return Math.random().toString(36).substr(2, 9);
|
|
245
|
+
},
|
|
293
246
|
},
|
|
294
247
|
components: {
|
|
295
248
|
QuillEditor,
|
|
296
249
|
IbIconButton,
|
|
297
250
|
IbAlert,
|
|
298
251
|
IbCharacterCount,
|
|
252
|
+
Toolbar,
|
|
299
253
|
},
|
|
300
254
|
};
|
|
301
255
|
</script>
|
|
302
256
|
|
|
303
|
-
<style lang="scss">
|
|
304
|
-
@
|
|
257
|
+
<style lang="scss" scoped>
|
|
258
|
+
@use "./textEditor.scss" as *;
|
|
305
259
|
</style>
|