cob-cli 2.25.0 → 2.27.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.
Files changed (221) hide show
  1. package/bin/cob-cli.js +6 -7
  2. package/bin/handleAutoComplete.js +3 -4
  3. package/lib/commands/customize.js +216 -63
  4. package/package.json +3 -2
  5. package/.gitmodules +0 -27
  6. package/.vscode/launch.json +0 -106
  7. package/README.Development.md +0 -294
  8. package/README.publish.md +0 -10
  9. package/customizations/backend.email.js +0 -10
  10. package/customizations/backend.js +0 -14
  11. package/customizations/backend.updateField.js +0 -11
  12. package/customizations/backend.vuepress.js +0 -35
  13. package/customizations/dashboard.dash.js +0 -14
  14. package/customizations/dashboard.js +0 -14
  15. package/customizations/dashboard.simple.js +0 -12
  16. package/customizations/dashboard.vue.empty.js +0 -12
  17. package/customizations/dashboard.vue.grid.js +0 -10
  18. package/customizations/dashboard.vue.js +0 -14
  19. package/customizations/dashboard.vue.menuAndGrid.js +0 -10
  20. package/customizations/frontend.common.js +0 -16
  21. package/customizations/frontend.easy.js +0 -16
  22. package/customizations/frontend.formatList.currency.js +0 -17
  23. package/customizations/frontend.formatList.js +0 -13
  24. package/customizations/frontend.js +0 -14
  25. package/customizations/importer.js +0 -10
  26. package/customizations/keywords.audit.js +0 -18
  27. package/customizations/keywords.calc.js +0 -18
  28. package/customizations/keywords.image.js +0 -16
  29. package/customizations/keywords.js +0 -17
  30. package/customizations/keywords.kibana.js +0 -16
  31. package/customizations/keywords.log.js +0 -18
  32. package/customizations/keywords.styleResults.js +0 -18
  33. package/lib/task_lists/customize_copy.js +0 -51
  34. package/lib/task_lists/customize_mergeFiles.js +0 -42
  35. package/lib/task_lists/customize_questions.js +0 -40
  36. package/templates/backend/vuepress/integrationm/actions/getVuePressDoc.groovy +0 -74
  37. package/templates/backend/vuepress/integrationm/actions/getVuePressSidebarConfig.groovy +0 -42
  38. package/templates/backend/vuepress/integrationm/actions/getVuePressSidebarRootElements.groovy +0 -17
  39. package/templates/backend/vuepress/others/vuepress/definition_contents_v234.json +0 -619
  40. package/templates/backend/vuepress/others/vuepress/nginx/README.md +0 -28
  41. package/templates/backend/vuepress/others/vuepress/package-lock.json +0 -29656
  42. package/templates/backend/vuepress/others/vuepress/package.json +0 -24
  43. package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/DescriptVideo.vue +0 -22
  44. package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/Graph.vue +0 -124
  45. package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/ReadingTime.vue +0 -26
  46. package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/References.vue +0 -228
  47. package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/RestrictedContent.vue +0 -77
  48. package/templates/backend/vuepress/others/vuepress/src/.vuepress/config.js +0 -101
  49. package/templates/backend/vuepress/others/vuepress/src/.vuepress/config.json +0 -31
  50. package/templates/backend/vuepress/others/vuepress/src/.vuepress/enhanceApp.js +0 -14
  51. package/templates/backend/vuepress/others/vuepress/src/.vuepress/nav/getNavTranslated.js +0 -52
  52. package/templates/backend/vuepress/others/vuepress/src/.vuepress/plugins/References.js +0 -96
  53. package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/Logo-Cult-of-Bits-400x400-1.png +0 -0
  54. package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/favicon-cob.png +0 -0
  55. package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/logo.png +0 -0
  56. package/templates/backend/vuepress/others/vuepress/src/.vuepress/styles/index.styl +0 -39
  57. package/templates/backend/vuepress/others/vuepress/src/.vuepress/styles/palette.styl +0 -17
  58. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/LICENSE +0 -21
  59. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/README.md +0 -11
  60. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/AlgoliaSearchBox.vue +0 -172
  61. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/DropdownLink.vue +0 -252
  62. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/DropdownTransition.vue +0 -33
  63. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Home.vue +0 -134
  64. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/NavLink.vue +0 -98
  65. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/NavLinks.vue +0 -165
  66. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Navbar.vue +0 -140
  67. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Page.vue +0 -31
  68. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/PageEdit.vue +0 -119
  69. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/PageNav.vue +0 -163
  70. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Sidebar.vue +0 -64
  71. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarButton.vue +0 -40
  72. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarGroup.vue +0 -144
  73. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarLink.vue +0 -140
  74. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarLinks.vue +0 -114
  75. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/Badge.vue +0 -44
  76. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/CodeBlock.vue +0 -41
  77. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/CodeGroup.vue +0 -120
  78. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/index.js +0 -59
  79. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/layouts/404.vue +0 -30
  80. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/layouts/Layout.vue +0 -151
  81. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/noopModule.js +0 -1
  82. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/package.json +0 -44
  83. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/arrow.styl +0 -22
  84. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/code.styl +0 -137
  85. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/config.styl +0 -1
  86. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/custom-blocks.styl +0 -44
  87. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/index.styl +0 -202
  88. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/mobile.styl +0 -37
  89. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/toc.styl +0 -3
  90. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/wrapper.styl +0 -10
  91. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/util/index.js +0 -244
  92. package/templates/dashboards/cob-dashboard-html/demoDashboard.html +0 -18
  93. package/templates/dashboards/cob-dashboard-vue/package-lock.json +0 -25020
  94. package/templates/dashboards/cob-dashboard-vue/package.json +0 -21
  95. package/templates/dashboards/cob-dashboard-vue/src/App.vue +0 -26
  96. package/templates/dashboards/cob-dashboard-vue/src/dashboard.html +0 -31
  97. package/templates/dashboards/cob-dashboard-vue/src/main.js +0 -12
  98. package/templates/dashboards/cob-dashboard-vue/src/plugins/cobUiVueComponents.js +0 -6
  99. package/templates/dashboards/cob-dashboard-vue/src/plugins/vuetify.js +0 -9
  100. package/templates/dashboards/cob-dashboard-vue/vue.config.js +0 -104
  101. package/templates/dashboards/dash/dist/css/app.7b16c01a.css +0 -11
  102. package/templates/dashboards/dash/dist/dashboard.html +0 -25
  103. package/templates/dashboards/dash/dist/fonts/fa-brands-400.a78ffbbe.ttf +0 -0
  104. package/templates/dashboards/dash/dist/fonts/fa-brands-400.cd2b4095.woff2 +0 -0
  105. package/templates/dashboards/dash/dist/fonts/fa-regular-400.b1a1bebb.ttf +0 -0
  106. package/templates/dashboards/dash/dist/fonts/fa-regular-400.e8a1ba41.woff2 +0 -0
  107. package/templates/dashboards/dash/dist/fonts/fa-solid-900.55b416a8.woff2 +0 -0
  108. package/templates/dashboards/dash/dist/fonts/fa-solid-900.73820155.ttf +0 -0
  109. package/templates/dashboards/dash/dist/fonts/fa-v4compatibility.0d6f5f18.ttf +0 -0
  110. package/templates/dashboards/dash/dist/fonts/fa-v4compatibility.786e6b33.woff2 +0 -0
  111. package/templates/dashboards/dash/dist/js/app.13b950c8.js +0 -199
  112. package/templates/dashboards/dash/dist/js/app.13b950c8.js.map +0 -1
  113. package/templates/dashboards/dash/package-lock.json +0 -22646
  114. package/templates/dashboards/dash/package.json +0 -27
  115. package/templates/dashboards/dash/src/App.vue +0 -124
  116. package/templates/dashboards/dash/src/assets/css/all.min.css +0 -6
  117. package/templates/dashboards/dash/src/assets/webfonts/fa-brands-400.ttf +0 -0
  118. package/templates/dashboards/dash/src/assets/webfonts/fa-brands-400.woff2 +0 -0
  119. package/templates/dashboards/dash/src/assets/webfonts/fa-regular-400.ttf +0 -0
  120. package/templates/dashboards/dash/src/assets/webfonts/fa-regular-400.woff2 +0 -0
  121. package/templates/dashboards/dash/src/assets/webfonts/fa-solid-900.ttf +0 -0
  122. package/templates/dashboards/dash/src/assets/webfonts/fa-solid-900.woff2 +0 -0
  123. package/templates/dashboards/dash/src/assets/webfonts/fa-v4compatibility.ttf +0 -0
  124. package/templates/dashboards/dash/src/assets/webfonts/fa-v4compatibility.woff2 +0 -0
  125. package/templates/dashboards/dash/src/collector.js +0 -222
  126. package/templates/dashboards/dash/src/components/Attention.vue +0 -30
  127. package/templates/dashboards/dash/src/components/Board.vue +0 -35
  128. package/templates/dashboards/dash/src/components/Calendar.vue +0 -422
  129. package/templates/dashboards/dash/src/components/Dashboard.vue +0 -27
  130. package/templates/dashboards/dash/src/components/Filter.vue +0 -68
  131. package/templates/dashboards/dash/src/components/Kibana.vue +0 -138
  132. package/templates/dashboards/dash/src/components/Label.vue +0 -15
  133. package/templates/dashboards/dash/src/components/Menu.vue +0 -44
  134. package/templates/dashboards/dash/src/components/Totals.vue +0 -49
  135. package/templates/dashboards/dash/src/components/TotalsValue.vue +0 -59
  136. package/templates/dashboards/dash/src/components/shared/Instance.vue +0 -64
  137. package/templates/dashboards/dash/src/components/shared/Waiting.vue +0 -25
  138. package/templates/dashboards/dash/src/dashboard.html +0 -39
  139. package/templates/dashboards/dash/src/definition_dashboard_v0.json +0 -924
  140. package/templates/dashboards/dash/src/definition_dashboard_v1.json +0 -1
  141. package/templates/dashboards/dash/src/input.css +0 -9
  142. package/templates/dashboards/dash/src/main.js +0 -11
  143. package/templates/dashboards/dash/src/model/ComponentStatePersistence.js +0 -66
  144. package/templates/dashboards/dash/src/output.css +0 -314245
  145. package/templates/dashboards/dash/src/test_collector.js +0 -3719
  146. package/templates/dashboards/dash/src/utils/EsInstanceUtils.js +0 -8
  147. package/templates/dashboards/dash/tailwind.config.js +0 -12
  148. package/templates/dashboards/dash/vue.config.js +0 -104
  149. package/templates/frontend/common/templates/frontend/common/css/_dualColumn.css +0 -46
  150. package/templates/frontend/common/templates/frontend/common/css/_global.css +0 -19
  151. package/templates/frontend/common/templates/frontend/common/css/_hidden.css +0 -13
  152. package/templates/frontend/common/templates/frontend/common/css/_history.css +0 -13
  153. package/templates/frontend/common/templates/frontend/common/css/_mobile.css +0 -125
  154. package/templates/frontend/common/templates/frontend/common/css/customizations.__MERGE__.css +0 -5
  155. package/templates/frontend/common/templates/frontend/common/js/cob/_disable_save_onSubdetail.js +0 -11
  156. package/templates/frontend/common/templates/frontend/common/js/cob/_group_references.js +0 -22
  157. package/templates/frontend/common/templates/frontend/common/js/cob/_show_hidden.js +0 -35
  158. package/templates/frontend/common/templates/frontend/common/js/customizations2.__MERGE__.js +0 -3
  159. package/templates/frontend/common/templates/frontend/common/package.json +0 -3
  160. package/templates/frontend/easy/css/_easy/googlefonts.css +0 -360
  161. package/templates/frontend/easy/css/_easy/vuetify.cob-scoped.css +0 -10488
  162. package/templates/frontend/easy/js/_easy/lib/axios.min.js +0 -9
  163. package/templates/frontend/easy/js/_easy/lib/marked.min.js +0 -6
  164. package/templates/frontend/easy/js/_easy/lib/vue.js +0 -11912
  165. package/templates/frontend/easy/js/_easy/lib/vue.min.js +0 -6
  166. package/templates/frontend/easy/js/_easy/lib/vuetify.min.js +0 -6
  167. package/templates/frontend/easy/js/customizations2.__MERGE__.js +0 -22
  168. package/templates/frontend/easy/webapp/.browserslistrc +0 -2
  169. package/templates/frontend/easy/webapp/.eslintrc.js +0 -17
  170. package/templates/frontend/easy/webapp/README.md +0 -60
  171. package/templates/frontend/easy/webapp/babel.config.js +0 -5
  172. package/templates/frontend/easy/webapp/dist/css/app.a4fb91f8.css +0 -1
  173. package/templates/frontend/easy/webapp/dist/dashboard.html +0 -13
  174. package/templates/frontend/easy/webapp/dist/js/app.63a57dcd.js +0 -2
  175. package/templates/frontend/easy/webapp/dist/js/app.63a57dcd.js.map +0 -1
  176. package/templates/frontend/easy/webapp/package-lock.json +0 -32986
  177. package/templates/frontend/easy/webapp/package.json +0 -32
  178. package/templates/frontend/easy/webapp/postcss.config.js +0 -5
  179. package/templates/frontend/easy/webapp/public/dashboard.html +0 -13
  180. package/templates/frontend/easy/webapp/src/App.vue +0 -181
  181. package/templates/frontend/easy/webapp/src/assets/logo.png +0 -0
  182. package/templates/frontend/easy/webapp/src/components/HelloWorld.vue +0 -59
  183. package/templates/frontend/easy/webapp/src/components/PermBuilder.vue +0 -163
  184. package/templates/frontend/easy/webapp/src/components/PlanExecutor.vue +0 -225
  185. package/templates/frontend/easy/webapp/src/components/ProductPermBuilder.vue +0 -95
  186. package/templates/frontend/easy/webapp/src/components/RmDefinitionChooser.vue +0 -59
  187. package/templates/frontend/easy/webapp/src/components/RmDomainChooser.vue +0 -60
  188. package/templates/frontend/easy/webapp/src/components/RoleBuilder.vue +0 -73
  189. package/templates/frontend/easy/webapp/src/main.js +0 -19
  190. package/templates/frontend/easy/webapp/src/perm-templates.js +0 -189
  191. package/templates/frontend/easy/webapp/src/perms.js +0 -197
  192. package/templates/frontend/easy/webapp/vue.config.js +0 -66
  193. package/templates/frontend/formatList/currency/css/_format_currency.css +0 -11
  194. package/templates/frontend/formatList/currency/css/customizations.__MERGE__.css +0 -1
  195. package/templates/frontend/formatList/currency/js/cob/_format_currency.js +0 -11
  196. package/templates/frontend/formatList/currency/js/customizations2.__MERGE__.js +0 -1
  197. package/templates/frontend/formatList/currency/package.json +0 -3
  198. package/templates/gitignore +0 -14
  199. package/templates/keywords/audit/backend/scripts/_audit.groovy +0 -78
  200. package/templates/keywords/audit/frontend/js/cob/_audit.js +0 -24
  201. package/templates/keywords/audit/frontend/js/customizations2.__MERGE__.js +0 -1
  202. package/templates/keywords/audit/package.json +0 -3
  203. package/templates/keywords/calc/backend/scripts/_calc.groovy +0 -151
  204. package/templates/keywords/calc/frontend/js/cob/_calc.js +0 -193
  205. package/templates/keywords/calc/frontend/js/customizations2.__MERGE__.js +0 -1
  206. package/templates/keywords/calc/package.json +0 -3
  207. package/templates/keywords/image/frontend/js/cob/_image.js +0 -30
  208. package/templates/keywords/image/frontend/js/customizations2.__MERGE__.js +0 -1
  209. package/templates/keywords/image/package.json +0 -3
  210. package/templates/keywords/kibana/frontend/js/cob/_kibana.js +0 -58
  211. package/templates/keywords/kibana/frontend/js/customizations2.__MERGE__.js +0 -1
  212. package/templates/keywords/kibana/package.json +0 -3
  213. package/templates/keywords/log/backend/scripts/_log.groovy +0 -95
  214. package/templates/keywords/log/frontend/css/_log.css +0 -5
  215. package/templates/keywords/log/frontend/css/customizations.__MERGE__.css +0 -1
  216. package/templates/keywords/log/package.json +0 -3
  217. package/templates/keywords/styleResults/frontend/css/_styleResults.css +0 -86
  218. package/templates/keywords/styleResults/frontend/css/customizations.__MERGE__.css +0 -1
  219. package/templates/keywords/styleResults/frontend/js/cob/_styleResults.js +0 -38
  220. package/templates/keywords/styleResults/frontend/js/customizations2.__MERGE__.js +0 -1
  221. package/templates/keywords/styleResults/package.json +0 -3
