@dile/ui 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/LICENSE +7 -0
- package/README.md +3 -0
- package/components/app-drawer/app-drawer.js +3 -0
- package/components/app-drawer/index.js +1 -0
- package/components/app-drawer/src/DileAppDrawer.js +153 -0
- package/components/avatar/avatar.js +3 -0
- package/components/avatar/index.js +1 -0
- package/components/avatar/src/DileAvatar.js +78 -0
- package/components/breadcrumbs/breadcrumbs-item.js +3 -0
- package/components/breadcrumbs/breadcrumbs.js +4 -0
- package/components/breadcrumbs/index.js +2 -0
- package/components/breadcrumbs/src/DileBreadcrumbs.js +76 -0
- package/components/breadcrumbs/src/DileBreadcrumbsItem.js +51 -0
- package/components/button/button-icon.js +3 -0
- package/components/button/button.js +3 -0
- package/components/button/index.js +2 -0
- package/components/button/src/DileButton.js +86 -0
- package/components/button/src/DileButtonIcon.js +38 -0
- package/components/card/card.js +3 -0
- package/components/card/index.js +1 -0
- package/components/card/src/DileCard.js +111 -0
- package/components/checkbox/checkbox.js +3 -0
- package/components/checkbox/index.js +1 -0
- package/components/checkbox/src/DileCheckbox.js +154 -0
- package/components/confirm/confirm.js +3 -0
- package/components/confirm/index.js +1 -0
- package/components/confirm/src/DileConfirm.js +121 -0
- package/components/datepicker/calendar.js +3 -0
- package/components/datepicker/datepicker.js +4 -0
- package/components/datepicker/index.js +2 -0
- package/components/datepicker/src/DileCalendar.js +72 -0
- package/components/datepicker/src/DileDatepicker.js +114 -0
- package/components/hamburger/hamburger.js +3 -0
- package/components/hamburger/index.js +1 -0
- package/components/hamburger/src/DileHamburger.js +129 -0
- package/components/icon/icon.js +3 -0
- package/components/icon/index.js +1 -0
- package/components/icon/src/DileIcon.js +40 -0
- package/components/icon-switch/icon-switch-group.js +3 -0
- package/components/icon-switch/icon-switch.js +3 -0
- package/components/icon-switch/index.js +1 -0
- package/components/icon-switch/src/DileIconSwitch.js +54 -0
- package/components/icon-switch/src/DileIconSwitchGroup.js +38 -0
- package/components/info-box/index.js +1 -0
- package/components/info-box/info-box.js +3 -0
- package/components/info-box/src/DileInfoBox.js +118 -0
- package/components/inline-feedback/index.js +1 -0
- package/components/inline-feedback/inline-feedback.js +3 -0
- package/components/inline-feedback/src/DileInlineFeedback.js +96 -0
- package/components/input/index.js +9 -0
- package/components/input/input-integer.js +3 -0
- package/components/input/input-message.js +3 -0
- package/components/input/input-money.js +3 -0
- package/components/input/input-number-mask.js +3 -0
- package/components/input/input-percentage.js +3 -0
- package/components/input/input-search.js +3 -0
- package/components/input/input.js +3 -0
- package/components/input/src/DileInput.js +245 -0
- package/components/input/src/DileInputInteger.js +45 -0
- package/components/input/src/DileInputMessage.js +12 -0
- package/components/input/src/DileInputMoney.js +72 -0
- package/components/input/src/DileInputNumberMask.js +83 -0
- package/components/input/src/DileInputPercentage.js +57 -0
- package/components/input/src/DileInputSearch.js +145 -0
- package/components/input/src/Mask.js +37 -0
- package/components/input/src/message-styles.js +14 -0
- package/components/menu-hamburger/index.js +1 -0
- package/components/menu-hamburger/menu-hamburger.js +3 -0
- package/components/menu-hamburger/src/DileMenuHamburger.js +89 -0
- package/components/menu-overlay/index.js +1 -0
- package/components/menu-overlay/menu-overlay.js +3 -0
- package/components/menu-overlay/src/DileMenuOverlay.js +71 -0
- package/components/message/index.js +1 -0
- package/components/message/message.js +3 -0
- package/components/message/src/DileMessage.js +166 -0
- package/components/modal/index.js +1 -0
- package/components/modal/modal.js +3 -0
- package/components/modal/src/DileModal.js +194 -0
- package/components/nav/index.js +1 -0
- package/components/nav/nav.js +3 -0
- package/components/nav/src/DileNav.js +68 -0
- package/components/order-switch/index.js +1 -0
- package/components/order-switch/order-switch.js +3 -0
- package/components/order-switch/src/DileOrderSwitch.js +74 -0
- package/components/pages/index.js +1 -0
- package/components/pages/pages.js +3 -0
- package/components/pages/src/DilePages.js +178 -0
- package/components/password/index.js +1 -0
- package/components/password/password.js +3 -0
- package/components/password/src/DilePassword.js +34 -0
- package/components/progress-bar/index.js +1 -0
- package/components/progress-bar/progress-bar.js +3 -0
- package/components/progress-bar/src/DileProgressBar.js +89 -0
- package/components/radio-group/index.js +2 -0
- package/components/radio-group/radio-group.js +3 -0
- package/components/radio-group/radio.js +3 -0
- package/components/radio-group/src/DileRadio.js +79 -0
- package/components/radio-group/src/DileRadioGroup.js +102 -0
- package/components/range/index.js +1 -0
- package/components/range/range.js +3 -0
- package/components/range/src/DileRange.js +119 -0
- package/components/rating/index.js +1 -0
- package/components/rating/rating.js +4 -0
- package/components/rating/src/DileRating.js +119 -0
- package/components/rating/src/DileStar.js +63 -0
- package/components/rating/star.js +3 -0
- package/components/rating-scale-question/index.js +2 -0
- package/components/rating-scale-question/rating-scale-option.js +3 -0
- package/components/rating-scale-question/rating-scale-question.js +3 -0
- package/components/rating-scale-question/src/DileRatingScaleOption.js +184 -0
- package/components/rating-scale-question/src/DileRatingScaleQuestion.js +252 -0
- package/components/select/index.js +1 -0
- package/components/select/select-ajax.js +4 -0
- package/components/select/select.js +3 -0
- package/components/select/src/DileSelect.js +172 -0
- package/components/select/src/DileSelectAjax.js +338 -0
- package/components/selector/index.js +2 -0
- package/components/selector/selector-item.js +3 -0
- package/components/selector/selector.js +3 -0
- package/components/selector/src/DileSelector.js +12 -0
- package/components/selector/src/DileSelectorItem.js +94 -0
- package/components/slide-show/index.js +1 -0
- package/components/slide-show/slide-show.js +3 -0
- package/components/slide-show/src/DileSlideShow.js +111 -0
- package/components/social-icon/index.js +1 -0
- package/components/social-icon/social-icon.js +3 -0
- package/components/social-icon/src/DileSocialIcon.js +63 -0
- package/components/social-icon/src/icons.js +103 -0
- package/components/spinner/index.js +1 -0
- package/components/spinner/spinner-horizontal.js +3 -0
- package/components/spinner/spinner-modal.js +4 -0
- package/components/spinner/spinner.js +3 -0
- package/components/spinner/src/DileSpinner.js +116 -0
- package/components/spinner/src/DileSpinnerHorizontal.js +64 -0
- package/components/spinner/src/DileSpinnerMixin.js +13 -0
- package/components/spinner/src/DileSpinnerModal.js +51 -0
- package/components/tabs/index.js +2 -0
- package/components/tabs/src/DileTab.js +60 -0
- package/components/tabs/src/DileTabs.js +12 -0
- package/components/tabs/tab.js +3 -0
- package/components/tabs/tabs.js +4 -0
- package/components/textarea/index.js +1 -0
- package/components/textarea/src/DileTextarea.js +166 -0
- package/components/textarea/textarea.js +3 -0
- package/components/toast/index.js +3 -0
- package/components/toast/src/DileToast.js +95 -0
- package/components/toast/src/DileToastItem.js +92 -0
- package/components/toast/src/DileToastPersistent.js +100 -0
- package/components/toast/toast-item.js +3 -0
- package/components/toast/toast-persistent.js +3 -0
- package/components/toast/toast.js +4 -0
- package/components/tooltip/chip-tooltip.js +3 -0
- package/components/tooltip/index.js +1 -0
- package/components/tooltip/src/DileChipTooltip.js +86 -0
- package/components/tooltip/src/DileTooltip.js +195 -0
- package/components/tooltip/tooltip.js +3 -0
- package/mixins/close-document-click/index.js +1 -0
- package/mixins/close-document-click/src/DileCloseDocumentClick.js +67 -0
- package/mixins/close-on-esc-pressed/index.js +1 -0
- package/mixins/close-on-esc-pressed/src/DileCloseOnEscPressed.js +31 -0
- package/mixins/form/index.js +3 -0
- package/mixins/form/src/DileEmmitChange.js +22 -0
- package/mixins/form/src/DileForm.js +116 -0
- package/mixins/form/src/DileFormChangeDetect.js +34 -0
- package/mixins/overlay/index.js +1 -0
- package/mixins/overlay/src/DileOverlay.js +171 -0
- package/mixins/selectable/index.js +2 -0
- package/mixins/selectable/src/DileSelectable.js +154 -0
- package/mixins/selectable/src/DileSelectableItem.js +30 -0
- package/mixins/slide-down/index.js +1 -0
- package/mixins/slide-down/src/DileSlideDown.js +40 -0
- package/package.json +29 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2019 EscuelaIT
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DileAppDrawer, DILE_APP_DRAWER_EVENT_CLOSED, DILE_APP_DRAWER_EVENT_CLOSE_OUTSIDE } from './src/DileAppDrawer.js';
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { LitElement, html, css } from "lit";
|
|
2
|
+
import { DileCloseOnEscPressed } from '../../../mixins/close-on-esc-pressed/index.js';
|
|
3
|
+
|
|
4
|
+
export const DILE_APP_DRAWER_EVENT_CLOSE_OUTSIDE = 'dile-app-drawer-click-outside';
|
|
5
|
+
export const DILE_APP_DRAWER_EVENT_CLOSED = 'dile-app-drawer-closed';
|
|
6
|
+
|
|
7
|
+
export class DileAppDrawer extends DileCloseOnEscPressed(LitElement) {
|
|
8
|
+
static get properties() {
|
|
9
|
+
return {
|
|
10
|
+
direction: {
|
|
11
|
+
type: String,
|
|
12
|
+
reflect: true
|
|
13
|
+
},
|
|
14
|
+
opened: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
reflect: true
|
|
17
|
+
},
|
|
18
|
+
noModal: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
attribute: 'no-modal'
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
constructor() {
|
|
26
|
+
super();
|
|
27
|
+
this.direction = 'top';
|
|
28
|
+
this.opened = false;
|
|
29
|
+
this._documentClose = this._documentClose.bind(this);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static get styles() {
|
|
33
|
+
return css`
|
|
34
|
+
:host {
|
|
35
|
+
display: block;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.modal {
|
|
39
|
+
display: none;
|
|
40
|
+
position: fixed;
|
|
41
|
+
width: 100vw;
|
|
42
|
+
height: 100vh;
|
|
43
|
+
top: 0;
|
|
44
|
+
left: 0;
|
|
45
|
+
z-index: var(--dile-app-drawer-modal-z-index, var(--dile-app-drawer-z-index, 10000));
|
|
46
|
+
opacity: 0;
|
|
47
|
+
transition: opacity 0.3s ease;
|
|
48
|
+
background-color: var(
|
|
49
|
+
--dile-app-drawer-modal-background-color,
|
|
50
|
+
rgba(20, 20, 20, 0.7)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.menu {
|
|
55
|
+
position: fixed;
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
z-index: var(--dile-app-drawer-z-index, 10000);
|
|
58
|
+
background-color: var(--dile-app-drawer-background-color, #ddd);
|
|
59
|
+
transition: transform 0.3s ease;
|
|
60
|
+
overflow: auto;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
section {
|
|
64
|
+
transform: translateX(-100vw);
|
|
65
|
+
transition: transform 0.2s ease 0.3s;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:host([opened]) .modal {
|
|
69
|
+
display: block;
|
|
70
|
+
opacity: 1;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:host([opened]) .menu {
|
|
74
|
+
display: block;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host([opened]) section {
|
|
78
|
+
transform: translateX(0);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:host([direction="top"]) .menu {
|
|
82
|
+
top: var(--dile-app-drawer-closed-top, -100vh);
|
|
83
|
+
left: var(--dile-app-drawer-closed-left, 0);
|
|
84
|
+
height: var(--dile-app-drawer-content-height, auto);
|
|
85
|
+
width: var(--dile-app-drawer-content-width, 100vw);
|
|
86
|
+
box-shadow: var(--dile-app-drawer-box-shadow, 0 1px 8px #000);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:host([direction="left"]) .menu {
|
|
90
|
+
top: var(--dile-app-drawer-closed-top, 0);
|
|
91
|
+
left: var(--dile-app-drawer-closed-left, -100vw);
|
|
92
|
+
height: var(--dile-app-drawer-content-height, 100vh);
|
|
93
|
+
width: var(--dile-app-drawer-content-width, auto);
|
|
94
|
+
box-shadow: var(--dile-app-drawer-box-shadow, 1px 0 8px #000);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:host([direction="top"][opened]) .menu {
|
|
98
|
+
transform: translateY(100vh);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:host([direction="left"][opened]) .menu {
|
|
102
|
+
transform: translateX(100vw);
|
|
103
|
+
}
|
|
104
|
+
`;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
render() {
|
|
108
|
+
return html`
|
|
109
|
+
${this.modalTemplate}
|
|
110
|
+
<div class="menu" @click="${this._contentClick}">
|
|
111
|
+
<section>
|
|
112
|
+
<slot></slot>
|
|
113
|
+
</section>
|
|
114
|
+
</div>
|
|
115
|
+
`;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
get modalTemplate() {
|
|
119
|
+
return this.noModal ? '' : html`<div class="modal" @click=${this._documentClose}></div>`;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
_documentClose() {
|
|
123
|
+
if (this.opened) {
|
|
124
|
+
this.close();
|
|
125
|
+
this.dispatchEvent(
|
|
126
|
+
new CustomEvent(DILE_APP_DRAWER_EVENT_CLOSE_OUTSIDE, {
|
|
127
|
+
bubbles: true,
|
|
128
|
+
composed: true,
|
|
129
|
+
})
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
toggle() {
|
|
135
|
+
this.opened = !this.opened;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
open() {
|
|
139
|
+
this.opened = true;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
close() {
|
|
143
|
+
this.opened = false;
|
|
144
|
+
this.dispatchEvent(new CustomEvent(DILE_APP_DRAWER_EVENT_CLOSED, {
|
|
145
|
+
bubbles: true,
|
|
146
|
+
composed: true,
|
|
147
|
+
}));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
_contentClick(e) {
|
|
151
|
+
e.stopPropagation();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DileAvatar } from './src/DileAvatar.js';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { LitElement, html, css } from "lit";
|
|
2
|
+
|
|
3
|
+
let defaultIcon = `data:image/svg+xml;utf8,<svg style="fill:%23888;" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/><path d="M0 0h24v24H0z" fill="none"/></svg>`;
|
|
4
|
+
|
|
5
|
+
export class DileAvatar extends LitElement {
|
|
6
|
+
static get styles() {
|
|
7
|
+
return css`
|
|
8
|
+
:host {
|
|
9
|
+
display: inline-block;
|
|
10
|
+
}
|
|
11
|
+
div {
|
|
12
|
+
display: inline-block;
|
|
13
|
+
background-repeat: no-repeat;
|
|
14
|
+
background-position: center;
|
|
15
|
+
line-height: var(--dile-avatar-size, 36px);
|
|
16
|
+
width: var(--dile-avatar-size, 36px);
|
|
17
|
+
height: var(--dile-avatar-size, 36px);
|
|
18
|
+
border-radius: var(--dile-avatar-size, 36px);
|
|
19
|
+
background-size: var(--dile-avatar-size, 36px);
|
|
20
|
+
background-color: var(--dile-avatar-background-color, #ddd);
|
|
21
|
+
color: var(--dile-avatar-color, #888);
|
|
22
|
+
text-align: center;
|
|
23
|
+
font-size: calc(var(--dile-avatar-size, 36px) - 11px);
|
|
24
|
+
font-weight: bold;
|
|
25
|
+
text-transform: uppercase;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
}
|
|
29
|
+
static get properties() {
|
|
30
|
+
return {
|
|
31
|
+
src: { type: String },
|
|
32
|
+
initial: { type: String },
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
constructor() {
|
|
36
|
+
super();
|
|
37
|
+
this.src = "";
|
|
38
|
+
this.initial = "";
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
updated(changedProperties) {
|
|
42
|
+
if (changedProperties.has("initial") && typeof this.initial == "string" && this.initial.length > 0) {
|
|
43
|
+
this.initial = this.initial.charAt(0);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
render() {
|
|
48
|
+
return html`
|
|
49
|
+
${this.src == "" && this.initial != "" && this.initial.length == 1
|
|
50
|
+
? this.initialTemplate
|
|
51
|
+
: this.imageTemplate
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
get imageTemplate() {
|
|
57
|
+
return html`<div
|
|
58
|
+
id="img"
|
|
59
|
+
role="img"
|
|
60
|
+
style="background-image: url('${this._asignImage(this.src)}');"
|
|
61
|
+
> </div>`;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
get initialTemplate() {
|
|
65
|
+
return html`<div
|
|
66
|
+
id="img"
|
|
67
|
+
role="img"
|
|
68
|
+
class="initial"
|
|
69
|
+
>${this.initial}</div>`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
_asignImage(src) {
|
|
73
|
+
if (src == "" || !src) {
|
|
74
|
+
return defaultIcon;
|
|
75
|
+
}
|
|
76
|
+
return src;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { html, css, LitElement } from "lit";
|
|
2
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
3
|
+
|
|
4
|
+
export class DileBreadcrumbs extends LitElement {
|
|
5
|
+
static get properties() {
|
|
6
|
+
return {
|
|
7
|
+
items: { type: Array },
|
|
8
|
+
separator: { type: String },
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.items = [];
|
|
15
|
+
this.separator = '/'
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static get styles() {
|
|
19
|
+
return css`
|
|
20
|
+
:host {
|
|
21
|
+
display: block;
|
|
22
|
+
}
|
|
23
|
+
::slotted(dile-breadcrumbs-item.separator) {
|
|
24
|
+
padding-left: var(--dile-breadcrumbs-separator-width, 0.5rem);
|
|
25
|
+
}
|
|
26
|
+
::slotted(dile-breadcrumbs-item.separator)::before {
|
|
27
|
+
padding-right: var(--dile-breadcrumbs-separator-width, 0.5rem);
|
|
28
|
+
font-size: var(--dile-breadcrumbs-font-size, 1rem);
|
|
29
|
+
color: var(--dile-breadcrumbs-text-color, #303030);
|
|
30
|
+
}
|
|
31
|
+
.separator {
|
|
32
|
+
padding-left: var(--dile-breadcrumbs-separator-width, 0.5rem);
|
|
33
|
+
}
|
|
34
|
+
.separator::before {
|
|
35
|
+
padding-right: var(--dile-breadcrumbs-separator-width, 0.5rem);
|
|
36
|
+
font-size: var(--dile-breadcrumbs-font-size, 1rem);
|
|
37
|
+
color: var(--dile-breadcrumbs-text-color, #000);
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
firstUpdated() {
|
|
43
|
+
this.querySelectorAll('dile-breadcrumbs-item').forEach( (item, index) => {
|
|
44
|
+
if(index > 0) {
|
|
45
|
+
item.classList.add('separator');
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
render() {
|
|
51
|
+
return html`
|
|
52
|
+
<style>
|
|
53
|
+
.separator::before,
|
|
54
|
+
::slotted(dile-breadcrumbs-item.separator)::before {
|
|
55
|
+
content: "${this.separator}";
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
58
|
+
${this.items.length > 0
|
|
59
|
+
? this.arrayTemplate
|
|
60
|
+
: html`<slot></slot>`
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
get arrayTemplate() {
|
|
66
|
+
return html`
|
|
67
|
+
${this.items.map((item, index) => html`
|
|
68
|
+
<dile-breadcrumbs-item
|
|
69
|
+
class="${ index != 0 ? 'separator' : '' }"
|
|
70
|
+
href="${ifDefined(item.href)}"
|
|
71
|
+
name="${ifDefined(item.name)}"
|
|
72
|
+
>${item.text}</dile-breadcrumbs-item>`
|
|
73
|
+
)}
|
|
74
|
+
`;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
|
|
3
|
+
export class DileBreadcrumbsItem extends LitElement {
|
|
4
|
+
static styles = [
|
|
5
|
+
css`
|
|
6
|
+
:host {
|
|
7
|
+
display: inline-block;
|
|
8
|
+
font-size: var(--dile-breadcrumbs-font-size, 1rem);
|
|
9
|
+
}
|
|
10
|
+
a, .named {
|
|
11
|
+
text-decoration: var(--dile-breadcrumbs-text-decoration, none);
|
|
12
|
+
color: var(--dile-breadcrumbs-link-color, #39c);
|
|
13
|
+
}
|
|
14
|
+
.named {
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
}
|
|
17
|
+
`
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
static get properties() {
|
|
21
|
+
return {
|
|
22
|
+
href: { type: String },
|
|
23
|
+
name: { type: String },
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
render() {
|
|
28
|
+
return html`
|
|
29
|
+
${this.href
|
|
30
|
+
? html`<a href="${this.href}">${this.contentTemplate}</a>`
|
|
31
|
+
: html`<span class="${this.name ? 'named' : ''}" @click=${this.dispatchClick}>${this.contentTemplate}</span>`
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
get contentTemplate() {
|
|
37
|
+
return html`<slot></slot>`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
dispatchClick(e) {
|
|
41
|
+
if(this.name) {
|
|
42
|
+
this.dispatchEvent(new CustomEvent('dile-breadcrumbs-click', {
|
|
43
|
+
bubbles: true,
|
|
44
|
+
composed: true,
|
|
45
|
+
detail: {
|
|
46
|
+
name: this.name,
|
|
47
|
+
}
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { html, css, LitElement } from "lit";
|
|
2
|
+
|
|
3
|
+
export class DileButton extends LitElement {
|
|
4
|
+
static get properties() {
|
|
5
|
+
return {
|
|
6
|
+
disabled: { type: Boolean },
|
|
7
|
+
name: { type: String },
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
this.disabled = false;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
static get styles() {
|
|
17
|
+
return css`
|
|
18
|
+
:host {
|
|
19
|
+
display: inline-block;
|
|
20
|
+
}
|
|
21
|
+
button {
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
padding-top: var(--dile-button-padding-y, 0.5rem);
|
|
24
|
+
padding-bottom: var(--dile-button-padding-y, 0.5rem);
|
|
25
|
+
padding-right: var(--dile-button-padding-x, 0.8rem);
|
|
26
|
+
padding-left: var(--dile-button-padding-x, 0.8rem);
|
|
27
|
+
border-radius: var(--dile-button-border-radius, 2rem);
|
|
28
|
+
border-width: var(--dile-button-border-width, 3px);
|
|
29
|
+
border-color: var(--dile-button-border-color, #07193b);
|
|
30
|
+
background-color: var(--dile-button-background-color, #7BB93D);
|
|
31
|
+
transition-property: background-color, color;
|
|
32
|
+
transition-duration: 0.3s;
|
|
33
|
+
transition-timing-function: ease-in-out;
|
|
34
|
+
border-style: solid;
|
|
35
|
+
color: var(--dile-button-text-color, #fff);
|
|
36
|
+
font-size: var(--dile-button-font-size, 1rem);
|
|
37
|
+
font-weight: var(--dile-button-font-weight, bold);
|
|
38
|
+
text-transform: var(--dile-button-text-transform, none);
|
|
39
|
+
letter-spacing: var(--dile-button-letter-spacing, 0);
|
|
40
|
+
}
|
|
41
|
+
button:hover {
|
|
42
|
+
background-color: var(--dile-button-hover-background-color, #f3f3ae);
|
|
43
|
+
color: var(--dile-button-hover-text-color, #303030);
|
|
44
|
+
border-color: var(--dile-button-hover-border-color, #666666);
|
|
45
|
+
}
|
|
46
|
+
button:focus {
|
|
47
|
+
outline: none;
|
|
48
|
+
box-shadow: 0 0 0 calc(0px + var(--dile-button-ring-offset-width, 3px)) var(--dile-button-ring-color, #12c9e9);
|
|
49
|
+
border-color: var(--dile-button-ring-color, #12c9e9);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
:host([disabled]) button {
|
|
53
|
+
cursor: auto;
|
|
54
|
+
background-color: var(--dile-button-disabled-background-color, #ccc);
|
|
55
|
+
color: var(--dile-button-disabled-text-color, #999);
|
|
56
|
+
border-color: var(--dile-button-disabled-border-color, #bbb);
|
|
57
|
+
}
|
|
58
|
+
:host([disabled]) button:focus {
|
|
59
|
+
outline: none;
|
|
60
|
+
box-shadow: none;
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
:host([disabled]) button:active {
|
|
64
|
+
outline: none;
|
|
65
|
+
border-color: #aaa;
|
|
66
|
+
box-shadow: none;
|
|
67
|
+
}
|
|
68
|
+
button {
|
|
69
|
+
user-select: none;
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
render() {
|
|
75
|
+
return html`
|
|
76
|
+
<button @click="${this.doClick}"><slot></slot></button>
|
|
77
|
+
`;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
doClick(e) {
|
|
81
|
+
if (this.disabled) {
|
|
82
|
+
e.preventDefault();
|
|
83
|
+
e.stopPropagation();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { html, css, LitElement } from "lit";
|
|
2
|
+
import { DileButton } from './DileButton.js';
|
|
3
|
+
import '../../icon/icon.js';
|
|
4
|
+
|
|
5
|
+
export class DileButtonIcon extends DileButton {
|
|
6
|
+
static get properties() {
|
|
7
|
+
return {
|
|
8
|
+
icon: { type: Object },
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
static get styles() {
|
|
13
|
+
return [
|
|
14
|
+
super.styles,
|
|
15
|
+
css`
|
|
16
|
+
button {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|
|
20
|
+
dile-icon {
|
|
21
|
+
margin-right: var(--dile-button-icon-separation, 0.3rem);
|
|
22
|
+
}
|
|
23
|
+
button:hover {
|
|
24
|
+
--dile-icon-color: var(--dile-button-icon-hover-color, #303030);
|
|
25
|
+
}
|
|
26
|
+
`
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
render() {
|
|
31
|
+
return html`
|
|
32
|
+
<button @click="${this.doClick}">
|
|
33
|
+
<dile-icon .icon=${this.icon}></dile-icon>
|
|
34
|
+
<slot></slot>
|
|
35
|
+
</button>
|
|
36
|
+
`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DileCard } from './src/DileCard.js';
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
|
|
3
|
+
export class DileCard extends LitElement {
|
|
4
|
+
static styles = [
|
|
5
|
+
css`
|
|
6
|
+
* {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
9
|
+
:host {
|
|
10
|
+
display: block;
|
|
11
|
+
align-items: stretch;
|
|
12
|
+
}
|
|
13
|
+
section {
|
|
14
|
+
border: var(--dile-card-border, 1px solid #ccc);
|
|
15
|
+
border-radius: var(--dile-card-border-radius, 0.5rem);
|
|
16
|
+
background-color: var(--dile-card-background-color, #fff);
|
|
17
|
+
color: var(--dile-card-text-color, #303030);
|
|
18
|
+
width: 100%;
|
|
19
|
+
text-align: var(--dile-card-text-align, left);
|
|
20
|
+
font-weight: var(--dile-card-font-weight, normal);
|
|
21
|
+
box-shadow: var(--dile-card-box-shadow, 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1));
|
|
22
|
+
}
|
|
23
|
+
h1, main, footer {
|
|
24
|
+
padding-right: var(--dile-card-padding-x, 1rem);
|
|
25
|
+
padding-left: var(--dile-card-padding-x, 1rem);
|
|
26
|
+
}
|
|
27
|
+
h1 {
|
|
28
|
+
padding-top: var(--dile-card-padding-y, 1rem);
|
|
29
|
+
font-size: var(--dile-card-title-font-size, 1.5rem);
|
|
30
|
+
font-weight: var(--dile-card-title-font-weight, 300);
|
|
31
|
+
color: var(--dile-card-title-color, var(--dile-card-text-color, #303030));
|
|
32
|
+
margin: 0;
|
|
33
|
+
margin-bottom: var(--dile-card-title-margin-bottom, 0);
|
|
34
|
+
}
|
|
35
|
+
main {
|
|
36
|
+
padding-top: var(--dile-card-padding-y, 1rem);
|
|
37
|
+
padding-bottom: var(--dile-card-padding-y, 1rem);
|
|
38
|
+
}
|
|
39
|
+
footer {
|
|
40
|
+
border-top: var(--dile-card-footer-border-separator, 1px solid #ccc);
|
|
41
|
+
padding-top: var(--dile-card-footer-padding-top, 0.75rem);
|
|
42
|
+
padding-bottom: var(--dile-card-padding-y, 1rem);
|
|
43
|
+
background-color: var(--dile-card-footer-background-color, transparent);
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
border-bottom-left-radius: var(--dile-card-border-radius, 0.5rem);
|
|
46
|
+
border-bottom-right-radius: var(--dile-card-border-radius, 0.5rem);
|
|
47
|
+
}
|
|
48
|
+
:host([shadow-none]) section {
|
|
49
|
+
box-shadow: var(--dile-card-box-shadow, 0 0 #0000);
|
|
50
|
+
}
|
|
51
|
+
:host([shadow-sm]) section {
|
|
52
|
+
box-shadow: var(--dile-card-box-shadow, 0 1px 2px 0 rgb(0 0 0 / 0.05));
|
|
53
|
+
}
|
|
54
|
+
:host([shadow-md]) section {
|
|
55
|
+
box-shadow: var(--dile-card-box-shadow, 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1));
|
|
56
|
+
}
|
|
57
|
+
:host([shadow-lg]) section {
|
|
58
|
+
box-shadow: var(--dile-card-box-shadow, 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1));
|
|
59
|
+
}
|
|
60
|
+
:host([shadow-xl]) section {
|
|
61
|
+
box-shadow: var(--dile-card-box-shadow, 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1));
|
|
62
|
+
}
|
|
63
|
+
:host([shadow-2xl]) section {
|
|
64
|
+
box-shadow: var(--dile-card-box-shadow, 0 25px 50px -12px rgb(0 0 0 / 0.25));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
`
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
static get properties() {
|
|
71
|
+
return {
|
|
72
|
+
title: { type: String }
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
render() {
|
|
77
|
+
return html`
|
|
78
|
+
<section>
|
|
79
|
+
${this.titleTemplate}
|
|
80
|
+
<main>
|
|
81
|
+
<slot></slot>
|
|
82
|
+
</main>
|
|
83
|
+
${this.footerTemplate}
|
|
84
|
+
</section>
|
|
85
|
+
`;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
get titleTemplate() {
|
|
89
|
+
return this.title
|
|
90
|
+
? html`<h1>${this.title}</h1>`
|
|
91
|
+
: ''
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
get footerTemplate() {
|
|
96
|
+
return html`
|
|
97
|
+
${this.hasSlot('footer')
|
|
98
|
+
? html`
|
|
99
|
+
<footer>
|
|
100
|
+
<slot name="footer"></slot>
|
|
101
|
+
</footer>
|
|
102
|
+
`
|
|
103
|
+
: ''
|
|
104
|
+
}
|
|
105
|
+
`;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
hasSlot(name) {
|
|
109
|
+
return this.querySelector(`[slot="${name}"]`) !== null;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DileCheckbox } from './src/DileCheckbox.js';
|