@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,213 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<th v-if="header" data-polaris-header-cell='true' :class="className" :width="width" scope='col'
|
|
3
|
+
:aria-sort="sortLabel">
|
|
4
|
+
<template v-if="sortable">
|
|
5
|
+
<button :class="headerClassName" @click="handleSortChange">
|
|
6
|
+
<span class="Polaris-DataTable__Icon">
|
|
7
|
+
<PIcon :source="source"></PIcon>
|
|
8
|
+
</span>
|
|
9
|
+
{{ content }}
|
|
10
|
+
</button>
|
|
11
|
+
</template>
|
|
12
|
+
<template v-else>
|
|
13
|
+
{{ content }}
|
|
14
|
+
</template>
|
|
15
|
+
</th>
|
|
16
|
+
<th v-else-if="firstColumn" scope="row" :class="className">
|
|
17
|
+
<template v-if="hasAction">
|
|
18
|
+
<PButton plain v-if="action && action.to" :to="action.to">{{ action.content }}</PButton>
|
|
19
|
+
<PLink v-if="action && (action.url || action.external)" :url="action.url" :external="action.external"
|
|
20
|
+
:monochrome="action.monochrome">{{ action.content ? action.content : action.url }}
|
|
21
|
+
</PLink>
|
|
22
|
+
<PBadge v-if="badge" :status="badge.status" :progress="badge.progress">Badge{{ badge.content }}</PBadge>
|
|
23
|
+
<PToggle v-if="toggle" :checked="toggle.status" :value="toggle.id" @change="toggle.onAction"/>
|
|
24
|
+
</template>
|
|
25
|
+
<template v-else>
|
|
26
|
+
{{ content }}
|
|
27
|
+
</template>
|
|
28
|
+
</th>
|
|
29
|
+
<td v-else :class="className">
|
|
30
|
+
<template v-if="!hasActions">
|
|
31
|
+
<template v-if="hasAction">
|
|
32
|
+
<PButton plain v-if="action && action.to" :to="action.to">{{ action.content }}</PButton>
|
|
33
|
+
<PLink v-if="action && (action.url || action.external)" :url="action.url" :external="action.external"
|
|
34
|
+
:monochrome="action.monochrome">{{ action.content ? action.content : action.url }}
|
|
35
|
+
</PLink>
|
|
36
|
+
<PBadge v-if="badge" :status="badge.status" :progress="badge.progress">{{ badge.content }}</PBadge>
|
|
37
|
+
<PToggle v-if="toggle" :checked="toggle.status" :value="toggle.id" @change="toggle.onAction"/>
|
|
38
|
+
</template>
|
|
39
|
+
<template v-else>
|
|
40
|
+
{{ content }}
|
|
41
|
+
</template>
|
|
42
|
+
</template>
|
|
43
|
+
<template v-else>
|
|
44
|
+
<PButtonGroup segmented>
|
|
45
|
+
<PButton v-for="(action, key) in actions" :key="key" v-bind="action" :primary="action.primary"
|
|
46
|
+
:destructive="action.destructive" @click="action.onAction(value)">{{ action.content }}
|
|
47
|
+
</PButton>
|
|
48
|
+
</PButtonGroup>
|
|
49
|
+
</template>
|
|
50
|
+
</td>
|
|
51
|
+
</template>
|
|
52
|
+
<script>
|
|
53
|
+
import { classNames, variationName } from '../../../../utilities/css';
|
|
54
|
+
import { PIcon } from '../../../../components/PIcon';
|
|
55
|
+
import { PButton } from '../../../../components/PButton';
|
|
56
|
+
import { PButtonGroup } from '../../../../components/PButtonGroup';
|
|
57
|
+
import { PLink } from '../../../../components/PLink';
|
|
58
|
+
import { PToggle } from '../../../../components/PToggle';
|
|
59
|
+
import { PBadge } from '../../../../components/PBadge';
|
|
60
|
+
import ObjectValidator from '../../../../utilities/validators/ObjectValidator';
|
|
61
|
+
import StringValidator from '../../../../utilities/validators/StringValidator';
|
|
62
|
+
|
|
63
|
+
const SortDirection = ['ascending', 'descending', 'none'];
|
|
64
|
+
const VerticalAlign = ['top', 'bottom', 'middle', 'baseline'];
|
|
65
|
+
const Status = ['success', 'info', 'attention', 'warning', 'new', 'critical'];
|
|
66
|
+
const Progress = ['incomplete', 'partiallyComplete', 'complete'];
|
|
67
|
+
const Size = ['medium', 'small'];
|
|
68
|
+
|
|
69
|
+
const Sort = {
|
|
70
|
+
value: {
|
|
71
|
+
type: String,
|
|
72
|
+
required: true,
|
|
73
|
+
},
|
|
74
|
+
direction: {
|
|
75
|
+
type: String,
|
|
76
|
+
required: true,
|
|
77
|
+
expectedValues: SortDirection,
|
|
78
|
+
},
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export default {
|
|
82
|
+
name: 'PDataTableCell',
|
|
83
|
+
components: {
|
|
84
|
+
PIcon, PButton, PButtonGroup, PLink, PToggle, PBadge,
|
|
85
|
+
},
|
|
86
|
+
props: {
|
|
87
|
+
content: {
|
|
88
|
+
type: [String, Number],
|
|
89
|
+
},
|
|
90
|
+
contentType: {
|
|
91
|
+
type: String,
|
|
92
|
+
},
|
|
93
|
+
value: {
|
|
94
|
+
type: [String, Number],
|
|
95
|
+
},
|
|
96
|
+
firstColumn: {
|
|
97
|
+
type: Boolean,
|
|
98
|
+
},
|
|
99
|
+
truncate: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
},
|
|
102
|
+
header: {
|
|
103
|
+
type: Boolean,
|
|
104
|
+
},
|
|
105
|
+
total: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
},
|
|
108
|
+
sortable: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
},
|
|
111
|
+
width: {
|
|
112
|
+
type: [String, Number],
|
|
113
|
+
},
|
|
114
|
+
sort: {
|
|
115
|
+
type: Object,
|
|
116
|
+
...ObjectValidator('sort', Sort),
|
|
117
|
+
},
|
|
118
|
+
defaultSortDirection: {
|
|
119
|
+
type: String,
|
|
120
|
+
default: 'ascending',
|
|
121
|
+
...StringValidator('defaultSortDirection', SortDirection),
|
|
122
|
+
},
|
|
123
|
+
totalInFooter: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
},
|
|
126
|
+
verticalAlign: {
|
|
127
|
+
type: String,
|
|
128
|
+
default: 'top',
|
|
129
|
+
...StringValidator('verticalAlign', VerticalAlign),
|
|
130
|
+
},
|
|
131
|
+
actions: {
|
|
132
|
+
type: Array,
|
|
133
|
+
default: () => ([]),
|
|
134
|
+
},
|
|
135
|
+
action: {
|
|
136
|
+
type: Object,
|
|
137
|
+
default: () => ({}),
|
|
138
|
+
},
|
|
139
|
+
badge: {
|
|
140
|
+
type: Object,
|
|
141
|
+
default: () => ({}),
|
|
142
|
+
},
|
|
143
|
+
toggle: {
|
|
144
|
+
type: Object,
|
|
145
|
+
default: () => ({}),
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
computed: {
|
|
149
|
+
className() {
|
|
150
|
+
return classNames(
|
|
151
|
+
'Polaris-DataTable__Cell',
|
|
152
|
+
this.firstColumn && 'Polaris-DataTable__Cell--firstColumn',
|
|
153
|
+
this.firstColumn && this.truncate && 'Polaris-DataTable__Cell--truncated',
|
|
154
|
+
this.header && 'Polaris-DataTable__Cell--header',
|
|
155
|
+
this.total && 'Polaris-DataTable__Cell--total',
|
|
156
|
+
this.totalInFooter && 'Polaris-DataTable--cellTotalFooter',
|
|
157
|
+
this.numeric && 'Polaris-DataTable__Cell--numeric',
|
|
158
|
+
this.sorted && 'Polaris-DataTable__Cell--sorted ',
|
|
159
|
+
this.sortable && 'Polaris-DataTable__Cell--sortable',
|
|
160
|
+
this.verticalAlign && `Polaris-DataTable__Cell--${variationName('verticalAlign', this.verticalAlign)}`,
|
|
161
|
+
);
|
|
162
|
+
},
|
|
163
|
+
headerClassName() {
|
|
164
|
+
return classNames(
|
|
165
|
+
'Polaris-DataTable__Heading',
|
|
166
|
+
this.contentType === 'text' && 'Polaris-DataTable__Heading--left',
|
|
167
|
+
);
|
|
168
|
+
},
|
|
169
|
+
direction() {
|
|
170
|
+
return this.sorted && this.sort.direction ? this.sort.direction : this.defaultSortDirection;
|
|
171
|
+
},
|
|
172
|
+
source() {
|
|
173
|
+
return this.direction === 'descending' ? 'CaretDownMinor' : 'CaretUpMinor';
|
|
174
|
+
},
|
|
175
|
+
numeric() {
|
|
176
|
+
return this.contentType === 'numeric';
|
|
177
|
+
},
|
|
178
|
+
hasActions() {
|
|
179
|
+
return this.actions && this.actions.length > 0;
|
|
180
|
+
},
|
|
181
|
+
hasAction() {
|
|
182
|
+
|
|
183
|
+
return this.action || this.badge || this.toggle;
|
|
184
|
+
},
|
|
185
|
+
sorted() {
|
|
186
|
+
return this.sort && this.sort.value === this.value;
|
|
187
|
+
},
|
|
188
|
+
sortLabel() {
|
|
189
|
+
return this.sort && this.sort.value === this.value ? this.sort.direction : '';
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
methods: {
|
|
193
|
+
handleSortChange() {
|
|
194
|
+
const direction = this.sort.direction === 'ascending' ? 'descending' : 'ascending';
|
|
195
|
+
this.$emit('sort-changed', this.value, direction);
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
}
|
|
199
|
+
</script>
|
|
200
|
+
|
|
201
|
+
<style scoped>
|
|
202
|
+
th:last-child {
|
|
203
|
+
text-align: right;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
td:last-child {
|
|
207
|
+
text-align: right;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
td:last-child > * {
|
|
211
|
+
float: right;
|
|
212
|
+
}
|
|
213
|
+
</style>
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<th v-if="header" data-polaris-header-cell="true" :class="className" :width="width" scope="col"
|
|
3
|
+
:aria-sort="sortLabel">
|
|
4
|
+
<template v-if="sortable">
|
|
5
|
+
<button :class="headerClassName" @click="handleSortChange">
|
|
6
|
+
<span class="Polaris-DataTable__Icon">
|
|
7
|
+
<PIcon :source="source"/>
|
|
8
|
+
</span>
|
|
9
|
+
{{ content }}
|
|
10
|
+
</button>
|
|
11
|
+
</template>
|
|
12
|
+
<template v-else>
|
|
13
|
+
{{ content }}
|
|
14
|
+
</template>
|
|
15
|
+
</th>
|
|
16
|
+
<th v-else-if="firstColumn" scope="row" :class="className">
|
|
17
|
+
<slot :name="`item.${headerValue}`" :item="headerValue">
|
|
18
|
+
{{ value }}
|
|
19
|
+
</slot>
|
|
20
|
+
</th>
|
|
21
|
+
<td v-else :class="className">
|
|
22
|
+
<slot :name="`item.${headerValue}`" :item="headerValue">
|
|
23
|
+
{{ value }}
|
|
24
|
+
</slot>
|
|
25
|
+
</td>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import { classNames, variationName } from '../../../../utilities/css';
|
|
30
|
+
import { PIcon } from '../../../../components/PIcon';
|
|
31
|
+
import ObjectValidator from '../../../../utilities/validators/ObjectValidator';
|
|
32
|
+
import StringValidator from '../../../../utilities/validators/StringValidator';
|
|
33
|
+
|
|
34
|
+
const SortDirection = ['ascending', 'descending', 'none'];
|
|
35
|
+
const VerticalAlign = ['top', 'bottom', 'middle', 'baseline'];
|
|
36
|
+
|
|
37
|
+
const Sort = {
|
|
38
|
+
value: {
|
|
39
|
+
type: String,
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
42
|
+
direction: {
|
|
43
|
+
type: String,
|
|
44
|
+
required: true,
|
|
45
|
+
expectedValues: SortDirection,
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default {
|
|
50
|
+
name: 'PDataTableCellNew',
|
|
51
|
+
components: {
|
|
52
|
+
PIcon,
|
|
53
|
+
},
|
|
54
|
+
props: {
|
|
55
|
+
header: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
},
|
|
58
|
+
content: {
|
|
59
|
+
type: [String, Number],
|
|
60
|
+
},
|
|
61
|
+
value: {
|
|
62
|
+
type: [String, Number, Boolean, Object, Array],
|
|
63
|
+
},
|
|
64
|
+
width: {
|
|
65
|
+
type: [String, Number],
|
|
66
|
+
},
|
|
67
|
+
sort: {
|
|
68
|
+
type: Object,
|
|
69
|
+
...ObjectValidator('sort', Sort),
|
|
70
|
+
},
|
|
71
|
+
sortable: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: true,
|
|
74
|
+
},
|
|
75
|
+
defaultSortDirection: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: 'ascending',
|
|
78
|
+
...StringValidator('defaultSortDirection', SortDirection),
|
|
79
|
+
},
|
|
80
|
+
contentType: {
|
|
81
|
+
type: String,
|
|
82
|
+
},
|
|
83
|
+
firstColumn: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
},
|
|
86
|
+
truncate: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
},
|
|
89
|
+
verticalAlign: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: 'top',
|
|
92
|
+
...StringValidator('verticalAlign', VerticalAlign),
|
|
93
|
+
},
|
|
94
|
+
total: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
},
|
|
97
|
+
totalInFooter: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
},
|
|
100
|
+
headerValue: {
|
|
101
|
+
type: String,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
computed: {
|
|
105
|
+
className() {
|
|
106
|
+
return classNames(
|
|
107
|
+
'Polaris-DataTable__Cell',
|
|
108
|
+
this.firstColumn && 'Polaris-DataTable__Cell--firstColumn',
|
|
109
|
+
this.firstColumn && this.truncate && 'Polaris-DataTable__Cell--truncated',
|
|
110
|
+
this.header && 'Polaris-DataTable__Cell--header',
|
|
111
|
+
this.total && 'Polaris-DataTable__Cell--total',
|
|
112
|
+
this.totalInFooter && 'Polaris-DataTable--cellTotalFooter',
|
|
113
|
+
this.numeric && 'Polaris-DataTable__Cell--numeric',
|
|
114
|
+
this.sorted && 'Polaris-DataTable__Cell--sorted ',
|
|
115
|
+
this.sortable && 'Polaris-DataTable__Cell--sortable',
|
|
116
|
+
this.verticalAlign && `Polaris-DataTable__Cell--${variationName('verticalAlign', this.verticalAlign)}`,
|
|
117
|
+
);
|
|
118
|
+
},
|
|
119
|
+
headerClassName() {
|
|
120
|
+
return classNames(
|
|
121
|
+
'Polaris-DataTable__Heading',
|
|
122
|
+
this.contentType === 'text' && 'Polaris-DataTable__Heading--left',
|
|
123
|
+
);
|
|
124
|
+
},
|
|
125
|
+
direction() {
|
|
126
|
+
return this.sorted && this.sort.direction ? this.sort.direction : this.defaultSortDirection;
|
|
127
|
+
},
|
|
128
|
+
source() {
|
|
129
|
+
return this.direction === 'descending' ? 'CaretDownMinor' : 'CaretUpMinor';
|
|
130
|
+
},
|
|
131
|
+
numeric() {
|
|
132
|
+
return this.contentType === 'numeric';
|
|
133
|
+
},
|
|
134
|
+
sorted() {
|
|
135
|
+
return this.sort && this.sort.value === this.value;
|
|
136
|
+
},
|
|
137
|
+
sortLabel() {
|
|
138
|
+
return this.sort && this.sort.value === this.value ? this.sort.direction : '';
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
methods: {
|
|
142
|
+
handleSortChange() {
|
|
143
|
+
const direction = this.sort.direction === 'ascending' ? 'descending' : 'ascending';
|
|
144
|
+
this.$emit('sort-changed', this.value, direction);
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
}
|
|
148
|
+
</script>
|
|
149
|
+
|
|
150
|
+
<style scoped>
|
|
151
|
+
th:last-child {
|
|
152
|
+
text-align: right;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
td:last-child {
|
|
156
|
+
text-align: right;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
td:last-child > * {
|
|
160
|
+
float: right;
|
|
161
|
+
}
|
|
162
|
+
</style>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<th v-if="firstColumn" scope="row" :class="className">
|
|
3
|
+
<slot/>
|
|
4
|
+
</th>
|
|
5
|
+
<td v-else :class="className">
|
|
6
|
+
<slot/>
|
|
7
|
+
</td>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import { classNames, variationName } from '../../../../utilities/css';
|
|
12
|
+
import StringValidator from '../../../../utilities/validators/StringValidator';
|
|
13
|
+
|
|
14
|
+
const VerticalAlign = ['top', 'bottom', 'middle', 'baseline'];
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
name: 'PDataTableCol',
|
|
18
|
+
props: {
|
|
19
|
+
/**
|
|
20
|
+
* First Column of a table
|
|
21
|
+
*/
|
|
22
|
+
firstColumn: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false,
|
|
25
|
+
},
|
|
26
|
+
/**
|
|
27
|
+
* Truncate content in first column instead of wrapping
|
|
28
|
+
*/
|
|
29
|
+
truncate: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false,
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* Numeric column of a table
|
|
35
|
+
*/
|
|
36
|
+
numeric: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false,
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* Vertical alignment of content in the cells
|
|
42
|
+
*/
|
|
43
|
+
verticalAlign: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: 'top',
|
|
46
|
+
...StringValidator('verticalAlign', VerticalAlign),
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
computed: {
|
|
50
|
+
className() {
|
|
51
|
+
return classNames(
|
|
52
|
+
'Polaris-DataTable__Cell',
|
|
53
|
+
this.firstColumn && 'Polaris-DataTable__Cell--firstColumn',
|
|
54
|
+
this.firstColumn && this.truncate && 'Polaris-DataTable__Cell--truncated',
|
|
55
|
+
this.numeric && 'Polaris-DataTable__Cell--numeric',
|
|
56
|
+
this.verticalAlign && `Polaris-DataTable__Cell--${variationName('verticalAlign', this.verticalAlign)}`,
|
|
57
|
+
);
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style scoped>
|
|
64
|
+
th:last-child {
|
|
65
|
+
text-align: right;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
td:last-child {
|
|
69
|
+
text-align: right;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
td:last-child > * {
|
|
73
|
+
float: right;
|
|
74
|
+
}
|
|
75
|
+
</style>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span v-if="element === 'span'">
|
|
3
|
+
<slot />
|
|
4
|
+
</span>
|
|
5
|
+
<component v-else :is="element" :class="className">
|
|
6
|
+
<!-- @slot Content to display -->
|
|
7
|
+
<slot />
|
|
8
|
+
</component>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
import { classNames, variationName } from '../../utilities/css';
|
|
13
|
+
import StringValidator from '../../utilities/validators/StringValidator';
|
|
14
|
+
|
|
15
|
+
const Size = ['small', 'medium', 'large', 'extraLarge'];
|
|
16
|
+
const HeadingTagName = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'span'];
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* <br/>
|
|
20
|
+
* <h4 style="font-family: -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue,
|
|
21
|
+
* sans-serif;">Display styles make a bold visual statement. Use them to create impact when the main goal is visual
|
|
22
|
+
* storytelling. For example, use display text to convince or reassure merchants such as in marketing content or to
|
|
23
|
+
* capture attention during onboarding.</h4>
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
name: 'PDisplayText',
|
|
28
|
+
props: {
|
|
29
|
+
/**
|
|
30
|
+
* Size of the text
|
|
31
|
+
*/
|
|
32
|
+
size: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: 'medium',
|
|
35
|
+
...StringValidator('size', Size)
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Element of text
|
|
40
|
+
*/
|
|
41
|
+
element: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: 'p',
|
|
44
|
+
...StringValidator('element', HeadingTagName)
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
computed: {
|
|
48
|
+
className() {
|
|
49
|
+
return classNames(
|
|
50
|
+
'Polaris-DisplayText',
|
|
51
|
+
this.size && `Polaris-DisplayText--${variationName('size', this.size)}`,
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<PCard>
|
|
3
|
+
<PCardSection>
|
|
4
|
+
<div :class="className">
|
|
5
|
+
<div class="Polaris-EmptyState__Section">
|
|
6
|
+
<div class="Polaris-EmptyState__DetailsContainer">
|
|
7
|
+
<div class="Polaris-EmptyState__Details">
|
|
8
|
+
<PTextContainer>
|
|
9
|
+
<PDisplayText size="small">
|
|
10
|
+
<!-- @slot Heading Content -->
|
|
11
|
+
<slot name="heading">
|
|
12
|
+
{{ heading }}
|
|
13
|
+
</slot>
|
|
14
|
+
</PDisplayText>
|
|
15
|
+
<div class="Polaris-EmptyState__Content">
|
|
16
|
+
<!-- @slot Display the elements inside empty state -->
|
|
17
|
+
<slot/>
|
|
18
|
+
</div>
|
|
19
|
+
</PTextContainer>
|
|
20
|
+
<div class="Polaris-EmptyState__Actions" v-if="hasAction">
|
|
21
|
+
<!-- @slot Actions Content -->
|
|
22
|
+
<slot name="actions">
|
|
23
|
+
<PStack spacing="tight" distribution="center" alignment="center">
|
|
24
|
+
<PStackItem v-if="Object.keys(primaryAction).length > 0">
|
|
25
|
+
<PButton primary @click="primaryAction.onAction()">{{ primaryAction.content }}</PButton>
|
|
26
|
+
</PStackItem>
|
|
27
|
+
<PStackItem v-if="Object.keys(secondaryAction).length > 0">
|
|
28
|
+
<PButton @click="secondaryAction.onAction()">{{ secondaryAction.content }}</PButton>
|
|
29
|
+
</PStackItem>
|
|
30
|
+
</PStack>
|
|
31
|
+
</slot>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="Polaris-EmptyState__FooterContent">
|
|
34
|
+
<!-- @slot Footer Content -->
|
|
35
|
+
<slot name="footer"/>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="Polaris-EmptyState__ImageContainer">
|
|
40
|
+
<!-- @slot Image Content -->
|
|
41
|
+
<slot name="image">
|
|
42
|
+
<PImage :source="image" class="Polaris-EmptyState__Image"/>
|
|
43
|
+
</slot>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</PCardSection>
|
|
48
|
+
</PCard>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script>
|
|
52
|
+
import { classNames } from '../../utilities/css';
|
|
53
|
+
import { PImage } from '../../components/PImage';
|
|
54
|
+
import { PStack } from '../../components/PStack';
|
|
55
|
+
import { PStackItem } from '../../components/PStack/components/PStackItem';
|
|
56
|
+
import { PDisplayText } from '../../components/PDisplayText';
|
|
57
|
+
import { PTextContainer } from '../../components/PTextContainer';
|
|
58
|
+
import { PCard } from '../../components/PCard';
|
|
59
|
+
import { PCardSection } from '../../components/PCard/components/PCardSection';
|
|
60
|
+
import { PButton } from '../../components/PButton';
|
|
61
|
+
import ObjectValidator from '../../utilities/validators/ObjectValidator';
|
|
62
|
+
import { ComplexAction, DisableableAction, LoadableAction } from '../../types';
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* <br/>
|
|
66
|
+
* <h4 style="font-family: -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue,
|
|
67
|
+
* sans-serif;">Empty states are used when a list, table, or chart has no items or data to show. This is an opportunity
|
|
68
|
+
* to provide explanation or guidance to help merchants progress. The empty state component is intended for use when a
|
|
69
|
+
* full page in the admin is empty, and not for individual elements or areas in the interface.</h4>
|
|
70
|
+
*/
|
|
71
|
+
export default {
|
|
72
|
+
name: 'PEmptyState',
|
|
73
|
+
components: {
|
|
74
|
+
PImage, PCard, PCardSection, PTextContainer, PDisplayText, PStack, PStackItem, PButton,
|
|
75
|
+
},
|
|
76
|
+
props: {
|
|
77
|
+
/**
|
|
78
|
+
* The empty state heading
|
|
79
|
+
*/
|
|
80
|
+
heading: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: null
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Whether or not the content should span the full width of its container
|
|
87
|
+
*/
|
|
88
|
+
fullWidth: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: false
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Whether or not to limit the image to the size of its container on large screens
|
|
95
|
+
*/
|
|
96
|
+
imageContained: {
|
|
97
|
+
type: Boolean,
|
|
98
|
+
default: false
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The path to the image to display.
|
|
103
|
+
* The image should have ~40px of white space above when empty state is used within a card,
|
|
104
|
+
* modal, or navigation component
|
|
105
|
+
*/
|
|
106
|
+
image: {
|
|
107
|
+
type: String,
|
|
108
|
+
default: null
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Primary action for empty state
|
|
113
|
+
*/
|
|
114
|
+
primaryAction: {
|
|
115
|
+
type: Object,
|
|
116
|
+
default: () => ({}),
|
|
117
|
+
...ObjectValidator('primaryAction', {
|
|
118
|
+
...DisableableAction,
|
|
119
|
+
...LoadableAction
|
|
120
|
+
})
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Secondary action for empty state
|
|
125
|
+
*/
|
|
126
|
+
secondaryAction: {
|
|
127
|
+
type: Object,
|
|
128
|
+
default: () => ({}),
|
|
129
|
+
...ObjectValidator('secondaryAction', ComplexAction)
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
computed: {
|
|
133
|
+
className() {
|
|
134
|
+
return classNames(
|
|
135
|
+
'Polaris-EmptyState',
|
|
136
|
+
'Polaris-EmptyState--withinContentContainer',
|
|
137
|
+
this.fullWidth && 'Polaris-EmptyState--fullWidth',
|
|
138
|
+
this.imageContained && 'Polaris-EmptyState--imageContained',
|
|
139
|
+
);
|
|
140
|
+
},
|
|
141
|
+
hasAction() {
|
|
142
|
+
return this.primaryAction || this.secondaryAction;
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
methods: {
|
|
146
|
+
styleClass(name) {
|
|
147
|
+
if(typeof name === 'string') {
|
|
148
|
+
const finalStyleClasses = ['one', 'two', 'three', 'four', 'five', 'six'];
|
|
149
|
+
return name ? finalStyleClasses[name.charCodeAt(0) % finalStyleClasses.length] : finalStyleClasses[0];
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
</script>
|