@pb33f/cowboy-components 0.0.13 → 0.1.0
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/dist/abap-DXvTa7XC.js +1404 -0
- package/dist/apex-DsQH3mjJ.js +332 -0
- package/dist/assets/css.worker-B_qZXUzt.js +84 -0
- package/dist/assets/editor.worker-HEmB0D7P.js +11 -0
- package/dist/assets/html.worker-D3WUrk8Q.js +458 -0
- package/dist/assets/json.worker-CAhUaBo4.js +42 -0
- package/dist/assets/rule-documentation.worker-BFIxMBU8.js +1 -0
- package/dist/assets/search-problems.worker-VJi4P9Gj.js +1 -0
- package/dist/azcli-Cir32SBk.js +74 -0
- package/dist/bat-BsNExolo.js +106 -0
- package/dist/bicep-2KcKzeQF.js +108 -0
- package/dist/cameligo-D0ezznwE.js +180 -0
- package/dist/clojure-DxYzAIlu.js +767 -0
- package/dist/coffee-DgiPTF3g.js +238 -0
- package/dist/components/changelog/release.css.js +3 -3
- package/dist/components/editor/editor.d.ts +27 -0
- package/dist/components/editor/editor.js +192 -0
- package/dist/components/error-banner/error-banner.css.d.ts +2 -0
- package/dist/components/error-banner/error-banner.css.js +23 -0
- package/dist/components/error-banner/error-banner.d.ts +9 -0
- package/dist/components/error-banner/error-banner.js +40 -0
- package/dist/components/kv-view/kv-view.css.js +4 -0
- package/dist/components/paginator/paginator-events.d.ts +4 -0
- package/dist/components/paginator/paginator-events.js +4 -0
- package/dist/components/paginator/paginator-navigator.css.d.ts +2 -0
- package/dist/components/paginator/paginator-navigator.css.js +35 -0
- package/dist/components/paginator/paginator-navigator.d.ts +27 -0
- package/dist/components/paginator/paginator-navigator.js +168 -0
- package/dist/components/paginator/paginator.css.d.ts +2 -0
- package/dist/components/paginator/paginator.css.js +38 -0
- package/dist/components/paginator/paginator.d.ts +22 -0
- package/dist/components/paginator/paginator.js +122 -0
- package/dist/components/percent-bar/percent-bar.css.d.ts +2 -0
- package/dist/components/percent-bar/percent-bar.css.js +65 -0
- package/dist/components/percent-bar/percent-bar.d.ts +11 -0
- package/dist/components/percent-bar/percent-bar.js +85 -0
- package/dist/components/problem-list/details-drawer.css.d.ts +2 -0
- package/dist/components/problem-list/details-drawer.css.js +42 -0
- package/dist/components/problem-list/details-drawer.d.ts +22 -0
- package/dist/components/problem-list/details-drawer.js +66 -0
- package/dist/components/problem-list/filter.css.d.ts +2 -0
- package/dist/components/problem-list/filter.css.js +67 -0
- package/dist/components/problem-list/problem-item.css.d.ts +2 -0
- package/dist/components/problem-list/problem-item.css.js +170 -0
- package/dist/components/problem-list/problem-item.d.ts +27 -0
- package/dist/components/problem-list/problem-item.js +126 -0
- package/dist/components/problem-list/problem-label-view-filter.css.d.ts +2 -0
- package/dist/components/problem-list/problem-label-view-filter.css.js +6 -0
- package/dist/components/problem-list/problem-label-view-filter.d.ts +18 -0
- package/dist/components/problem-list/problem-label-view-filter.js +66 -0
- package/dist/components/problem-list/problem-list.css.d.ts +2 -0
- package/dist/components/problem-list/problem-list.css.js +59 -0
- package/dist/components/problem-list/problem-list.d.ts +37 -0
- package/dist/components/problem-list/problem-list.js +334 -0
- package/dist/components/problem-list/problem-mainview.css.d.ts +2 -0
- package/dist/components/problem-list/problem-mainview.css.js +100 -0
- package/dist/components/problem-list/problem-mainview.d.ts +20 -0
- package/dist/components/problem-list/problem-mainview.js +126 -0
- package/dist/components/problem-list/problem-rule-filter.d.ts +13 -0
- package/dist/components/problem-list/problem-rule-filter.js +67 -0
- package/dist/components/problem-list/problem-search-filter.d.ts +13 -0
- package/dist/components/problem-list/problem-search-filter.js +45 -0
- package/dist/components/problem-list/problem-sort-filter.d.ts +19 -0
- package/dist/components/problem-list/problem-sort-filter.js +67 -0
- package/dist/components/problem-list/problem-toolbar.css.d.ts +2 -0
- package/dist/components/problem-list/problem-toolbar.css.js +41 -0
- package/dist/components/problem-list/problem-toolbar.d.ts +14 -0
- package/dist/components/problem-list/problem-toolbar.js +63 -0
- package/dist/components/problem-list/shared.css.d.ts +2 -0
- package/dist/components/problem-list/shared.css.js +91 -0
- package/dist/components/problems-overview/diagnostic-evaluation.css.d.ts +2 -0
- package/dist/components/problems-overview/diagnostic-evaluation.css.js +178 -0
- package/dist/components/problems-overview/diagnostic-evaluation.d.ts +13 -0
- package/dist/components/problems-overview/diagnostic-evaluation.js +119 -0
- package/dist/components/problems-overview/document-statistic.css.d.ts +2 -0
- package/dist/components/problems-overview/document-statistic.css.js +16 -0
- package/dist/components/problems-overview/document-statistic.d.ts +10 -0
- package/dist/components/problems-overview/document-statistic.js +49 -0
- package/dist/components/problems-overview/problem-overview-group.css.d.ts +2 -0
- package/dist/components/problems-overview/problem-overview-group.css.js +84 -0
- package/dist/components/problems-overview/problem-overview-group.d.ts +17 -0
- package/dist/components/problems-overview/problem-overview-group.js +121 -0
- package/dist/components/problems-overview/problem-statistic.css.d.ts +2 -0
- package/dist/components/problems-overview/problem-statistic.css.js +40 -0
- package/dist/components/problems-overview/problem-statistic.d.ts +11 -0
- package/dist/components/problems-overview/problem-statistic.js +57 -0
- package/dist/components/problems-overview/problem-statistics.css.d.ts +2 -0
- package/dist/components/problems-overview/problem-statistics.css.js +46 -0
- package/dist/components/problems-overview/problem-statistics.d.ts +14 -0
- package/dist/components/problems-overview/problem-statistics.js +132 -0
- package/dist/components/problems-overview/problems-overview.css.d.ts +2 -0
- package/dist/components/problems-overview/problems-overview.css.js +49 -0
- package/dist/components/problems-overview/problems-overview.d.ts +21 -0
- package/dist/components/problems-overview/problems-overview.js +108 -0
- package/dist/components/render-json-path/render-json-path.css.d.ts +2 -0
- package/dist/components/render-json-path/render-json-path.css.js +86 -0
- package/dist/components/render-json-path/render-json-path.d.ts +11 -0
- package/dist/components/render-json-path/render-json-path.js +105 -0
- package/dist/components/the-doctor/settings.d.ts +5 -0
- package/dist/components/the-doctor/settings.js +22 -0
- package/dist/components/the-doctor/status-bar.css.d.ts +2 -0
- package/dist/components/the-doctor/status-bar.css.js +47 -0
- package/dist/components/the-doctor/status-bar.d.ts +12 -0
- package/dist/components/the-doctor/status-bar.js +71 -0
- package/dist/components/the-doctor/the-doctor.css.d.ts +2 -0
- package/dist/components/the-doctor/the-doctor.css.js +156 -0
- package/dist/components/the-doctor/the-doctor.d.ts +57 -0
- package/dist/components/the-doctor/the-doctor.js +340 -0
- package/dist/cowboy-components-FcPnnXMU.js +114388 -0
- package/dist/cowboy-components.d.ts +5 -2
- package/dist/cowboy-components.js +8 -2
- package/dist/cowboy-components.umd.cjs +4004 -106
- package/dist/cpp-Bq-GnYlH.js +407 -0
- package/dist/csharp-IDcibKAT.js +332 -0
- package/dist/csp-QdYr8JWa.js +59 -0
- package/dist/css/button.css.d.ts +2 -0
- package/dist/css/button.css.js +34 -0
- package/dist/css/chroma-synxtax.css.d.ts +2 -0
- package/dist/css/chroma-synxtax.css.js +130 -0
- package/dist/css/cowboy-components.css +3 -0
- package/dist/css/links.css.d.ts +2 -0
- package/dist/css/links.css.js +17 -0
- package/dist/css/lists.css.d.ts +2 -0
- package/dist/css/lists.css.js +43 -0
- package/dist/css/pb33f-theme.css +2 -2
- package/dist/css/syntax.css.js +1 -1
- package/dist/css-C-wMMefI.js +193 -0
- package/dist/cssMode-DcUlnXpV.js +1541 -0
- package/dist/cypher-BfBo9yir.js +269 -0
- package/dist/dart-Cv3rVfv_.js +287 -0
- package/dist/dockerfile-DyCXBGhV.js +136 -0
- package/dist/ecl-COP_iObm.js +462 -0
- package/dist/elixir-DoEhbk9F.js +575 -0
- package/dist/events/doctor.d.ts +51 -0
- package/dist/events/doctor.js +17 -0
- package/dist/flow9-DuHGSNW1.js +148 -0
- package/dist/freemarker2-sY6FVddl.js +995 -0
- package/dist/fsharp-Dv9PDxVO.js +223 -0
- package/dist/go-CcdAeqiK.js +224 -0
- package/dist/graphql-CoRm4b1H.js +157 -0
- package/dist/handlebars-BqznQEC5.js +425 -0
- package/dist/hcl-BSgAhV5f.js +189 -0
- package/dist/html-DBpY_ZT1.js +314 -0
- package/dist/htmlMode-Cf0lYQWN.js +1551 -0
- package/dist/ini-ewx9HLIq.js +77 -0
- package/dist/java-B5lwcbTy.js +238 -0
- package/dist/javascript-DRgEI2Yf.js +76 -0
- package/dist/jsonMode-CmuECwTh.js +1958 -0
- package/dist/julia-NCcg_P_q.js +517 -0
- package/dist/kotlin-BYlnmGrb.js +259 -0
- package/dist/less-DG4tqgOo.js +168 -0
- package/dist/lexon-CTTPcJLv.js +163 -0
- package/dist/liquid-DWVJYCIL.js +246 -0
- package/dist/lua-CxQ1RWuo.js +168 -0
- package/dist/m3-mHFfpmgx.js +216 -0
- package/dist/markdown-Dh6sYULt.js +235 -0
- package/dist/mdx-Bjcj5AvL.js +171 -0
- package/dist/mips-CNUcjHD1.js +204 -0
- package/dist/model/document-statistics.d.ts +40 -0
- package/dist/model/document-statistics.js +4 -0
- package/dist/model/how_to_fix.d.ts +4 -0
- package/dist/model/how_to_fix.js +1 -0
- package/dist/model/problem.d.ts +19 -0
- package/dist/model/problem.js +106 -0
- package/dist/model/rule_documentation.d.ts +5 -0
- package/dist/model/rule_documentation.js +1 -0
- package/dist/model/session.d.ts +5 -0
- package/dist/model/session.js +1 -0
- package/dist/msdax-ZvxFeKvs.js +381 -0
- package/dist/mysql-COjg31sJ.js +884 -0
- package/dist/objective-c-BqrCFBhT.js +189 -0
- package/dist/pascal-CUpkilAS.js +257 -0
- package/dist/pascaligo-nJfvRJ7x.js +170 -0
- package/dist/perl-CWsX6Ysg.js +632 -0
- package/dist/pgsql-DwgpEXC8.js +857 -0
- package/dist/php-CrbKyd62.js +506 -0
- package/dist/pla-JxXT6Kb-.js +143 -0
- package/dist/postiats-BOdnTRGv.js +913 -0
- package/dist/powerquery-DTkwcXGH.js +896 -0
- package/dist/powershell-Cx53dGpt.js +245 -0
- package/dist/protobuf-Dp9vE-l-.js +426 -0
- package/dist/pug-BSjKVjwP.js +408 -0
- package/dist/python-CiN6iAi3.js +282 -0
- package/dist/qsharp-C5P1RxY3.js +291 -0
- package/dist/r-sEMYnclc.js +249 -0
- package/dist/razor-B4jDf_4z.js +556 -0
- package/dist/redis-DbzUc-fU.js +308 -0
- package/dist/redshift-nrLijj1O.js +815 -0
- package/dist/restructuredtext-CIbGUl6T.js +180 -0
- package/dist/ruby-JcYJisWg.js +517 -0
- package/dist/rust-BgbFBFXH.js +349 -0
- package/dist/sb-hRFFChi7.js +121 -0
- package/dist/scala-Cs0yVo3Q.js +376 -0
- package/dist/scheme-l_0jNtxy.js +114 -0
- package/dist/scss-C4l7ZIRR.js +268 -0
- package/dist/services/linting-service.d.ts +12 -0
- package/dist/services/linting-service.js +121 -0
- package/dist/shell-ikLk_l24.js +227 -0
- package/dist/solidity-4GxCaH9e.js +1373 -0
- package/dist/sophia-tX0WEZsZ.js +205 -0
- package/dist/sparql-D7ky-uMk.js +207 -0
- package/dist/sql-CqEfBVGS.js +859 -0
- package/dist/st-CNWQPqyI.js +422 -0
- package/dist/style.css +1 -1
- package/dist/swift-C_fDfC0d.js +318 -0
- package/dist/systemverilog-gAvsEtN_.js +582 -0
- package/dist/tcl-KbBChuA6.js +238 -0
- package/dist/tsMode-29i0IHrU.js +886 -0
- package/dist/twig-Bb652BpM.js +398 -0
- package/dist/typescript-FDohSLaF.js +349 -0
- package/dist/vb-2e5hSeUh.js +378 -0
- package/dist/wgsl-CYSDq0zg.js +445 -0
- package/dist/workers/rule-documentation.worker.d.ts +1 -0
- package/dist/workers/rule-documentation.worker.js +85 -0
- package/dist/workers/search-problems.worker.d.ts +1 -0
- package/dist/workers/search-problems.worker.js +19 -0
- package/dist/xml-BdgdiRK4.js +101 -0
- package/dist/yaml-CJDq-Ud3.js +212 -0
- package/package.json +6 -4
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { customElement, property, query, state } from "lit/decorators.js";
|
|
8
|
+
import { html, LitElement } from "lit";
|
|
9
|
+
import paginatorNavigatorCss from "./paginator-navigator.css";
|
|
10
|
+
import { PaginatorFirstPage, PaginatorLastPage, PaginatorNextPage, PaginatorPreviousPage } from "@/components/paginator/paginator-events";
|
|
11
|
+
import "@shoelace-style/shoelace/dist/components/format-number/format-number.js";
|
|
12
|
+
let PaginatorNavigation = class PaginatorNavigation extends LitElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
this.currentPage = 1;
|
|
16
|
+
this.totalPages = 0;
|
|
17
|
+
this.totalItems = 0;
|
|
18
|
+
this.itemsPerPage = 20;
|
|
19
|
+
this.label = "Problems";
|
|
20
|
+
}
|
|
21
|
+
getRangeStart() {
|
|
22
|
+
let res = (this.currentPage * this.itemsPerPage) - this.itemsPerPage;
|
|
23
|
+
if (res == 0) {
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
26
|
+
if (res > 0) {
|
|
27
|
+
return res;
|
|
28
|
+
}
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
31
|
+
getPagesRemaining() {
|
|
32
|
+
let res = this.totalItems - (this.currentPage * this.itemsPerPage);
|
|
33
|
+
if (res > 0) {
|
|
34
|
+
return res;
|
|
35
|
+
}
|
|
36
|
+
return 0;
|
|
37
|
+
}
|
|
38
|
+
getRangeEnd() {
|
|
39
|
+
let start = this.getRangeStart();
|
|
40
|
+
if (start == 1) {
|
|
41
|
+
start = 0;
|
|
42
|
+
}
|
|
43
|
+
let res = start + this.itemsPerPage;
|
|
44
|
+
if (res > this.totalItems) {
|
|
45
|
+
return this.totalItems;
|
|
46
|
+
}
|
|
47
|
+
if (res >= 0) {
|
|
48
|
+
return res;
|
|
49
|
+
}
|
|
50
|
+
return 0;
|
|
51
|
+
}
|
|
52
|
+
nextPage() {
|
|
53
|
+
if (this.currentPage < this.totalPages) {
|
|
54
|
+
this.dispatchEvent(new CustomEvent(PaginatorNextPage, {
|
|
55
|
+
composed: true,
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
previousPage() {
|
|
60
|
+
if (this.currentPage > 1) {
|
|
61
|
+
this.dispatchEvent(new CustomEvent(PaginatorPreviousPage, {
|
|
62
|
+
composed: true,
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
lastPage() {
|
|
67
|
+
if (this.currentPage < this.totalPages) {
|
|
68
|
+
this.dispatchEvent(new CustomEvent(PaginatorLastPage, {
|
|
69
|
+
composed: true,
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
firstPage() {
|
|
74
|
+
if (this.currentPage > 1) {
|
|
75
|
+
this.dispatchEvent(new CustomEvent(PaginatorFirstPage, {
|
|
76
|
+
composed: true,
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
togglePrev(toggle) {
|
|
81
|
+
if (this.homeButton) {
|
|
82
|
+
this.prevButton.disabled = toggle;
|
|
83
|
+
this.homeButton.disabled = toggle;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
toggleNext(toggle) {
|
|
87
|
+
if (this.endButton) {
|
|
88
|
+
this.nextButton.disabled = toggle;
|
|
89
|
+
this.endButton.disabled = toggle;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
render() {
|
|
93
|
+
if (this.currentPage == 1) {
|
|
94
|
+
this.togglePrev(true);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
this.togglePrev(false);
|
|
98
|
+
}
|
|
99
|
+
if (this.currentPage == this.totalPages) {
|
|
100
|
+
this.toggleNext(true);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
this.toggleNext(false);
|
|
104
|
+
}
|
|
105
|
+
if (this.totalItems <= this.itemsPerPage) {
|
|
106
|
+
this.hide = true;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
this.hide = false;
|
|
110
|
+
}
|
|
111
|
+
return html `
|
|
112
|
+
<div class="paginator-navigation ${this.hide ? 'hide' : ''}">
|
|
113
|
+
<div>
|
|
114
|
+
<sl-icon-button @click=${this.firstPage} name="chevron-double-left" class="home" title="first page" disabled>
|
|
115
|
+
</sl-icon-button>
|
|
116
|
+
<sl-icon-button @click=${this.previousPage} name="chevron-left" title="previous page" class="previous" disabled>
|
|
117
|
+
</sl-icon-button>
|
|
118
|
+
</div>
|
|
119
|
+
<div class="location">Page
|
|
120
|
+
<strong class="current-page">${this.currentPage}</strong> of
|
|
121
|
+
<strong class="total-pages">${this.totalPages}</strong>
|
|
122
|
+
</div>
|
|
123
|
+
<div class="result-range">
|
|
124
|
+
${this.label} ${this.getRangeStart() + 1} - ${this.getRangeEnd()} of <strong class="total">
|
|
125
|
+
<sl-format-number value="${this.totalItems}"></sl-format-number></strong>
|
|
126
|
+
</div>
|
|
127
|
+
<div>
|
|
128
|
+
<sl-icon-button @click=${this.nextPage} name="chevron-right" title="next page" class="next">
|
|
129
|
+
</sl-icon-button>
|
|
130
|
+
<sl-icon-button @click=${this.lastPage} name="chevron-double-right" title="last page" class="end">
|
|
131
|
+
</sl-icon-button>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
`;
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
PaginatorNavigation.styles = [paginatorNavigatorCss];
|
|
138
|
+
__decorate([
|
|
139
|
+
state()
|
|
140
|
+
], PaginatorNavigation.prototype, "currentPage", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
state()
|
|
143
|
+
], PaginatorNavigation.prototype, "totalPages", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
state()
|
|
146
|
+
], PaginatorNavigation.prototype, "totalItems", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
state()
|
|
149
|
+
], PaginatorNavigation.prototype, "itemsPerPage", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
query('.home')
|
|
152
|
+
], PaginatorNavigation.prototype, "homeButton", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
query('.previous')
|
|
155
|
+
], PaginatorNavigation.prototype, "prevButton", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
query('.next')
|
|
158
|
+
], PaginatorNavigation.prototype, "nextButton", void 0);
|
|
159
|
+
__decorate([
|
|
160
|
+
query('.end')
|
|
161
|
+
], PaginatorNavigation.prototype, "endButton", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
property()
|
|
164
|
+
], PaginatorNavigation.prototype, "label", void 0);
|
|
165
|
+
PaginatorNavigation = __decorate([
|
|
166
|
+
customElement("pb33f-paginator")
|
|
167
|
+
], PaginatorNavigation);
|
|
168
|
+
export { PaginatorNavigation };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export default css `
|
|
3
|
+
|
|
4
|
+
.paginator-values {
|
|
5
|
+
overflow-y: auto;
|
|
6
|
+
max-height: calc(100vh - 460px);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.paginator-values::-webkit-scrollbar {
|
|
10
|
+
width: 8px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.paginator-values::-webkit-scrollbar-track {
|
|
14
|
+
background-color: black;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.paginator-values::-webkit-scrollbar-thumb {
|
|
18
|
+
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
|
19
|
+
background: var(--secondary-color-lowalpha);
|
|
20
|
+
padding: var(--global-padding);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.no-values {
|
|
24
|
+
width: 400px;
|
|
25
|
+
margin: 50px auto;
|
|
26
|
+
text-align: center;
|
|
27
|
+
font-size: 1.9em;
|
|
28
|
+
color: var(--font-color-sub3);
|
|
29
|
+
font-family: var(--font-stack-bold), monospace;
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.no-values sl-icon {
|
|
34
|
+
margin-bottom: 30px;
|
|
35
|
+
font-size: 5em;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
`;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export declare class Paginator extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
values: LitElement[];
|
|
5
|
+
currentPage: number;
|
|
6
|
+
totalPages: number;
|
|
7
|
+
totalItems: number;
|
|
8
|
+
itemsPerPage: number;
|
|
9
|
+
label: string;
|
|
10
|
+
activeIndex: number;
|
|
11
|
+
private renderValues;
|
|
12
|
+
private paginatorNavigator;
|
|
13
|
+
constructor();
|
|
14
|
+
nextPage(event: CustomEvent): void;
|
|
15
|
+
lastPage(event: CustomEvent): void;
|
|
16
|
+
firstPage(event: CustomEvent): void;
|
|
17
|
+
setPage(item: number): void;
|
|
18
|
+
previousPage(event: CustomEvent): void;
|
|
19
|
+
calcTotalPages(): number;
|
|
20
|
+
protected willUpdate(): void;
|
|
21
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { customElement, property } from "lit/decorators.js";
|
|
8
|
+
import { html, LitElement } from "lit";
|
|
9
|
+
import { PaginatorNavigation } from "@/components/paginator/paginator-navigator";
|
|
10
|
+
import { PaginatorFirstPage, PaginatorLastPage, PaginatorNextPage, PaginatorPreviousPage } from "@/components/paginator/paginator-events";
|
|
11
|
+
import paginatorCss from "./paginator.css";
|
|
12
|
+
let Paginator = class Paginator extends LitElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
this.currentPage = 1;
|
|
16
|
+
this.totalPages = 1;
|
|
17
|
+
this.totalItems = 0;
|
|
18
|
+
this.itemsPerPage = 20;
|
|
19
|
+
this.activeIndex = 0;
|
|
20
|
+
this.paginatorNavigator = new PaginatorNavigation();
|
|
21
|
+
this.paginatorNavigator.currentPage = this.currentPage;
|
|
22
|
+
this.paginatorNavigator.totalPages = this.totalPages;
|
|
23
|
+
this.paginatorNavigator.totalItems = this.totalItems;
|
|
24
|
+
this.paginatorNavigator.itemsPerPage = this.itemsPerPage;
|
|
25
|
+
//@ts-ignore
|
|
26
|
+
this.addEventListener(PaginatorFirstPage, this.firstPage);
|
|
27
|
+
//@ts-ignore
|
|
28
|
+
this.addEventListener(PaginatorLastPage, this.lastPage);
|
|
29
|
+
//@ts-ignore
|
|
30
|
+
this.addEventListener(PaginatorNextPage, this.nextPage);
|
|
31
|
+
//@ts-ignore
|
|
32
|
+
this.addEventListener(PaginatorPreviousPage, this.previousPage);
|
|
33
|
+
}
|
|
34
|
+
nextPage(event) {
|
|
35
|
+
event.stopPropagation();
|
|
36
|
+
if (this.currentPage < this.totalPages) {
|
|
37
|
+
this.currentPage++;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
lastPage(event) {
|
|
41
|
+
event.stopPropagation();
|
|
42
|
+
if (this.currentPage < this.totalPages) {
|
|
43
|
+
this.currentPage = this.totalPages;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
firstPage(event) {
|
|
47
|
+
event.stopPropagation();
|
|
48
|
+
if (this.currentPage > 1) {
|
|
49
|
+
this.currentPage = 1;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
setPage(item) {
|
|
53
|
+
this.currentPage = Math.ceil(item / this.itemsPerPage);
|
|
54
|
+
this.activeIndex = item;
|
|
55
|
+
}
|
|
56
|
+
previousPage(event) {
|
|
57
|
+
event.stopPropagation();
|
|
58
|
+
if (this.currentPage > 1) {
|
|
59
|
+
this.currentPage--;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
calcTotalPages() {
|
|
63
|
+
return Math.ceil(this.totalItems / this.itemsPerPage);
|
|
64
|
+
}
|
|
65
|
+
willUpdate() {
|
|
66
|
+
this.totalItems = this.values?.length;
|
|
67
|
+
this.totalPages = this.calcTotalPages();
|
|
68
|
+
if (this.activeIndex > 0 && this.totalPages > 1) {
|
|
69
|
+
this.paginatorNavigator.currentPage = this.currentPage;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this.paginatorNavigator.currentPage = this.currentPage;
|
|
73
|
+
}
|
|
74
|
+
this.paginatorNavigator.totalItems = this.values?.length;
|
|
75
|
+
this.paginatorNavigator.itemsPerPage = this.itemsPerPage;
|
|
76
|
+
this.paginatorNavigator.totalPages = this.totalPages;
|
|
77
|
+
if (this.label) {
|
|
78
|
+
this.paginatorNavigator.label = this.label;
|
|
79
|
+
}
|
|
80
|
+
this.renderValues = this.values?.slice(this.paginatorNavigator.getRangeStart(), this.paginatorNavigator.getRangeEnd());
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
if (this.renderValues?.length === 0 || !this.renderValues) {
|
|
84
|
+
return html `<div class="no-values">
|
|
85
|
+
<sl-icon name="x-square"></sl-icon><br/>
|
|
86
|
+
no results
|
|
87
|
+
</div>`;
|
|
88
|
+
}
|
|
89
|
+
return html `
|
|
90
|
+
${this.paginatorNavigator}
|
|
91
|
+
<div class="paginator-values" part="values">
|
|
92
|
+
${this.renderValues}
|
|
93
|
+
</div>
|
|
94
|
+
`;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
Paginator.styles = [paginatorCss];
|
|
98
|
+
__decorate([
|
|
99
|
+
property({ type: LitElement })
|
|
100
|
+
], Paginator.prototype, "values", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
property({ type: Number })
|
|
103
|
+
], Paginator.prototype, "currentPage", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
property({ type: Number })
|
|
106
|
+
], Paginator.prototype, "totalPages", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
property({ type: Number })
|
|
109
|
+
], Paginator.prototype, "totalItems", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
property({ type: Number })
|
|
112
|
+
], Paginator.prototype, "itemsPerPage", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
property()
|
|
115
|
+
], Paginator.prototype, "label", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
property()
|
|
118
|
+
], Paginator.prototype, "activeIndex", void 0);
|
|
119
|
+
Paginator = __decorate([
|
|
120
|
+
customElement("pb33f-paginator-navigation")
|
|
121
|
+
], Paginator);
|
|
122
|
+
export { Paginator };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export default css `
|
|
3
|
+
.bar {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: row;
|
|
6
|
+
margin: 10px 0 10px 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.bar svg {
|
|
10
|
+
width: calc(100% - 47px);
|
|
11
|
+
border: 1px solid var(--primary-color)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
.percent {
|
|
16
|
+
width: 40px;
|
|
17
|
+
margin-left: 5px;
|
|
18
|
+
font-size: 0.8rem;
|
|
19
|
+
text-align: center;
|
|
20
|
+
color: var(--primary-color);
|
|
21
|
+
border: 1px solid var(--primary-color);
|
|
22
|
+
text-shadow: 0 0 1rem var(--primary-color);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.percent span {
|
|
26
|
+
line-height: normal;
|
|
27
|
+
display: inline-block;
|
|
28
|
+
font-family: var(--font-stack-bold), monospace;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.success {
|
|
32
|
+
border: 1px solid var(--terminal-text);
|
|
33
|
+
color: var(--terminal-text);
|
|
34
|
+
text-shadow: 0 0 1rem var(--terminal-text);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.bar svg.success {
|
|
38
|
+
border: 1px solid var(--terminal-text);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.warning {
|
|
42
|
+
border: 1px solid var(--warn-color);
|
|
43
|
+
color: var(--warn-color);
|
|
44
|
+
text-shadow: 0 0 1rem var(--warn-color);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.bar svg.warning {
|
|
48
|
+
border: 1px solid var(--warn-color);
|
|
49
|
+
color: var(--warn-color);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.error {
|
|
53
|
+
border: 1px solid var(--error-color);
|
|
54
|
+
color: var(--error-color);
|
|
55
|
+
text-shadow: 0 0 1rem var(--error-color);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.bar svg.error {
|
|
59
|
+
border: 1px solid var(--error-color);
|
|
60
|
+
color: var(--error-color);
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
`;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from "lit";
|
|
2
|
+
export declare class PercentBar extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
value: number;
|
|
5
|
+
height: number;
|
|
6
|
+
success: boolean;
|
|
7
|
+
warning: boolean;
|
|
8
|
+
error: boolean;
|
|
9
|
+
constructor();
|
|
10
|
+
render(): TemplateResult<1>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, LitElement, svg } from "lit";
|
|
8
|
+
import { property, customElement } from "lit/decorators.js";
|
|
9
|
+
import percentBarCss from "./percent-bar.css";
|
|
10
|
+
let PercentBar = class PercentBar extends LitElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
this.value = 0;
|
|
14
|
+
this.height = 20;
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
let nodes = [];
|
|
18
|
+
for (let i = 0; i < this.value / 2; i++) {
|
|
19
|
+
nodes.push((i + 0.2) * 2);
|
|
20
|
+
}
|
|
21
|
+
let count = 0;
|
|
22
|
+
let clazz = "";
|
|
23
|
+
let fill = "var(--primary-color)";
|
|
24
|
+
if (this.warning) {
|
|
25
|
+
fill = "var(--warn-color)";
|
|
26
|
+
clazz = "warning";
|
|
27
|
+
}
|
|
28
|
+
if (this.error) {
|
|
29
|
+
fill = "var(--error-color)";
|
|
30
|
+
clazz = "error";
|
|
31
|
+
}
|
|
32
|
+
if (this.success) {
|
|
33
|
+
fill = "var(--terminal-text)";
|
|
34
|
+
clazz = "success";
|
|
35
|
+
}
|
|
36
|
+
let valueLabel = `${this.value}`;
|
|
37
|
+
if (this.value < 1) {
|
|
38
|
+
valueLabel = "<1";
|
|
39
|
+
}
|
|
40
|
+
return html `
|
|
41
|
+
|
|
42
|
+
<div class="bar">
|
|
43
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="height: ${this.height}" class="${clazz}">
|
|
44
|
+
${nodes.map((node) => {
|
|
45
|
+
count++;
|
|
46
|
+
let width = 1.5;
|
|
47
|
+
if (count == 50) {
|
|
48
|
+
width = 1;
|
|
49
|
+
}
|
|
50
|
+
return svg `
|
|
51
|
+
<rect
|
|
52
|
+
width="${width}%"
|
|
53
|
+
height="${this.height - 4}px"
|
|
54
|
+
x="${node}%"
|
|
55
|
+
y="2"
|
|
56
|
+
fill="${fill}" />`;
|
|
57
|
+
})}
|
|
58
|
+
</svg>
|
|
59
|
+
<div class="percent ${clazz}" style="height: ${this.height}px; line-height: ${this.height}px">
|
|
60
|
+
<span>${valueLabel}%</span>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
`;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
PercentBar.styles = [percentBarCss];
|
|
67
|
+
__decorate([
|
|
68
|
+
property({ type: Number })
|
|
69
|
+
], PercentBar.prototype, "value", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
property({ type: Number })
|
|
72
|
+
], PercentBar.prototype, "height", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
property({ type: Boolean })
|
|
75
|
+
], PercentBar.prototype, "success", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
property({ type: Boolean })
|
|
78
|
+
], PercentBar.prototype, "warning", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
property({ type: Boolean })
|
|
81
|
+
], PercentBar.prototype, "error", void 0);
|
|
82
|
+
PercentBar = __decorate([
|
|
83
|
+
customElement("pb33f-percent-bar")
|
|
84
|
+
], PercentBar);
|
|
85
|
+
export { PercentBar };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export default css `
|
|
3
|
+
:host {
|
|
4
|
+
font-family: var(--font-stack), monospace;
|
|
5
|
+
font-size: 0.9rem;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
sl-drawer::part(panel) {
|
|
9
|
+
border: 1px dashed var(--secondary-color);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
sl-drawer::part(header) {
|
|
13
|
+
border-bottom: 1px dashed var(--secondary-color);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
sl-drawer::part(title) {
|
|
17
|
+
padding-top: 10px;
|
|
18
|
+
padding-bottom: 10px;
|
|
19
|
+
font-family: var(--font-stack-bold), monospace;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
sl-drawer::part(body) {
|
|
23
|
+
padding-top: 10px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
a:after {
|
|
27
|
+
content: " ↗";
|
|
28
|
+
display: inline-block;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
h2, h3, h4, h5, h6 {
|
|
32
|
+
margin-top: 40px;
|
|
33
|
+
padding-bottom: 10px;
|
|
34
|
+
border-bottom: 1px dashed var(--secondary-color);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
p {
|
|
38
|
+
margin-top: 20px;
|
|
39
|
+
margin-bottom: 20px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
`;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import '@shoelace-style/shoelace/dist/components/drawer/drawer.js';
|
|
2
|
+
import { LitElement, TemplateResult } from "lit";
|
|
3
|
+
import { SlDrawer } from "@shoelace-style/shoelace";
|
|
4
|
+
export declare enum ProblemDrawerEventType {
|
|
5
|
+
RULE_DOCS = "ruleDocs",
|
|
6
|
+
HOW_TO_FIX = "howToFix"
|
|
7
|
+
}
|
|
8
|
+
export interface ProblemDrawerEvent {
|
|
9
|
+
type: ProblemDrawerEventType;
|
|
10
|
+
rule?: string;
|
|
11
|
+
body?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class ProblemDetailsDrawer extends LitElement {
|
|
14
|
+
static styles: import("lit").CSSResult[];
|
|
15
|
+
drawer: SlDrawer;
|
|
16
|
+
private label;
|
|
17
|
+
private content;
|
|
18
|
+
constructor();
|
|
19
|
+
render(): TemplateResult<1>;
|
|
20
|
+
open(event: ProblemDrawerEvent): void;
|
|
21
|
+
close(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import '@shoelace-style/shoelace/dist/components/drawer/drawer.js';
|
|
8
|
+
import { customElement, query } from "lit/decorators.js";
|
|
9
|
+
import { html, LitElement } from "lit";
|
|
10
|
+
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
11
|
+
import syntaxCss from "@/css/chroma-synxtax.css";
|
|
12
|
+
import detailsDrawerCss from "./details-drawer.css";
|
|
13
|
+
import sharedCss from "./shared.css";
|
|
14
|
+
export var ProblemDrawerEventType;
|
|
15
|
+
(function (ProblemDrawerEventType) {
|
|
16
|
+
ProblemDrawerEventType["RULE_DOCS"] = "ruleDocs";
|
|
17
|
+
ProblemDrawerEventType["HOW_TO_FIX"] = "howToFix";
|
|
18
|
+
})(ProblemDrawerEventType || (ProblemDrawerEventType = {}));
|
|
19
|
+
let ProblemDetailsDrawer = class ProblemDetailsDrawer extends LitElement {
|
|
20
|
+
constructor() {
|
|
21
|
+
super();
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
return html `
|
|
25
|
+
<sl-drawer contained label="${this.label}" class="drawer" style="--size: 800px;">
|
|
26
|
+
${this.content}
|
|
27
|
+
<sl-button slot="footer" @click=${this.close} variant="primary" class="button-primary">close panel</sl-button>
|
|
28
|
+
</sl-drawer>
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
open(event) {
|
|
32
|
+
this.label = "";
|
|
33
|
+
switch (event.type) {
|
|
34
|
+
case ProblemDrawerEventType.RULE_DOCS:
|
|
35
|
+
if (event.rule) {
|
|
36
|
+
this.label = 'Rule: ' + event.rule;
|
|
37
|
+
this.content = html `${unsafeHTML(event.body)}`;
|
|
38
|
+
}
|
|
39
|
+
break;
|
|
40
|
+
case ProblemDrawerEventType.HOW_TO_FIX:
|
|
41
|
+
if (event.rule)
|
|
42
|
+
this.label = 'Rule: ' + event.rule;
|
|
43
|
+
this.content = html `
|
|
44
|
+
<h3>How to fix this problem</h3>
|
|
45
|
+
${event.body}`;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
this.requestUpdate();
|
|
49
|
+
if (this.drawer != null) {
|
|
50
|
+
this.drawer.show();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
close() {
|
|
54
|
+
if (this.drawer != null) {
|
|
55
|
+
this.drawer.hide();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
ProblemDetailsDrawer.styles = [sharedCss, syntaxCss, detailsDrawerCss];
|
|
60
|
+
__decorate([
|
|
61
|
+
query('sl-drawer')
|
|
62
|
+
], ProblemDetailsDrawer.prototype, "drawer", void 0);
|
|
63
|
+
ProblemDetailsDrawer = __decorate([
|
|
64
|
+
customElement("pb33f-problem-details-drawer")
|
|
65
|
+
], ProblemDetailsDrawer);
|
|
66
|
+
export { ProblemDetailsDrawer };
|