@@ -1,119 +0,0 @@
1
- <template>
2
- <footer v-if="editLink || lastUpdated" class="page-edit">
3
- <div
4
- v-if="editLink && loggedIn"
5
- class="edit-link"
6
- >
7
- <a
8
- :href="editLink"
9
- target="_blank"
10
- rel="noopener noreferrer"
11
- >
12
- {{ editLinkText }}
13
- <OutboundLink />
14
- </a>
15
- </div>
16
-
17
- <div
18
- v-if="lastUpdated"
19
- class="last-updated"
20
- >
21
- <span class="prefix">{{ lastUpdatedText }}:</span>
22
- <span class="time">{{ lastUpdated }}</span>
23
- </div>
24
- </footer>
25
- </template>
26
-
27
- <script>
28
- import isNil from 'lodash/isNil'
29
- import { umLoggedin } from '@cob/rest-api-wrapper';
30
-
31
- export default {
32
- name: 'PageEdit',
33
-
34
- data: () => ({
35
- userInfo : {},
36
- loggedIn : false
37
- }),
38
- created() {
39
- umLoggedin().then( userInfo => {this.userInfo = userInfo, this.loggedIn=userInfo.username != 'anonymous' }).catch( () => this.loggedIn == false)
40
- },
41
- computed: {
42
- lastUpdated () {
43
- return this.$page.lastUpdated
44
- },
45
-
46
- lastUpdatedText () {
47
- if (typeof this.$themeLocaleConfig.lastUpdated === 'string') {
48
- return this.$themeLocaleConfig.lastUpdated
49
- }
50
- if (typeof this.$site.themeConfig.lastUpdated === 'string') {
51
- return this.$site.themeConfig.lastUpdated
52
- }
53
- return 'Last Updated'
54
- },
55
-
56
- editLink () {
57
- const showEditLink = isNil(this.$page.frontmatter.editLink)
58
- ? this.$site.themeConfig.editLinks
59
- : this.$page.frontmatter.editLink
60
-
61
-
62
- if (showEditLink && this.$page.frontmatter.id) {
63
- return "/recordm/#/instance/" + this.$page.frontmatter.id
64
- }
65
- return null
66
- },
67
-
68
- editLinkText () {
69
- return (
70
- this.$themeLocaleConfig.editLinkText
71
- || this.$site.themeConfig.editLinkText
72
- || `Source`
73
- )
74
- }
75
- }
76
- }
77
- </script>
78
-
79
- <style lang="stylus">
80
- @require '../styles/wrapper.styl'
81
-
82
- .page-edit
83
- @extend $wrapper
84
- padding-top 1rem
85
- padding-bottom 1rem
86
- overflow auto
87
-
88
- .edit-link
89
- display inline-block
90
- a
91
- color lighten($textColor, 75%)
92
- margin-right 0.25rem
93
- .icon.outbound
94
- color lighten($textColor, 75%)
95
- &:hover
96
- .icon.outbound
97
- color lighten($textColor, 15%)
98
- color lighten($textColor, 15%)
99
-
100
- .last-updated
101
- float right
102
- font-size 0.9em
103
- .prefix
104
- font-weight 500
105
- color lighten($textColor, 25%)
106
- .time
107
- font-weight 400
108
- color #767676
109
-
110
- @media (max-width: $MQMobile)
111
- .page-edit
112
- .edit-link
113
- margin-bottom 0.5rem
114
- .last-updated
115
- font-size 0.8em
116
- float none
117
- text-align left
118
-
119
- </style>
@@ -1,163 +0,0 @@
1
- <template>
2
- <div
3
- v-if="prev || next"
4
- class="page-nav"
5
- >
6
- <p class="inner">
7
- <span
8
- v-if="prev"
9
- class="prev"
10
- >
11
-
12
- <a
13
- v-if="prev.type === 'external'"
14
- class="prev"
15
- :href="prev.path"
16
- target="_blank"
17
- rel="noopener noreferrer"
18
- >
19
- {{ prev.title || prev.path }}
20
-
21
- <OutboundLink />
22
- </a>
23
-
24
- <RouterLink
25
- v-else
26
- class="prev"
27
- :to="prev.path"
28
- >
29
- {{ prev.title || prev.path }}
30
- </RouterLink>
31
- </span>
32
-
33
- <span
34
- v-if="next"
35
- class="next"
36
- >
37
- <a
38
- v-if="next.type === 'external'"
39
- :href="next.path"
40
- target="_blank"
41
- rel="noopener noreferrer"
42
- >
43
- {{ next.title || next.path }}
44
-
45
- <OutboundLink />
46
- </a>
47
-
48
- <RouterLink
49
- v-else
50
- :to="next.path"
51
- >
52
- {{ next.title || next.path }}
53
- </RouterLink>
54
-
55
- </span>
56
- </p>
57
- </div>
58
- </template>
59
-
60
- <script>
61
- import { resolvePage } from '../util'
62
- import isString from 'lodash/isString'
63
- import isNil from 'lodash/isNil'
64
-
65
- export default {
66
- name: 'PageNav',
67
-
68
- props: ['sidebarItems'],
69
-
70
- computed: {
71
- prev () {
72
- return resolvePageLink(LINK_TYPES.PREV, this)
73
- },
74
-
75
- next () {
76
- return resolvePageLink(LINK_TYPES.NEXT, this)
77
- }
78
- }
79
- }
80
-
81
- function resolvePrev (page, items) {
82
- return find(page, items, -1)
83
- }
84
-
85
- function resolveNext (page, items) {
86
- return find(page, items, 1)
87
- }
88
-
89
- const LINK_TYPES = {
90
- NEXT: {
91
- resolveLink: resolveNext,
92
- getThemeLinkConfig: ({ nextLinks }) => nextLinks,
93
- getPageLinkConfig: ({ frontmatter }) => frontmatter.next
94
- },
95
- PREV: {
96
- resolveLink: resolvePrev,
97
- getThemeLinkConfig: ({ prevLinks }) => prevLinks,
98
- getPageLinkConfig: ({ frontmatter }) => frontmatter.prev
99
- }
100
- }
101
-
102
- function resolvePageLink (
103
- linkType,
104
- { $themeConfig, $page, $route, $site, sidebarItems }
105
- ) {
106
- const { resolveLink, getThemeLinkConfig, getPageLinkConfig } = linkType
107
-
108
- // Get link config from theme
109
- const themeLinkConfig = getThemeLinkConfig($themeConfig)
110
-
111
- // Get link config from current page
112
- const pageLinkConfig = getPageLinkConfig($page)
113
-
114
- // Page link config will overwrite global theme link config if defined
115
- const link = isNil(pageLinkConfig) ? themeLinkConfig : pageLinkConfig
116
-
117
- if (link === false) {
118
- return
119
- } else if (isString(link)) {
120
- return resolvePage($site.pages, link, $route.path)
121
- } else {
122
- return resolveLink($page, sidebarItems)
123
- }
124
- }
125
-
126
- function find (page, items, offset) {
127
- const res = []
128
- flatten(items, res)
129
- for (let i = 0; i < res.length; i++) {
130
- const cur = res[i]
131
- if (cur.type === 'page' && cur.path === decodeURIComponent(page.path)) {
132
- return res[i + offset]
133
- }
134
- }
135
- }
136
-
137
- function flatten (items, res) {
138
- for (let i = 0, l = items.length; i < l; i++) {
139
- if (items[i].type === 'group') {
140
- flatten(items[i].children || [], res)
141
- } else {
142
- res.push(items[i])
143
- }
144
- }
145
- }
146
- </script>
147
-
148
- <style lang="stylus">
149
- @require '../styles/wrapper.styl'
150
-
151
- .page-nav
152
- @extend $wrapper
153
- padding-top 1rem
154
- padding-bottom 0
155
- .inner
156
- min-height 2rem
157
- margin-top 0
158
- border-top 1px solid $borderColor
159
- padding-top 1rem
160
- overflow auto // clear float
161
- .next
162
- float right
163
- </style>
@@ -1,64 +0,0 @@
1
- <template>
2
- <aside class="sidebar">
3
- <NavLinks />
4
-
5
- <slot name="top" />
6
-
7
- <SidebarLinks
8
- :depth="0"
9
- :items="items"
10
- />
11
- <slot name="bottom" />
12
- </aside>
13
- </template>
14
-
15
- <script>
16
- import SidebarLinks from '@theme/components/SidebarLinks.vue'
17
- import NavLinks from '@theme/components/NavLinks.vue'
18
-
19
- export default {
20
- name: 'Sidebar',
21
-
22
- components: { SidebarLinks, NavLinks },
23
-
24
- props: ['items']
25
- }
26
- </script>
27
-
28
- <style lang="stylus">
29
- .sidebar
30
- ul
31
- padding 0
32
- margin 0
33
- list-style-type none
34
- a
35
- display inline-block
36
- .nav-links
37
- display none
38
- border-bottom 1px solid $borderColor
39
- padding 0.5rem 0 0.75rem 0
40
- a
41
- font-weight 600
42
- .nav-item, .repo-link
43
- display block
44
- line-height 1.25rem
45
- font-size 1.1em
46
- padding 0.5rem 0 0.5rem 1.5rem
47
- & > .sidebar-links
48
- padding 1.5rem 0
49
- & > li > a.sidebar-link
50
- font-size 1.1em
51
- line-height 1.7
52
- font-weight bold
53
- & > li:not(:first-child)
54
- margin-top .75rem
55
-
56
- @media (max-width: $MQMobile)
57
- .sidebar
58
- .nav-links
59
- display block
60
- .dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active::after
61
- top calc(1rem - 2px)
62
- & > .sidebar-links
63
- padding 1rem 0
64
- </style>
@@ -1,40 +0,0 @@
1
- <template>
2
- <div
3
- class="sidebar-button"
4
- @click="$emit('toggle-sidebar')"
5
- >
6
- <svg
7
- class="icon"
8
- xmlns="http://www.w3.org/2000/svg"
9
- aria-hidden="true"
10
- role="img"
11
- viewBox="0 0 448 512"
12
- >
13
- <path
14
- fill="currentColor"
15
- d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"
16
- class=""
17
- />
18
- </svg>
19
- </div>
20
- </template>
21
-
22
- <style lang="stylus">
23
- .sidebar-button
24
- cursor pointer
25
- display none
26
- width 1.25rem
27
- height 1.25rem
28
- position absolute
29
- padding 0.6rem
30
- top 0.6rem
31
- left 1rem
32
- .icon
33
- display block
34
- width 1.25rem
35
- height 1.25rem
36
-
37
- @media (max-width: $MQMobile)
38
- .sidebar-button
39
- display block
40
- </style>
@@ -1,144 +0,0 @@
1
- <template>
2
- <section
3
- class="sidebar-group"
4
- :class="[
5
- {
6
- collapsable,
7
- 'is-sub-group': depth !== 0
8
- },
9
- `depth-${depth}`
10
- ]"
11
- >
12
- <RouterLink
13
- v-if="item.path"
14
- class="sidebar-heading clickable"
15
- :class="{
16
- open,
17
- 'active': isActive($route, item.path)
18
- }"
19
- :to="item.path"
20
- @click.native="$emit('toggle')"
21
- >
22
- <span>{{ item.title }}</span>
23
- <span
24
- v-if="collapsable"
25
- class="arrow"
26
- :class="open ? 'down' : 'right'"
27
- />
28
- </RouterLink>
29
-
30
- <p
31
- v-else
32
- class="sidebar-heading"
33
- :class="{ open }"
34
- @click="$emit('toggle')"
35
- >
36
- <span>{{ item.title }}</span>
37
- <span
38
- v-if="collapsable"
39
- class="arrow"
40
- :class="open ? 'down' : 'right'"
41
- />
42
- </p>
43
-
44
- <DropdownTransition>
45
- <SidebarLinks
46
- v-if="open || !collapsable"
47
- class="sidebar-group-items"
48
- :items="item.children"
49
- :sidebar-depth="item.sidebarDepth"
50
- :initial-open-group-index="item.initialOpenGroupIndex"
51
- :depth="depth + 1"
52
- />
53
- </DropdownTransition>
54
- </section>
55
- </template>
56
-
57
- <script>
58
- import { isActive } from '../util'
59
- import DropdownTransition from '@theme/components/DropdownTransition.vue'
60
-
61
- export default {
62
- name: 'SidebarGroup',
63
-
64
- components: {
65
- DropdownTransition
66
- },
67
-
68
- props: [
69
- 'item',
70
- 'open',
71
- 'collapsable',
72
- 'depth'
73
- ],
74
-
75
- // ref: https://vuejs.org/v2/guide/components-edge-cases.html#Circular-References-Between-Components
76
- beforeCreate () {
77
- this.$options.components.SidebarLinks = require('@theme/components/SidebarLinks.vue').default
78
- },
79
-
80
- methods: { isActive }
81
- }
82
- </script>
83
-
84
- <style lang="stylus">
85
- .sidebar-group
86
- .sidebar-group
87
- padding-left 0.5em
88
- &:not(.collapsable)
89
- .sidebar-heading:not(.clickable)
90
- cursor auto
91
- color inherit
92
- // refine styles of nested sidebar groups
93
- &.is-sub-group
94
- padding-left 0
95
- & > .sidebar-heading
96
- font-size 0.95em
97
- line-height 1.4
98
- font-weight normal
99
- padding-left 2rem
100
- font-size 1em
101
- font-weight 400
102
- &.active
103
- font-weight 600
104
- color $accentColor
105
- border-left-color $accentColor
106
- &:not(.clickable)
107
- opacity 0.5
108
- & > .sidebar-group-items
109
- padding-left 1rem
110
- & > li > .sidebar-link
111
- font-size 0.95em
112
- border-left none
113
- &.depth-2
114
- & > .sidebar-heading
115
- border-left none
116
-
117
- .sidebar-heading
118
- color $textColor
119
- transition color .15s ease
120
- cursor pointer
121
- font-size 1.1em
122
- font-weight bold
123
- // text-transform uppercase
124
- padding 0.35rem 1.5rem 0.35rem 1.25rem
125
- width 100%
126
- box-sizing border-box
127
- margin 0
128
- border-left 0.25rem solid transparent
129
- &.open, &:hover
130
- color inherit
131
- .arrow
132
- display none
133
- &.clickable
134
- &.active
135
- color $accentColor
136
- border-left-color $accentColor
137
- &:hover
138
- color $accentColor
139
-
140
- .sidebar-group-items
141
- transition height .1s ease-out
142
- font-size 0.95em
143
- overflow hidden
144
- </style>
@@ -1,140 +0,0 @@
1
- <script>
2
- import { isActive, hashRE, groupHeaders } from '../util'
3
-
4
- export default {
5
- functional: true,
6
-
7
- props: ['item', 'sidebarDepth','hide'],
8
-
9
- render (h,
10
- {
11
- parent: {
12
- $page,
13
- $site,
14
- $route,
15
- $themeConfig,
16
- $themeLocaleConfig
17
- },
18
- props: {
19
- item,
20
- sidebarDepth,
21
- hide
22
- }
23
- }) {
24
- // use custom active class matching logic
25
- // due to edge case of paths ending with / + hash
26
- const selfActive = isActive($route, item.path)
27
- // for sidebar: auto pages, a hash link should be active if one of its child
28
- // matches
29
- const active = item.type === 'auto'
30
- ? selfActive || item.children.some(c => isActive($route, item.basePath + '#' + c.slug))
31
- : selfActive
32
-
33
- const link = item.type === 'external'
34
- ? renderExternal(h, item.path, item.title || item.path)
35
- : renderLink(h, item.path, item.title || item.path, active, hide)
36
-
37
- const maxDepth = [
38
- $page.frontmatter.sidebarDepth,
39
- sidebarDepth,
40
- $themeLocaleConfig.sidebarDepth,
41
- $themeConfig.sidebarDepth,
42
- 1
43
- ].find(depth => depth !== undefined)
44
-
45
- const displayAllHeaders = $themeLocaleConfig.displayAllHeaders
46
- || $themeConfig.displayAllHeaders
47
-
48
- if (item.type === 'auto') {
49
- return [link, renderChildren(h, item.children, item.basePath, $route, maxDepth, hide)]
50
- } else if ((active || displayAllHeaders) && item.headers && !hashRE.test(item.path)) {
51
- const children = groupHeaders(item.headers)
52
- return [link, renderChildren(h, children, item.path, $route, maxDepth, hide)]
53
- } else {
54
- return link
55
- }
56
- }
57
- }
58
-
59
- function renderLink (h, to, text, active, hide, level) {
60
- const component = {
61
- props: {
62
- to,
63
- activeClass: '',
64
- exactActiveClass: ''
65
- },
66
- class: {
67
- active,
68
- 'sidebar-link': true,
69
- 'hide': hide
70
- }
71
- }
72
-
73
- if (level > 2) {
74
- component.style = {
75
- 'padding-left': level + 'rem'
76
- }
77
- }
78
-
79
- return h('RouterLink', component, text)
80
- }
81
-
82
- function renderChildren (h, children, path, route, maxDepth, hide, depth = 1) {
83
- if (!children || depth > maxDepth) return null
84
- return h('ul', { class: 'sidebar-sub-headers' }, children.map(c => {
85
- const active = isActive(route, path + '#' + c.slug)
86
-
87
- return h('li', { class: 'sidebar-sub-header' }, [
88
- renderLink(h, path + '#' + c.slug, c.title, active, hide, c.level - 1),
89
- renderChildren(h, c.children, path, route, maxDepth, hide, depth + 1)
90
- ])
91
- }))
92
- }
93
-
94
- function renderExternal (h, to, text) {
95
- return h('a', {
96
- attrs: {
97
- href: to,
98
- target: '_blank',
99
- rel: 'noopener noreferrer'
100
- },
101
- class: {
102
- 'sidebar-link': true
103
- }
104
- }, [text, h('OutboundLink')])
105
- }
106
- </script>
107
-
108
- <style lang="stylus">
109
- .sidebar .sidebar-sub-headers
110
- padding-left 1rem
111
- font-size 0.95em
112
-
113
- a.sidebar-link.hide
114
- display: none
115
-
116
- a.sidebar-link
117
- font-size 1em
118
- font-weight 400
119
- display inline-block
120
- color $textColor
121
- border-left 0.25rem solid transparent
122
- padding 0.35rem 1rem 0.35rem 1.25rem
123
- line-height 1.4
124
- width: 100%
125
- box-sizing: border-box
126
- &:hover
127
- color $accentColor
128
- &.active
129
- font-weight 600
130
- color $accentColor
131
- border-left-color $accentColor
132
- .sidebar-group &
133
- padding-left 2rem
134
- .sidebar-sub-headers &
135
- padding-top 0.25rem
136
- padding-bottom 0.25rem
137
- border-left none
138
- &.active
139
- font-weight 500
140
- </style>