@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,217 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<PFrame>
|
|
3
|
+
<PTopBar
|
|
4
|
+
slot="topBar"
|
|
5
|
+
:searchField="{
|
|
6
|
+
value: search,
|
|
7
|
+
placeholder: 'Search',
|
|
8
|
+
showFocusBorder: true,
|
|
9
|
+
}"
|
|
10
|
+
:searchResultsVisible="false"
|
|
11
|
+
@searchFieldChange="searchIcon"
|
|
12
|
+
@searchResultsDismiss="handleSearchResultsDismiss"
|
|
13
|
+
/>
|
|
14
|
+
<div class="shopify-div">
|
|
15
|
+
<PStack v-if="icons.major.length > 0" vertical spacing="tight">
|
|
16
|
+
<PStackItem>
|
|
17
|
+
<PHeading class="icon-heading">Major Icons</PHeading>
|
|
18
|
+
</PStackItem>
|
|
19
|
+
<PStackItem>
|
|
20
|
+
<div class="container-div">
|
|
21
|
+
<div
|
|
22
|
+
v-for="(icon, key) in icons.major"
|
|
23
|
+
:key="key"
|
|
24
|
+
class="icon-div"
|
|
25
|
+
v-p-tooltip.mostSpace='"<PIcon source=\"" + icon + "\" />"'
|
|
26
|
+
@mouseover="changeCode(icon)"
|
|
27
|
+
@click="copyCode(icon)"
|
|
28
|
+
>
|
|
29
|
+
<div>
|
|
30
|
+
<PIcon v-if="source" :source="source"/>
|
|
31
|
+
<PIcon v-else :source="icon" :color="color" :backdrop="backdrop"/>
|
|
32
|
+
<div class="icon-text-div">
|
|
33
|
+
{{ icon.replace('Major', '').replace(/([A-Z])/g, ' $1').trim() }}
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</PStackItem>
|
|
39
|
+
</PStack>
|
|
40
|
+
<PStack v-if="icons.minor.length > 0" vertical spacing="tight">
|
|
41
|
+
<PStackItem>
|
|
42
|
+
<PHeading class="icon-heading">Minor Icons</PHeading>
|
|
43
|
+
</PStackItem>
|
|
44
|
+
<PStackItem>
|
|
45
|
+
<div class="container-div">
|
|
46
|
+
<div
|
|
47
|
+
v-for="(icon, key) in icons.minor"
|
|
48
|
+
:key="key"
|
|
49
|
+
class="icon-div"
|
|
50
|
+
v-p-tooltip.mostSpace='"<PIcon source=\"" + icon + "\" />"'
|
|
51
|
+
@mouseover="changeCode(icon)"
|
|
52
|
+
@click="copyCode(icon)"
|
|
53
|
+
>
|
|
54
|
+
<div>
|
|
55
|
+
<PIcon v-if="source" :source="source"/>
|
|
56
|
+
<PIcon v-else :source="icon" :color="color" :backdrop="backdrop"/>
|
|
57
|
+
<div class="icon-text-div">
|
|
58
|
+
{{ icon.replace('Minor', '').replace(/([A-Z])/g, ' $1').trim() }}
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</PStackItem>
|
|
64
|
+
</PStack>
|
|
65
|
+
</div>
|
|
66
|
+
</PFrame>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<script>
|
|
70
|
+
import { PFrame } from '../PFrame';
|
|
71
|
+
import { PTopBar } from '../PTopBar';
|
|
72
|
+
import { PStack } from '../PStack';
|
|
73
|
+
import { PStackItem } from '../PStack/components/PStackItem';
|
|
74
|
+
import { PHeading } from '../PHeading';
|
|
75
|
+
import { PIcon } from '../PIcon';
|
|
76
|
+
import * as AllIcon from '../../assets/shopify-polaris-icons';
|
|
77
|
+
|
|
78
|
+
export default {
|
|
79
|
+
name: 'ShopifyIcons',
|
|
80
|
+
components: {
|
|
81
|
+
PIcon, PStack, PStackItem, PTopBar, PFrame, PHeading,
|
|
82
|
+
},
|
|
83
|
+
props: {
|
|
84
|
+
color: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: null,
|
|
87
|
+
},
|
|
88
|
+
backdrop: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
},
|
|
91
|
+
source: {
|
|
92
|
+
type: String,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
data() {
|
|
96
|
+
return {
|
|
97
|
+
id: '',
|
|
98
|
+
icons: {
|
|
99
|
+
major: [],
|
|
100
|
+
minor: [],
|
|
101
|
+
},
|
|
102
|
+
iconCode: '',
|
|
103
|
+
copyText: '',
|
|
104
|
+
allIcons: {},
|
|
105
|
+
search: '',
|
|
106
|
+
};
|
|
107
|
+
},
|
|
108
|
+
methods: {
|
|
109
|
+
searchIcon(value) {
|
|
110
|
+
if (!value) {
|
|
111
|
+
this.allIcons.forEach((icon) => {
|
|
112
|
+
if (icon.includes('Major')) {
|
|
113
|
+
this.icons.major.push(icon);
|
|
114
|
+
} else if (icon.includes('Minor')) {
|
|
115
|
+
this.icons.minor.push(icon);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
return this.icons;
|
|
119
|
+
} else {
|
|
120
|
+
this.icons = {
|
|
121
|
+
major: [],
|
|
122
|
+
minor: [],
|
|
123
|
+
};
|
|
124
|
+
this.allIcons.forEach((icon) => {
|
|
125
|
+
if (icon.toLowerCase().includes(value.toLowerCase()) && icon.includes('Major')) {
|
|
126
|
+
this.icons.major.push(icon);
|
|
127
|
+
} else if (icon.toLowerCase().includes(value.toLowerCase()) && icon.includes('Minor')) {
|
|
128
|
+
this.icons.minor.push(icon);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
return this.icons;
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
changeCode(icon) {
|
|
135
|
+
this.iconCode = icon;
|
|
136
|
+
this.iconCode = '<PIcon source="' + icon + '" />';
|
|
137
|
+
},
|
|
138
|
+
copyCode(icon) {
|
|
139
|
+
let copy = '';
|
|
140
|
+
if (this.backdrop) {
|
|
141
|
+
copy = navigator.clipboard.writeText(
|
|
142
|
+
'<PIcon source="' + icon + '" color="' + this.color + '" backdrop="' + this.backdrop + '" />',
|
|
143
|
+
);
|
|
144
|
+
} else {
|
|
145
|
+
if (this.color === null) {
|
|
146
|
+
copy = navigator.clipboard.writeText(
|
|
147
|
+
'<PIcon source="' + icon + '" />',
|
|
148
|
+
);
|
|
149
|
+
} else {
|
|
150
|
+
copy = navigator.clipboard.writeText(
|
|
151
|
+
'<PIcon source="' + icon + '" color="' + this.color + '" />',
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
this.copyText = copy ? 'Copied!' : '';
|
|
156
|
+
this.$pToast.open({
|
|
157
|
+
message: this.copyText,
|
|
158
|
+
duration: 3000,
|
|
159
|
+
});
|
|
160
|
+
},
|
|
161
|
+
handleSearchResultsDismiss() {
|
|
162
|
+
this.search = '';
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
created() {
|
|
166
|
+
this.allIcons = Object.keys(AllIcon);
|
|
167
|
+
this.allIcons.sort();
|
|
168
|
+
this.allIcons.forEach((icon) => {
|
|
169
|
+
if (icon.includes('Major')) {
|
|
170
|
+
this.icons.major.push(icon);
|
|
171
|
+
} else if (icon.includes('Minor')) {
|
|
172
|
+
this.icons.minor.push(icon);
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
</script>
|
|
178
|
+
|
|
179
|
+
<style scoped>
|
|
180
|
+
.shopify-div {
|
|
181
|
+
display: flex;
|
|
182
|
+
flex-direction: column;
|
|
183
|
+
width: 100%;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.container-div {
|
|
187
|
+
display: flex;
|
|
188
|
+
flex-wrap: wrap;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.icon-div {
|
|
192
|
+
width: 150px;
|
|
193
|
+
padding: 12px;
|
|
194
|
+
margin: 10px;
|
|
195
|
+
text-align: center;
|
|
196
|
+
position: relative;
|
|
197
|
+
height: 100px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.icon-div:hover {
|
|
201
|
+
border-radius: 10px;
|
|
202
|
+
cursor: pointer;
|
|
203
|
+
background-color: #FFFFFF;
|
|
204
|
+
box-shadow: 0 0 11px rgba(33, 33, 33, .2);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.icon-text-div {
|
|
208
|
+
color: #464c54;
|
|
209
|
+
padding-top: 16px;
|
|
210
|
+
word-break: break-all;
|
|
211
|
+
font-size: 14px;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.icon-heading {
|
|
215
|
+
margin: 15px 0 0 15px;
|
|
216
|
+
}
|
|
217
|
+
</style>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<img :alt="alt" :src="source" :class="className" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import { classNames } from '../../utilities/css';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* <br/>
|
|
10
|
+
* <h4 style="font-family: -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue,
|
|
11
|
+
* sans-serif;">Use image as a visual anchor and identifier for an object. They should be used along with text
|
|
12
|
+
* to provide context.</h4>
|
|
13
|
+
*/
|
|
14
|
+
export default {
|
|
15
|
+
name: 'PImage',
|
|
16
|
+
props: {
|
|
17
|
+
/**
|
|
18
|
+
* Image source
|
|
19
|
+
*/
|
|
20
|
+
source: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: null
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Image alt
|
|
27
|
+
*/
|
|
28
|
+
alt: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: null
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Image class
|
|
35
|
+
*/
|
|
36
|
+
imgClass: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: null
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
computed: {
|
|
42
|
+
className() {
|
|
43
|
+
return classNames(
|
|
44
|
+
this.imgClass,
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="Polaris-Layout">
|
|
3
|
+
<template v-if="sectioned">
|
|
4
|
+
<PLayoutSection>
|
|
5
|
+
<!-- @slot The content to display inside the layout -->
|
|
6
|
+
<slot/>
|
|
7
|
+
</PLayoutSection>
|
|
8
|
+
</template>
|
|
9
|
+
<template v-else>
|
|
10
|
+
<!-- @slot The content to display inside the layout -->
|
|
11
|
+
<slot/>
|
|
12
|
+
</template>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
import { PLayoutSection } from '../../components/PLayout/components/PLayoutSection';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* <br/>
|
|
21
|
+
* <h4 style="font-family: -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue,
|
|
22
|
+
* sans-serif;">The layout component is used to create the main layout on a page. Layouts sections come in three
|
|
23
|
+
* main configurations: one-column, two-column, and annotated. One and two column layouts can be combined in the
|
|
24
|
+
* same page. Annotated layouts should be used on their own and only on settings pages.</h4>
|
|
25
|
+
*/
|
|
26
|
+
export default {
|
|
27
|
+
name: 'PLayout',
|
|
28
|
+
components: {
|
|
29
|
+
PLayoutSection,
|
|
30
|
+
},
|
|
31
|
+
props: {
|
|
32
|
+
/**
|
|
33
|
+
* Automatically adds sections to layout.
|
|
34
|
+
*/
|
|
35
|
+
sectioned: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: false,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="className">
|
|
3
|
+
<!-- @slot Default -->
|
|
4
|
+
<slot/>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import { classNames } from '../../../../utilities/css';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
name: 'PLayoutSection',
|
|
13
|
+
props: {
|
|
14
|
+
/**
|
|
15
|
+
* Set it true to make it secondary.
|
|
16
|
+
*/
|
|
17
|
+
secondary: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false,
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* Set it true to make it full width.
|
|
23
|
+
*/
|
|
24
|
+
fullWidth: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* Set it true to make it one half.
|
|
30
|
+
*/
|
|
31
|
+
oneHalf: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false,
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* Set it true to make it one third.
|
|
37
|
+
*/
|
|
38
|
+
oneThird: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
computed: {
|
|
44
|
+
className() {
|
|
45
|
+
return classNames(
|
|
46
|
+
'Polaris-Layout__Section',
|
|
47
|
+
this.secondary && 'Polaris-Layout__Section--secondary',
|
|
48
|
+
this.fullWidth && 'Polaris-Layout__Section--fullWidth',
|
|
49
|
+
this.oneHalf && 'Polaris-Layout__Section--oneHalf',
|
|
50
|
+
this.oneThird && 'Polaris-Layout__Section--oneThird',
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
</script>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<PUnstyledLink v-if="url || to" :id="id" :to="to" :url="url" :external="external" :class="className"
|
|
3
|
+
v-on="$listeners" data-polaris-unstyled="true">
|
|
4
|
+
<!-- @slot The content to display inside the link -->
|
|
5
|
+
<slot/>
|
|
6
|
+
<span v-if="isStringSlot" class="Polaris-Link__IconLockup">
|
|
7
|
+
<span class="Polaris-Link__IconLayout">
|
|
8
|
+
<PIcon source="ExternalSmallMinor"/>
|
|
9
|
+
</span>
|
|
10
|
+
</span>
|
|
11
|
+
</PUnstyledLink>
|
|
12
|
+
<button v-else type="button" :id="id" :class="className" v-on="$listeners">
|
|
13
|
+
<!-- @slot The content to display inside the link -->
|
|
14
|
+
<slot/>
|
|
15
|
+
<span v-if="isStringSlot" class="Polaris-Link__IconLockup">
|
|
16
|
+
<span class="Polaris-Link__IconLayout">
|
|
17
|
+
<PIcon source="ExternalSmallMinor"/>
|
|
18
|
+
</span>
|
|
19
|
+
</span>
|
|
20
|
+
</button>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
import { classNames } from '../../utilities/css';
|
|
25
|
+
import { PButton } from '../../components/PButton';
|
|
26
|
+
import { PUnstyledLink } from '../../components/PUnstyledLink';
|
|
27
|
+
import { PIcon } from '../../components/PIcon';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* <br/>
|
|
31
|
+
* <h4 style="font-family: -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue,
|
|
32
|
+
* sans-serif;">Links take users to another place, and usually appear within or directly following a sentence.</h4>
|
|
33
|
+
*/
|
|
34
|
+
export default {
|
|
35
|
+
name: 'PLink',
|
|
36
|
+
components: {
|
|
37
|
+
PButton, PUnstyledLink, PIcon,
|
|
38
|
+
},
|
|
39
|
+
props: {
|
|
40
|
+
/**
|
|
41
|
+
* ID for the link.
|
|
42
|
+
*/
|
|
43
|
+
id: {
|
|
44
|
+
type: [String, Number],
|
|
45
|
+
default: null,
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* The url to link to.
|
|
49
|
+
*/
|
|
50
|
+
url: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: null,
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* Set to for router link
|
|
56
|
+
*/
|
|
57
|
+
to: {
|
|
58
|
+
type: [String, Object],
|
|
59
|
+
default: null,
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* Makes the link open in a new tab.
|
|
63
|
+
*/
|
|
64
|
+
external: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false,
|
|
67
|
+
},
|
|
68
|
+
/**
|
|
69
|
+
* Makes the link color the same as the current text color and adds an underline.
|
|
70
|
+
*/
|
|
71
|
+
monochrome: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: false,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
computed: {
|
|
77
|
+
className() {
|
|
78
|
+
return classNames(
|
|
79
|
+
'Polaris-Link',
|
|
80
|
+
this.monochrome && 'Polaris-Link--monochrome',
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
isStringSlot() {
|
|
84
|
+
|
|
85
|
+
const slots = (this.$slots.default || []);
|
|
86
|
+
return this.external && slots.length === 1 && slots[0].text;
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
}
|
|
90
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
name: 'POptionalTag',
|
|
4
|
+
props: {
|
|
5
|
+
tag: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true,
|
|
8
|
+
},
|
|
9
|
+
active: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
render(createElement) {
|
|
15
|
+
const validSlot = this.$slots.default;
|
|
16
|
+
const child = validSlot ? validSlot[0] : createElement('div');
|
|
17
|
+
if (this.active) {
|
|
18
|
+
return createElement(this.tag, {}, [child]);
|
|
19
|
+
}
|
|
20
|
+
return child;
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="className">
|
|
3
|
+
<PPageHeader
|
|
4
|
+
v-if="hasHeaderContent"
|
|
5
|
+
:title="title"
|
|
6
|
+
:breadcrumbs="breadcrumbs"
|
|
7
|
+
:primaryAction="primaryAction"
|
|
8
|
+
:secondaryActions="secondaryActions"
|
|
9
|
+
:actionGroups="actionGroups"
|
|
10
|
+
:thumbnail="thumbnail"
|
|
11
|
+
:thumbnailAlt="thumbnailAlt"
|
|
12
|
+
:pagination="pagination"
|
|
13
|
+
v-bind="$attrs"
|
|
14
|
+
v-on="$listeners"
|
|
15
|
+
>
|
|
16
|
+
<!-- @slot Use some other component for primary Action -->
|
|
17
|
+
<slot slot="primaryAction" name="primaryAction"/>
|
|
18
|
+
<!-- @slot Use some other component for title meta data -->
|
|
19
|
+
<slot slot="titleMetadata" name="titleMetadata"/>
|
|
20
|
+
<!-- @slot Use some other component for additional navigation -->
|
|
21
|
+
<slot slot="additionalNavigation" name="additionalNavigation"/>
|
|
22
|
+
</PPageHeader>
|
|
23
|
+
<div class="Polaris-Page__Content">
|
|
24
|
+
<!-- @slot The contents of the page -->
|
|
25
|
+
<slot/>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script>
|
|
31
|
+
import { classNames } from '../../utilities/css';
|
|
32
|
+
import { PPageHeader } from '../../components/PPage/components/PPageHeader';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* <br/>
|
|
36
|
+
* <h4 style="font-family: -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue,
|
|
37
|
+
* sans-serif;">Use to build the outer wrapper of a page, including the page title and associated actions.</h4>
|
|
38
|
+
*/
|
|
39
|
+
export default {
|
|
40
|
+
name: 'PPage',
|
|
41
|
+
components: {
|
|
42
|
+
PPageHeader,
|
|
43
|
+
},
|
|
44
|
+
props: {
|
|
45
|
+
/**
|
|
46
|
+
* Remove the normal max-width on the page
|
|
47
|
+
*/
|
|
48
|
+
fullWidth: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false,
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* Decreases the maximum layout width. Intended for single-column layouts
|
|
54
|
+
*/
|
|
55
|
+
narrowWidth: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: false,
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* Page title, in large type
|
|
61
|
+
*/
|
|
62
|
+
title: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: null,
|
|
65
|
+
},
|
|
66
|
+
/**
|
|
67
|
+
* Page thumbnail
|
|
68
|
+
*/
|
|
69
|
+
thumbnail: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: null,
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* Thumbnail alt text
|
|
75
|
+
*/
|
|
76
|
+
thumbnailAlt: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: null,
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* Primary page-level action
|
|
82
|
+
*/
|
|
83
|
+
primaryAction: {
|
|
84
|
+
type: Object,
|
|
85
|
+
default: () => ({}),
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* Collection of secondary page-level actions
|
|
89
|
+
*/
|
|
90
|
+
secondaryActions: {
|
|
91
|
+
type: Array,
|
|
92
|
+
default: () => ([]),
|
|
93
|
+
},
|
|
94
|
+
/**
|
|
95
|
+
* Collection of page-level groups of secondary actions
|
|
96
|
+
*/
|
|
97
|
+
actionGroups: {
|
|
98
|
+
type: Array,
|
|
99
|
+
default: () => ([]),
|
|
100
|
+
},
|
|
101
|
+
/**
|
|
102
|
+
* Collection of breadcrumbs
|
|
103
|
+
*/
|
|
104
|
+
breadcrumbs: {
|
|
105
|
+
type: Array,
|
|
106
|
+
default: () => ([]),
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* Page-level pagination
|
|
110
|
+
*/
|
|
111
|
+
pagination: {
|
|
112
|
+
type: Object,
|
|
113
|
+
default: () => ({}),
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
computed: {
|
|
117
|
+
className() {
|
|
118
|
+
return classNames(
|
|
119
|
+
'Polaris-Page',
|
|
120
|
+
this.fullWidth && 'Polaris-Page--fullWidth',
|
|
121
|
+
this.narrowWidth && 'Polaris-Page--narrowWidth',
|
|
122
|
+
);
|
|
123
|
+
},
|
|
124
|
+
hasHeaderContent() {
|
|
125
|
+
return (this.title != null && this.title !== '') ||
|
|
126
|
+
this.primaryAction != null ||
|
|
127
|
+
this.thumbnail ||
|
|
128
|
+
(this.secondaryActions != null && this.secondaryActions.length > 0) ||
|
|
129
|
+
(this.actionGroups != null && this.actionGroups.length > 0) ||
|
|
130
|
+
(this.$slots.hasOwnProperty('primaryAction')) ||
|
|
131
|
+
(this.$slots.hasOwnProperty('additionalNavigation')) ||
|
|
132
|
+
(this.breadcrumbs != null && this.breadcrumbs.length > 0);
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
}
|
|
136
|
+
</script>
|