@hulkapps/app-manager-vue 1.0.1 → 2.0.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/README.md +32 -0
- package/dist/app-manager-vue.esm.js +38978 -15111
- package/dist/app-manager-vue.min.js +9 -2
- package/dist/app-manager-vue.ssr.js +37401 -14919
- package/dist/hulkapps-app-manager.css +13284 -0
- package/dist/hulkapps-app-manager.min.css +1 -0
- package/package.json +9 -4
- package/src/components/Marketing/Banners.vue +44 -44
- package/src/components/Plans/AppManagerPlan.vue +492 -0
- package/src/components/Plans/PlanBanners.vue +50 -0
- package/src/components/Plans/YearlyPlanPromotion.vue +37 -0
- package/src/components/polaris-vue/src/components/PActionList/PActionList.vue +68 -0
- package/src/components/polaris-vue/src/components/PActionList/components/PActionListItem/PActionListItem.vue +91 -0
- package/src/components/polaris-vue/src/components/PActionList/components/PActionListSection/PActionListSection.vue +68 -0
- package/src/components/polaris-vue/src/components/PActionMenu/PActionMenu.vue +54 -0
- package/src/components/polaris-vue/src/components/PActionMenu/components/PActionMenuActions/PActionMenuActions.vue +197 -0
- package/src/components/polaris-vue/src/components/PActionMenu/components/PActionMenuMenuAction/PActionMenuMenuAction.vue +97 -0
- package/src/components/polaris-vue/src/components/PActionMenu/components/PActionMenuMenuGroup/PActionMenuMenuGroup.vue +54 -0
- package/src/components/polaris-vue/src/components/PActionMenu/components/PActionMenuRollupActions/PActionMenuRollupActions.vue +43 -0
- package/src/components/polaris-vue/src/components/PAvatar/PAvatar.vue +104 -0
- package/src/components/polaris-vue/src/components/PBadge/PBadge.vue +86 -0
- package/src/components/polaris-vue/src/components/PBanner/PBanner.vue +132 -0
- package/src/components/polaris-vue/src/components/PBreadcrumbs/PBreadcrumbs.vue +99 -0
- package/src/components/polaris-vue/src/components/PButton/PButton.vue +396 -0
- package/src/components/polaris-vue/src/components/PButton/components/PButtonsFrom/PButtonsFrom.vue +47 -0
- package/src/components/polaris-vue/src/components/PButton/components/PUnstyledButton/PUnstyledButton.vue +340 -0
- package/src/components/polaris-vue/src/components/PButtonGroup/PButtonGroup.vue +76 -0
- package/src/components/polaris-vue/src/components/PButtonGroup/components/PButtonGroupItem/PButtonGroupItem.vue +11 -0
- package/src/components/polaris-vue/src/components/PCaption/PCaption.vue +29 -0
- package/src/components/polaris-vue/src/components/PCard/PCard.vue +118 -0
- package/src/components/polaris-vue/src/components/PCard/components/PCardFooter/PCardFooter.vue +11 -0
- package/src/components/polaris-vue/src/components/PCard/components/PCardHeader/PCardHeader.vue +69 -0
- package/src/components/polaris-vue/src/components/PCard/components/PCardSection/PCardSection.vue +54 -0
- package/src/components/polaris-vue/src/components/PCard/components/PCardSubsection/PCardSubsection.vue +12 -0
- package/src/components/polaris-vue/src/components/PConnected/PConnected.vue +44 -0
- package/src/components/polaris-vue/src/components/PConnected/components/PConnectedItem/PConnectedItem.vue +41 -0
- package/src/components/polaris-vue/src/components/PDataTable/PDataTable.vue +541 -0
- package/src/components/polaris-vue/src/components/PDataTable/components/PDataTableCell/PDataTableCell.vue +213 -0
- package/src/components/polaris-vue/src/components/PDataTable/components/PDataTableCellNew/PDataTableCellNew.vue +162 -0
- package/src/components/polaris-vue/src/components/PDataTable/components/PDataTableCol/PDataTableCol.vue +75 -0
- package/src/components/polaris-vue/src/components/PDataTable/components/PDataTableRow/PDataTableRow.vue +15 -0
- package/src/components/polaris-vue/src/components/PDisplayText/PDisplayText.vue +56 -0
- package/src/components/polaris-vue/src/components/PEmptyState/PEmptyState.vue +154 -0
- package/src/components/polaris-vue/src/components/PFieldError/PFieldError.vue +41 -0
- package/src/components/polaris-vue/src/components/PFilter/PFilter.vue +252 -0
- package/src/components/polaris-vue/src/components/PFilter/components/PFilterItem/PFilterItem.vue +11 -0
- package/src/components/polaris-vue/src/components/PFilter/components/PFilterItemWrapper/PFilterItemWrapper.vue +32 -0
- package/src/components/polaris-vue/src/components/PHeading/PHeading.vue +33 -0
- package/src/components/polaris-vue/src/components/PIcon/PIcon.vue +121 -0
- package/src/components/polaris-vue/src/components/PIcon/ShopifyIcons.vue +217 -0
- package/src/components/polaris-vue/src/components/PImage/PImage.vue +49 -0
- package/src/components/polaris-vue/src/components/PLayout/PLayout.vue +42 -0
- package/src/components/polaris-vue/src/components/PLayout/components/PLayoutSection/PLayoutSection.vue +55 -0
- package/src/components/polaris-vue/src/components/PLink/PLink.vue +90 -0
- package/src/components/polaris-vue/src/components/POptionalTag/POptionalTag.vue +23 -0
- package/src/components/polaris-vue/src/components/PPage/PPage.vue +136 -0
- package/src/components/polaris-vue/src/components/PPage/components/PPageHeader/PPageHeader.vue +191 -0
- package/src/components/polaris-vue/src/components/PPage/components/PPageHeaderTitle/PPageHeaderTitle.vue +63 -0
- package/src/components/polaris-vue/src/components/PPagination/PPagination.vue +119 -0
- package/src/components/polaris-vue/src/components/PPopover/PPopover.vue +298 -0
- package/src/components/polaris-vue/src/components/PPopover/components/PPopoverOverlay/PPopoverOverlay.vue +66 -0
- package/src/components/polaris-vue/src/components/PPopover/components/PPositionedOverlay/PPositionedOverlay.vue +289 -0
- package/src/components/polaris-vue/src/components/PSpinner/PSpinner.vue +60 -0
- package/src/components/polaris-vue/src/components/PStack/PStack.vue +84 -0
- package/src/components/polaris-vue/src/components/PStack/components/PStackItem/PStackItem.vue +49 -0
- package/src/components/polaris-vue/src/components/PSubheading/PSubheading.vue +36 -0
- package/src/components/polaris-vue/src/components/PTag/PTag.vue +89 -0
- package/src/components/polaris-vue/src/components/PTextContainer/PTextContainer.vue +41 -0
- package/src/components/polaris-vue/src/components/PTextField/PTextField.vue +229 -0
- package/src/components/polaris-vue/src/components/PTextField/components/PFieldResizer/PFieldResizer.vue +79 -0
- package/src/components/polaris-vue/src/components/PTextField/components/PInput/PInput.vue +473 -0
- package/src/components/polaris-vue/src/components/PTextField/components/PSpinner/PSpinner.vue +47 -0
- package/src/components/polaris-vue/src/components/PTextStyle/PTextStyle.vue +60 -0
- package/src/components/polaris-vue/src/components/PThumbnail/PThumbnail.vue +71 -0
- package/src/components/polaris-vue/src/components/PToggle/PToggle.vue +81 -0
- package/src/components/polaris-vue/src/components/PUnstyledLink/PUnstyledLink.vue +67 -0
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="className" v-show="showInput">
|
|
3
|
+
<div class="Polaris-TextField__Prefix" :id="id+'Prefix'" v-if="showPrefix">
|
|
4
|
+
{{ prefix }}
|
|
5
|
+
<slot v-if="$slots.prefix" name="prefix"/>
|
|
6
|
+
</div>
|
|
7
|
+
<div style="width: 100%">
|
|
8
|
+
<quill-editor
|
|
9
|
+
v-if="richEditor"
|
|
10
|
+
:id="id"
|
|
11
|
+
class="editor"
|
|
12
|
+
ref="myTextEditor"
|
|
13
|
+
v-model="computedValue"
|
|
14
|
+
:options="editorConfig"
|
|
15
|
+
@input="onInput"
|
|
16
|
+
:disabled="disabled"
|
|
17
|
+
:readonly="readOnly"
|
|
18
|
+
:autofocus="autoFocus"
|
|
19
|
+
:placeholder="computedPlaceholder"
|
|
20
|
+
:autocomplete="normalizeAutoComplete(autoComplete)"
|
|
21
|
+
:aria-describedby="describedBy"
|
|
22
|
+
:aria-labelledby="labelledBy"
|
|
23
|
+
:aria-invalid="hasError"
|
|
24
|
+
/>
|
|
25
|
+
<textarea
|
|
26
|
+
v-else-if="multiline"
|
|
27
|
+
:name="name"
|
|
28
|
+
:class="inputClassName"
|
|
29
|
+
:id="id"
|
|
30
|
+
:disabled="disabled"
|
|
31
|
+
:readonly="readOnly"
|
|
32
|
+
:autofocus="autoFocus"
|
|
33
|
+
:value="computedValue"
|
|
34
|
+
:minlength="minLength"
|
|
35
|
+
:maxlength="maxLength"
|
|
36
|
+
v-text="multiline?computedValue:''"
|
|
37
|
+
:placeholder="computedPlaceholder"
|
|
38
|
+
:autocomplete="normalizeAutoComplete(autoComplete)"
|
|
39
|
+
:style="computedStyle"
|
|
40
|
+
:aria-describedby="describedBy"
|
|
41
|
+
:aria-labelledby="labelledBy"
|
|
42
|
+
:aria-invalid="hasError"
|
|
43
|
+
@input="onInput"
|
|
44
|
+
/>
|
|
45
|
+
<input
|
|
46
|
+
v-else-if="type === 'file'"
|
|
47
|
+
ref="input"
|
|
48
|
+
:name="name"
|
|
49
|
+
:class="inputClassName"
|
|
50
|
+
:id="id"
|
|
51
|
+
:disabled="disabled"
|
|
52
|
+
:readonly="readOnly"
|
|
53
|
+
type="file"
|
|
54
|
+
:multiple="multiple"
|
|
55
|
+
:accept="accept"
|
|
56
|
+
:aria-describedby="describedBy"
|
|
57
|
+
:aria-labelledby="labelledBy"
|
|
58
|
+
:aria-invalid="hasError"
|
|
59
|
+
@change="onInput"
|
|
60
|
+
/>
|
|
61
|
+
<input
|
|
62
|
+
v-else
|
|
63
|
+
ref="input"
|
|
64
|
+
:name="name"
|
|
65
|
+
:class="inputClassName"
|
|
66
|
+
:id="id"
|
|
67
|
+
:disabled="disabled"
|
|
68
|
+
:readonly="readOnly"
|
|
69
|
+
:autofocus="autoFocus"
|
|
70
|
+
:value="computedValue"
|
|
71
|
+
:placeholder="computedPlaceholder"
|
|
72
|
+
:autocomplete="normalizeAutoComplete(autoComplete)"
|
|
73
|
+
:min="min"
|
|
74
|
+
:max="max"
|
|
75
|
+
:step="step"
|
|
76
|
+
:minlength="minLength"
|
|
77
|
+
:maxlength="maxLength"
|
|
78
|
+
:type="inputType"
|
|
79
|
+
:aria-describedby="describedBy"
|
|
80
|
+
:aria-labelledby="labelledBy"
|
|
81
|
+
:aria-invalid="hasError"
|
|
82
|
+
@input="onInput"
|
|
83
|
+
/>
|
|
84
|
+
<label
|
|
85
|
+
v-if="floatingLabel && (!richEditor && type !== 'file')"
|
|
86
|
+
:class="floatingLabelClassName"
|
|
87
|
+
:for="id"
|
|
88
|
+
>
|
|
89
|
+
<slot name="label">
|
|
90
|
+
{{ label }}
|
|
91
|
+
</slot>
|
|
92
|
+
</label>
|
|
93
|
+
<div v-if="!richEditor" class="Polaris-TextField__Backdrop"></div>
|
|
94
|
+
</div>
|
|
95
|
+
<div class="Polaris-TextField__Suffix" :id="id+'Suffix'" v-if="showSuffix">
|
|
96
|
+
{{ suffix }}
|
|
97
|
+
<slot v-if="$slots.suffix" name="suffix"></slot>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div v-if="showCharacterCount"
|
|
101
|
+
id="CharacterCounter"
|
|
102
|
+
:class="characterCountClassName"
|
|
103
|
+
:aria-label="characterCountLabel"
|
|
104
|
+
>
|
|
105
|
+
{{ characterCountText }}
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<button type="button" :class="clearButtonClassName" v-if="computedValue && clearable" @click="onClear">
|
|
109
|
+
<span class="Polaris-VisuallyHidden">Clear</span>
|
|
110
|
+
<PIcon source="CircleCancelMinor" color="base"></PIcon>
|
|
111
|
+
</button>
|
|
112
|
+
|
|
113
|
+
<PSpinner @change="handleNumberChange" v-if="type === 'number'"></PSpinner>
|
|
114
|
+
|
|
115
|
+
<PFieldResizer
|
|
116
|
+
v-if="multiline"
|
|
117
|
+
:contents="value || placeholder"
|
|
118
|
+
:current-height="computedHeight"
|
|
119
|
+
:minimum-lines="(typeof multiline === 'number') ? multiline : 1"
|
|
120
|
+
@heightchange="handleExpandingResize"
|
|
121
|
+
/>
|
|
122
|
+
</div>
|
|
123
|
+
</template>
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
<script>
|
|
127
|
+
import { classNames } from '../../../../utilities/css';
|
|
128
|
+
import { PSpinner } from '../../../../components/PTextField/components/PSpinner';
|
|
129
|
+
import { PFieldResizer } from '../../../../components/PTextField/components/PFieldResizer';
|
|
130
|
+
import { PIcon } from '../../../../components/PIcon';
|
|
131
|
+
import { quillEditor } from 'vue-quill-editor';
|
|
132
|
+
import StringValidator from '../../../../utilities/validators/StringValidator';
|
|
133
|
+
|
|
134
|
+
const Type = [
|
|
135
|
+
'text', 'email', 'number', 'password', 'search', 'tel', 'url', 'date', 'datetime-local',
|
|
136
|
+
'month', 'time', 'week', 'currency', 'file',
|
|
137
|
+
];
|
|
138
|
+
|
|
139
|
+
const Align = ['left', 'right', 'center'];
|
|
140
|
+
|
|
141
|
+
export default {
|
|
142
|
+
name: 'PInput',
|
|
143
|
+
components: {
|
|
144
|
+
PFieldResizer, PSpinner, PIcon, quillEditor,
|
|
145
|
+
},
|
|
146
|
+
props: {
|
|
147
|
+
id: {
|
|
148
|
+
type: [String, Number],
|
|
149
|
+
default: `PolarisTextField${new Date().getUTCMilliseconds()}`,
|
|
150
|
+
},
|
|
151
|
+
value: {
|
|
152
|
+
type: [String, Number, Object, Array, Boolean, FileList],
|
|
153
|
+
default: null,
|
|
154
|
+
},
|
|
155
|
+
type: {
|
|
156
|
+
type: String,
|
|
157
|
+
...StringValidator('type', Type),
|
|
158
|
+
},
|
|
159
|
+
align: {
|
|
160
|
+
type: String,
|
|
161
|
+
},
|
|
162
|
+
placeholder: {
|
|
163
|
+
type: String,
|
|
164
|
+
},
|
|
165
|
+
multiline: {
|
|
166
|
+
type: [Boolean, Number],
|
|
167
|
+
},
|
|
168
|
+
richEditor: {
|
|
169
|
+
type: Boolean,
|
|
170
|
+
},
|
|
171
|
+
disabled: {
|
|
172
|
+
type: Boolean,
|
|
173
|
+
},
|
|
174
|
+
readOnly: {
|
|
175
|
+
type: Boolean,
|
|
176
|
+
},
|
|
177
|
+
showInput: {
|
|
178
|
+
type: Boolean,
|
|
179
|
+
default: true,
|
|
180
|
+
},
|
|
181
|
+
clearable: {
|
|
182
|
+
type: Boolean,
|
|
183
|
+
},
|
|
184
|
+
showCharacterCount: {
|
|
185
|
+
type: Boolean,
|
|
186
|
+
},
|
|
187
|
+
prefixClass: {
|
|
188
|
+
type: String,
|
|
189
|
+
},
|
|
190
|
+
autoFocus: {
|
|
191
|
+
type: Boolean,
|
|
192
|
+
},
|
|
193
|
+
autoComplete: {
|
|
194
|
+
type: Boolean,
|
|
195
|
+
},
|
|
196
|
+
labelClass: {
|
|
197
|
+
type: String,
|
|
198
|
+
},
|
|
199
|
+
inputClass: {
|
|
200
|
+
type: String,
|
|
201
|
+
},
|
|
202
|
+
suffix: {
|
|
203
|
+
type: String,
|
|
204
|
+
},
|
|
205
|
+
prefix: {
|
|
206
|
+
type: String,
|
|
207
|
+
},
|
|
208
|
+
name: {
|
|
209
|
+
type: String,
|
|
210
|
+
},
|
|
211
|
+
hasError: {
|
|
212
|
+
type: Boolean,
|
|
213
|
+
},
|
|
214
|
+
maxLength: {
|
|
215
|
+
type: [String, Number],
|
|
216
|
+
},
|
|
217
|
+
minLength: {
|
|
218
|
+
type: [String, Number],
|
|
219
|
+
},
|
|
220
|
+
step: {
|
|
221
|
+
type: Number,
|
|
222
|
+
},
|
|
223
|
+
minHeight: {
|
|
224
|
+
type: Number,
|
|
225
|
+
default: 0,
|
|
226
|
+
},
|
|
227
|
+
min: {
|
|
228
|
+
type: [String, Number],
|
|
229
|
+
},
|
|
230
|
+
max: {
|
|
231
|
+
type: [String, Number]
|
|
232
|
+
},
|
|
233
|
+
describedBy: {
|
|
234
|
+
type: String,
|
|
235
|
+
},
|
|
236
|
+
multiple: {
|
|
237
|
+
type: Boolean,
|
|
238
|
+
},
|
|
239
|
+
accept: {
|
|
240
|
+
type: String,
|
|
241
|
+
},
|
|
242
|
+
label: {
|
|
243
|
+
type: String,
|
|
244
|
+
},
|
|
245
|
+
floatingLabel: {
|
|
246
|
+
type: Boolean,
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
data() {
|
|
250
|
+
return {
|
|
251
|
+
content: this.value !== null ? this.value : '',
|
|
252
|
+
height: this.minHeight,
|
|
253
|
+
editorConfig: {
|
|
254
|
+
modules: {
|
|
255
|
+
toolbar: [
|
|
256
|
+
[{header: [1, 2, 3, 4, 5, 6, false]}, 'blockquote'],
|
|
257
|
+
['bold', 'italic', 'underline', { 'color': [] }, { 'background': [] }],
|
|
258
|
+
[{ align: [] }],
|
|
259
|
+
['link', 'image', 'video'],
|
|
260
|
+
[{ list: 'ordered' }, { list: 'bullet' }, { indent: '-1' }, { indent: '+1' }, 'clean'],
|
|
261
|
+
],
|
|
262
|
+
syntax: {
|
|
263
|
+
highlight: text => text,
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
characterCountLabel: this.maxLength || 'characterCountLabel',
|
|
268
|
+
characterCount: this.value && this.value.length,
|
|
269
|
+
};
|
|
270
|
+
},
|
|
271
|
+
computed: {
|
|
272
|
+
className() {
|
|
273
|
+
return classNames(
|
|
274
|
+
'Polaris-TextField',
|
|
275
|
+
Boolean(this.content) && 'Polaris-TextField--hasValue',
|
|
276
|
+
this.disabled && 'Polaris-TextField--disabled',
|
|
277
|
+
this.readOnly && 'Polaris-TextField--readOnly',
|
|
278
|
+
this.hasError && 'Polaris-TextField--error',
|
|
279
|
+
);
|
|
280
|
+
},
|
|
281
|
+
inputClassName() {
|
|
282
|
+
return classNames(
|
|
283
|
+
this.floatingLabel ? 'Polaris-FloatingLabels__Input' : 'Polaris-TextField__Input',
|
|
284
|
+
this.inputClass,
|
|
285
|
+
this.align && `Polaris-TextField__Input Polaris-TextField__Input--align${this.textAlign}`,
|
|
286
|
+
(this.floatingLabel && this.multiline) && 'Polaris-FloatingLabel__TextArea',
|
|
287
|
+
(this.floatingLabel && this.showPrefix) && 'Polaris-FloatingLabels__Input--prefix',
|
|
288
|
+
(this.floatingLabel && this.showSuffix) && 'Polaris-FloatingLabels__Input--suffix',
|
|
289
|
+
(this.showCharacterCount || this.type === 'number') && 'Polaris-FloatingLabels__Input--number',
|
|
290
|
+
(this.floatingLabel && this.hasError) && 'Polaris-FloatingLabels__Input--error',
|
|
291
|
+
);
|
|
292
|
+
},
|
|
293
|
+
characterCountClassName() {
|
|
294
|
+
return classNames(
|
|
295
|
+
'Polaris-TextField__CharacterCount',
|
|
296
|
+
this.multiline && 'Polaris-TextField__AlignFieldBottom ',
|
|
297
|
+
);
|
|
298
|
+
},
|
|
299
|
+
clearButtonClassName() {
|
|
300
|
+
return classNames(
|
|
301
|
+
'Polaris-TextField__ClearButton',
|
|
302
|
+
this.multiline && 'Polaris-TextField__AlignFieldBottom ',
|
|
303
|
+
);
|
|
304
|
+
},
|
|
305
|
+
floatingLabelClassName() {
|
|
306
|
+
return classNames(
|
|
307
|
+
'Polaris-Floating--label',
|
|
308
|
+
'Polaris-Floating--label--visible',
|
|
309
|
+
this.showPrefix && 'Polaris-Floating--label__prefix',
|
|
310
|
+
this.showSuffix && 'Polaris-Floating--label__suffix',
|
|
311
|
+
);
|
|
312
|
+
},
|
|
313
|
+
characterCountText() {
|
|
314
|
+
return !this.maxLength
|
|
315
|
+
? this.characterCount
|
|
316
|
+
: `${this.characterCount}/${this.maxLength}`;
|
|
317
|
+
},
|
|
318
|
+
inputType() {
|
|
319
|
+
return this.type === 'currency' ? 'text' : this.type;
|
|
320
|
+
},
|
|
321
|
+
showPrefix() {
|
|
322
|
+
return this.prefix || this.$slots.prefix;
|
|
323
|
+
},
|
|
324
|
+
showSuffix() {
|
|
325
|
+
return this.suffix || this.$slots.suffix;
|
|
326
|
+
},
|
|
327
|
+
textAlign() {
|
|
328
|
+
return this.align.replace(
|
|
329
|
+
/^_*(.)|_+(.)/g, (s, c, d) => c ? c.toUpperCase() : ' ' + d.toUpperCase()
|
|
330
|
+
);
|
|
331
|
+
},
|
|
332
|
+
labelledBy() {
|
|
333
|
+
const label = [this.id + 'Label'];
|
|
334
|
+
if (this.showPrefix) {
|
|
335
|
+
label.push(this.id + 'Prefix');
|
|
336
|
+
}
|
|
337
|
+
if (this.showSuffix) {
|
|
338
|
+
label.push(this.id + 'Suffix');
|
|
339
|
+
}
|
|
340
|
+
return label.join(' ');
|
|
341
|
+
},
|
|
342
|
+
computedHeight: {
|
|
343
|
+
get() {
|
|
344
|
+
return this.height;
|
|
345
|
+
},
|
|
346
|
+
set(value) {
|
|
347
|
+
this.height = value;
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
computedValue: {
|
|
351
|
+
get() {
|
|
352
|
+
if (this.type === 'number')
|
|
353
|
+
return Number(this.content);
|
|
354
|
+
return this.content;
|
|
355
|
+
},
|
|
356
|
+
set(value) {
|
|
357
|
+
if (this.type === 'number')
|
|
358
|
+
this.content = Number(value);
|
|
359
|
+
else
|
|
360
|
+
this.content = value;
|
|
361
|
+
|
|
362
|
+
this.$emit('input', this.type === 'number' ? Number(value) : value);
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
computedStyle() {
|
|
366
|
+
return {
|
|
367
|
+
height: (this.multiline && this.computedHeight) ? this.computedHeight + 'px' : null,
|
|
368
|
+
overflow: (this.multiline && this.computedHeight) ? 'hidden' : null
|
|
369
|
+
};
|
|
370
|
+
},
|
|
371
|
+
computedPlaceholder() {
|
|
372
|
+
return this.floatingLabel ? 'Enter input' : this.placeholder;
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
methods: {
|
|
376
|
+
onInput(event) {
|
|
377
|
+
if (this.type === 'file') {
|
|
378
|
+
this.computedValue = event.target.files;
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
if (event.target) {
|
|
383
|
+
this.computedValue = event.target.value;
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
onClear(event) {
|
|
387
|
+
this.computedValue = undefined;
|
|
388
|
+
},
|
|
389
|
+
handleNumberChange(steps) {
|
|
390
|
+
const numericValue = this.computedValue ? parseFloat(this.computedValue) : 0;
|
|
391
|
+
|
|
392
|
+
// Returns the length of decimal places in a number
|
|
393
|
+
const dpl = (num) => (num.toString().split('.')[1] || []).length;
|
|
394
|
+
|
|
395
|
+
if (isNaN(numericValue) || this.disabled) {
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
const min = this.min || -Infinity;
|
|
400
|
+
const max = this.max || +Infinity;
|
|
401
|
+
const step = this.step || 1;
|
|
402
|
+
|
|
403
|
+
// Making sure the new value has the same length of decimal places as the
|
|
404
|
+
// step / value has.
|
|
405
|
+
const decimalPlaces = Math.max(dpl(numericValue), dpl(step));
|
|
406
|
+
|
|
407
|
+
const newValue = Math.min(
|
|
408
|
+
Number(max),
|
|
409
|
+
Math.max(numericValue + steps * step, Number(min))
|
|
410
|
+
);
|
|
411
|
+
|
|
412
|
+
if (!isNaN(newValue)) {
|
|
413
|
+
this.computedValue = newValue.toFixed(decimalPlaces);
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
handleExpandingResize(e) {
|
|
417
|
+
this.computedHeight = (e < this.minHeight) ? this.minHeight : e;
|
|
418
|
+
},
|
|
419
|
+
normalizeAutoComplete(autoComplete) {
|
|
420
|
+
if (autoComplete === true) {
|
|
421
|
+
return 'on';
|
|
422
|
+
} else if (autoComplete === false) {
|
|
423
|
+
return 'off';
|
|
424
|
+
} else {
|
|
425
|
+
return autoComplete;
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
},
|
|
429
|
+
watch: {
|
|
430
|
+
value(value, oldValue) {
|
|
431
|
+
this.content = value;
|
|
432
|
+
// this.normalizedValue = value;
|
|
433
|
+
this.characterCount = value ? value.length : 0;
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
|
+
}
|
|
437
|
+
</script>
|
|
438
|
+
|
|
439
|
+
<style>
|
|
440
|
+
.ql-container.ql-snow {
|
|
441
|
+
background: #FFF;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.ql-toolbar.ql-snow {
|
|
445
|
+
background: #fafafa;
|
|
446
|
+
padding: 5px;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.quill-editor.editor {
|
|
450
|
+
width: 100%;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.ql-snow .ql-picker {
|
|
454
|
+
font-weight: normal;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.ql-toolbar.ql-snow > .ql-formats:not(:first-child):before {
|
|
458
|
+
content: "";
|
|
459
|
+
height: calc(100% + 4px);
|
|
460
|
+
width: 1px;
|
|
461
|
+
background: #c4c4c4;
|
|
462
|
+
position: absolute;
|
|
463
|
+
display: block;
|
|
464
|
+
top: -2px;
|
|
465
|
+
left: -10px;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.ql-toolbar.ql-snow .ql-formats {
|
|
469
|
+
position: relative;
|
|
470
|
+
margin-right: 10px;
|
|
471
|
+
margin-left: 10px;
|
|
472
|
+
}
|
|
473
|
+
</style>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="Polaris-TextField__Spinner" aria-hidden="true" @click="onClick">
|
|
3
|
+
<div
|
|
4
|
+
role="button"
|
|
5
|
+
class="Polaris-TextField__Segment"
|
|
6
|
+
tabindex="-1"
|
|
7
|
+
@click="handleStep(1)"
|
|
8
|
+
>
|
|
9
|
+
<div class="Polaris-TextField__SpinnerIcon">
|
|
10
|
+
<PIcon source="CaretUpMinor"/>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
<div
|
|
14
|
+
role="button"
|
|
15
|
+
class="Polaris-TextField__Segment"
|
|
16
|
+
tabindex="-1"
|
|
17
|
+
@click="handleStep(-1)"
|
|
18
|
+
>
|
|
19
|
+
<div class="Polaris-TextField__SpinnerIcon">
|
|
20
|
+
<PIcon source="CaretDownMinor"/>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
import { PIcon } from '../../../../components/PIcon';
|
|
28
|
+
|
|
29
|
+
export default {
|
|
30
|
+
name: 'PSpinner',
|
|
31
|
+
components: {
|
|
32
|
+
PIcon,
|
|
33
|
+
},
|
|
34
|
+
methods: {
|
|
35
|
+
onClick() {
|
|
36
|
+
this.$emit('click');
|
|
37
|
+
},
|
|
38
|
+
handleStep(value) {
|
|
39
|
+
this.$emit('change', value);
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<style scoped>
|
|
46
|
+
|
|
47
|
+
</style>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component :is="element" :class="className">
|
|
3
|
+
<!-- @slot The content that should get the intended styling -->
|
|
4
|
+
<slot/>
|
|
5
|
+
</component>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import { classNames, variationName } from '../../utilities/css';
|
|
10
|
+
import StringValidator from '../../utilities/validators/StringValidator';
|
|
11
|
+
|
|
12
|
+
const Variation = ['positive', 'negative', 'strong', 'subdued', 'code'];
|
|
13
|
+
|
|
14
|
+
const VariationValue = {
|
|
15
|
+
Positive: 'positive',
|
|
16
|
+
Negative: 'negative',
|
|
17
|
+
Strong: 'strong',
|
|
18
|
+
Subdued: 'subdued',
|
|
19
|
+
Code: 'code',
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function variationElement(variation) {
|
|
23
|
+
if(['positive', 'negative', 'strong', 'subdued', 'code', null].indexOf(variation) !== -1) {
|
|
24
|
+
return variation === VariationValue.Code ? 'code' : 'span';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* <br/>
|
|
30
|
+
* <h4 style="font-family: -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue,
|
|
31
|
+
* sans-serif;">Text style enhances text with additional visual meaning. For example, using subdued text to
|
|
32
|
+
* de-emphasize it from its surrounding text.</h4>
|
|
33
|
+
*/
|
|
34
|
+
export default {
|
|
35
|
+
name: 'PTextStyle',
|
|
36
|
+
props: {
|
|
37
|
+
/**
|
|
38
|
+
* Give text additional visual meaning.
|
|
39
|
+
*/
|
|
40
|
+
variation: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: null,
|
|
43
|
+
...StringValidator('variation', Variation)
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
computed: {
|
|
47
|
+
className() {
|
|
48
|
+
return classNames(
|
|
49
|
+
this.variation && `Polaris-TextStyle--${variationName('variation', this.variation)}`,
|
|
50
|
+
);
|
|
51
|
+
},
|
|
52
|
+
element() {
|
|
53
|
+
return variationElement(this.variation);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
methods: {
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
</script>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span :class="className">
|
|
3
|
+
<PImage v-if="!isSvg(source)" v-bind="$attrs" :source="source" :alt="alt"
|
|
4
|
+
class="Polaris-Thumbnail__Image" />
|
|
5
|
+
<PIcon v-else :alt="alt" :source="source"/>
|
|
6
|
+
</span>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import { classNames, variationName } from '../../utilities/css';
|
|
11
|
+
import { PImage } from '../../components/PImage';
|
|
12
|
+
import { PIcon } from '../../components/PIcon';
|
|
13
|
+
import StringValidator from '../../utilities/validators/StringValidator';
|
|
14
|
+
|
|
15
|
+
const Size = ['small', 'medium', 'large'];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* <br/>
|
|
19
|
+
* <h4 style="font-family: -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue,
|
|
20
|
+
* sans-serif;">Use thumbnail as a visual anchor and identifier for an object. They should be used along with text
|
|
21
|
+
* to provide context.</h4>
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
name: 'PThumbnail',
|
|
26
|
+
components: {
|
|
27
|
+
PImage, PIcon,
|
|
28
|
+
},
|
|
29
|
+
props: {
|
|
30
|
+
/**
|
|
31
|
+
* Thumbnail Size.
|
|
32
|
+
*/
|
|
33
|
+
size: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: 'medium',
|
|
36
|
+
...StringValidator('size', Size)
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Image source.
|
|
41
|
+
*/
|
|
42
|
+
source: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: null
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Image alt.
|
|
49
|
+
*/
|
|
50
|
+
alt: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: null
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
computed: {
|
|
56
|
+
className() {
|
|
57
|
+
return classNames(
|
|
58
|
+
'Polaris-Thumbnail',
|
|
59
|
+
this.size && `Polaris-Thumbnail--${variationName('size', this.size)}`,
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
methods: {
|
|
64
|
+
isSvg(source) {
|
|
65
|
+
const isSVG = new RegExp(/(<svg)([^<]*|[^>]*)/);
|
|
66
|
+
|
|
67
|
+
return isSVG.test(source);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</script>
|