@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
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { html, css, LitElement } from "lit";
|
|
2
|
+
import { DileSlideDown } from "../../../mixins/slide-down/index.js";
|
|
3
|
+
import '../../icon/icon.js';
|
|
4
|
+
import { closeIcon } from '@dile/icons/index.js'
|
|
5
|
+
|
|
6
|
+
export class DileMessage extends DileSlideDown(LitElement) {
|
|
7
|
+
static get styles() {
|
|
8
|
+
return [
|
|
9
|
+
css`
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
--dile-close-icon-template-color: var(--dile-message-icon-color, #fff);
|
|
13
|
+
}
|
|
14
|
+
#message {
|
|
15
|
+
height: 0;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
transition: height 0.3s ease-in;
|
|
18
|
+
-webkit-transition: height 0.3s ease-in;
|
|
19
|
+
position: fixed;
|
|
20
|
+
width: 100%;
|
|
21
|
+
z-index: var(--dile-message-z-index, 1);
|
|
22
|
+
}
|
|
23
|
+
section {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
background-color: var(--dile-message-background-color, #666);
|
|
27
|
+
color: var(--dile-message-color, #fff);
|
|
28
|
+
padding: var(--dile-message-padding, 15px);
|
|
29
|
+
}
|
|
30
|
+
.content {
|
|
31
|
+
flex-grow: 1;
|
|
32
|
+
margin-right: 5px;
|
|
33
|
+
}
|
|
34
|
+
@media (min-width: 420px) {
|
|
35
|
+
.content {
|
|
36
|
+
margin-right: 15px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
.icon {
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:host([hideCloseIcon]) .icon {
|
|
47
|
+
display: none;
|
|
48
|
+
}
|
|
49
|
+
:host([position='top']) #message {
|
|
50
|
+
top: 0;
|
|
51
|
+
left: 0;
|
|
52
|
+
}
|
|
53
|
+
:host([position='bottom']) #message {
|
|
54
|
+
bottom: 0;
|
|
55
|
+
left: 0;
|
|
56
|
+
}
|
|
57
|
+
:host([position='relative']) #message {
|
|
58
|
+
position: relative;
|
|
59
|
+
}
|
|
60
|
+
:host([position='right-bottom']) #message {
|
|
61
|
+
bottom: var(--dile-message-right-bottom-separation, 1.5rem);
|
|
62
|
+
right: var(--dile-message-right-bottom-separation, 1.5rem);
|
|
63
|
+
width: var(--dile-message-right-bottom-width, 80vw);
|
|
64
|
+
max-width: var(--dile-message-right-bottom-max-width, 400px);
|
|
65
|
+
}
|
|
66
|
+
`,
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
static get properties() {
|
|
70
|
+
return {
|
|
71
|
+
/**
|
|
72
|
+
* If true the feedbak box is in opened status.
|
|
73
|
+
*/
|
|
74
|
+
opened: { type: Boolean },
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Message to display. If message='' then the component will display the content comming from the slot.
|
|
78
|
+
*/
|
|
79
|
+
message: { type: String },
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Position between top, bottom, right-bottom.
|
|
83
|
+
*/
|
|
84
|
+
position: {
|
|
85
|
+
type: String,
|
|
86
|
+
reflect: true,
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* If true the close icon will be hidden.
|
|
91
|
+
*/
|
|
92
|
+
hideCloseIcon: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
reflect: true
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
constructor() {
|
|
100
|
+
super();
|
|
101
|
+
this.opened = false;
|
|
102
|
+
this.position = 'bottom';
|
|
103
|
+
this.message = "";
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
firstUpdated() {
|
|
107
|
+
this.display = this.shadowRoot.getElementById("message");
|
|
108
|
+
if (this.opened) {
|
|
109
|
+
this.slideShow(this.display);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
render() {
|
|
114
|
+
return html`
|
|
115
|
+
<div id="message">
|
|
116
|
+
<section>
|
|
117
|
+
<div class="content">
|
|
118
|
+
${
|
|
119
|
+
this.message != "" && this.message != undefined
|
|
120
|
+
? this.message
|
|
121
|
+
: html`<slot></slot>`
|
|
122
|
+
}
|
|
123
|
+
</div>
|
|
124
|
+
<dile-icon .icon="${closeIcon}" class="icon" @click="${this.closeByUser}">
|
|
125
|
+
|
|
126
|
+
</dile-icon>
|
|
127
|
+
</section>
|
|
128
|
+
</div>
|
|
129
|
+
`;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
close() {
|
|
133
|
+
if (this.opened) {
|
|
134
|
+
this.slideHide(this.display);
|
|
135
|
+
this.opened = false;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
closeByUser() {
|
|
140
|
+
this.dispatchEvent(
|
|
141
|
+
new CustomEvent("dile-message-closed-by-user", {
|
|
142
|
+
detail: this,
|
|
143
|
+
})
|
|
144
|
+
);
|
|
145
|
+
this.close();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
open() {
|
|
149
|
+
if(! this.opened ) {
|
|
150
|
+
this.slideShow(this.display);
|
|
151
|
+
this.opened = true;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
openMessage(msg) {
|
|
156
|
+
this.message = msg;
|
|
157
|
+
this.open();
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
updated(changedProperties) {
|
|
161
|
+
if (changedProperties.has("opened") && this.opened) {
|
|
162
|
+
this.open();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DileModal } from './src/DileModal.js';
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { LitElement, html, css } from "lit";
|
|
2
|
+
import '../../icon/icon.js';
|
|
3
|
+
import { closeIcon } from '@dile/icons/index.js'
|
|
4
|
+
import { DileCloseOnEscPressed } from '../../../mixins/close-on-esc-pressed/index.js'
|
|
5
|
+
|
|
6
|
+
export class DileModal extends DileCloseOnEscPressed(LitElement) {
|
|
7
|
+
static get properties() {
|
|
8
|
+
return {
|
|
9
|
+
_toChange: { type: Boolean },
|
|
10
|
+
/**
|
|
11
|
+
* If true the modal box is in opened status.
|
|
12
|
+
*/
|
|
13
|
+
opened: { type: Boolean },
|
|
14
|
+
/**
|
|
15
|
+
* If true the modal box displays a close icon
|
|
16
|
+
*/
|
|
17
|
+
showCloseIcon: { type: Boolean },
|
|
18
|
+
/**
|
|
19
|
+
* If true the modal box blocks the screen. That is, when you click in the background layer, the modal box do not close.
|
|
20
|
+
*/
|
|
21
|
+
blocking: { type: Boolean },
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
constructor() {
|
|
26
|
+
super();
|
|
27
|
+
this._toChange = false;
|
|
28
|
+
this.opened = false;
|
|
29
|
+
this.showCloseIcon = false;
|
|
30
|
+
this.blocking = false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static get styles() {
|
|
34
|
+
return [
|
|
35
|
+
css`
|
|
36
|
+
* {
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
}
|
|
39
|
+
:host {
|
|
40
|
+
display: block;
|
|
41
|
+
--dile-close-icon-template-color: var(
|
|
42
|
+
--dile-modal-close-icon-color,
|
|
43
|
+
#888
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
.closeicon {
|
|
47
|
+
--dile-icon-color: var( --dile-modal-close-icon-color, #888);
|
|
48
|
+
}
|
|
49
|
+
section {
|
|
50
|
+
position: fixed;
|
|
51
|
+
left: 0;
|
|
52
|
+
top: 0;
|
|
53
|
+
height: 100vh;
|
|
54
|
+
width: 100vw;
|
|
55
|
+
display: none;
|
|
56
|
+
transition: opacity var(--dile-modal-animation-duration, 0.3s) ease-in;
|
|
57
|
+
-webkit-transition: opacity var(--dile-modal-animation-duration, 0.3s)
|
|
58
|
+
ease-in;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
z-index: var(--dile-modal-z-index, 100);
|
|
62
|
+
background-color: var(
|
|
63
|
+
--dile-modal-background-color,
|
|
64
|
+
rgba(30, 30, 30, 0.8)
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
.content {
|
|
68
|
+
display: block;
|
|
69
|
+
position: relative;
|
|
70
|
+
z-index: var(--dile-modal-content-z-index, 101);
|
|
71
|
+
width: var(--dile-modal-width, 280px);
|
|
72
|
+
min-width: var(--dile-modal-min-width, 250px);
|
|
73
|
+
max-width: var(--dile-modal-max-width, 100vw);
|
|
74
|
+
height: var(--dile-modal-height, auto);
|
|
75
|
+
min-height: var(--dile-modal-min-height, auto);
|
|
76
|
+
max-height: var(--dile-modal-max-height, 100vh);
|
|
77
|
+
background-color: var(--dile-modal-content-background-color, #fff);
|
|
78
|
+
box-shadow: var(--dile-modal-content-shadow-displacement, 6px)
|
|
79
|
+
var(--dile-modal-content-shadow-displacement, 6px)
|
|
80
|
+
var(--dile-modal-content-shadow-blur, 16px)
|
|
81
|
+
var(--dile-modal-content-shadow-color, #000);
|
|
82
|
+
border-radius: var(--dile-modal-border-radius, 15px);
|
|
83
|
+
padding: var(--dile-modal-content-padding, 1em) 0
|
|
84
|
+
var(--dile-modal-content-padding, 1em)
|
|
85
|
+
var(--dile-modal-content-padding, 1em);
|
|
86
|
+
}
|
|
87
|
+
article {
|
|
88
|
+
overflow: auto;
|
|
89
|
+
max-height: 100%;
|
|
90
|
+
height: 100%;
|
|
91
|
+
padding-right: var(--dile-modal-content-padding, 1em);
|
|
92
|
+
}
|
|
93
|
+
.transparent {
|
|
94
|
+
opacity: 0;
|
|
95
|
+
}
|
|
96
|
+
.opaque {
|
|
97
|
+
opacity: 1;
|
|
98
|
+
display: flex !important;
|
|
99
|
+
}
|
|
100
|
+
.opened {
|
|
101
|
+
display: flex !important;
|
|
102
|
+
}
|
|
103
|
+
dile-icon {
|
|
104
|
+
position: absolute;
|
|
105
|
+
display: inline-block;
|
|
106
|
+
top: var(--dile-modal-close-icon-top, 5px);
|
|
107
|
+
right: var(--dile-modal-close-icon-right, 18px);
|
|
108
|
+
z-index: 1002;
|
|
109
|
+
width: var(--dile-modal-close-icon-size, 24px);
|
|
110
|
+
height: var(--dile-modal-close-icon-size, 24px);
|
|
111
|
+
cursor: var(--dile-modal-close-icon-cursor, pointer);
|
|
112
|
+
}
|
|
113
|
+
.contentIconSeparation {
|
|
114
|
+
padding-top: var(--dile-modal-extra-top-separation-when-icon, 10px);
|
|
115
|
+
}
|
|
116
|
+
`,
|
|
117
|
+
];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
render() {
|
|
121
|
+
return html`
|
|
122
|
+
<section
|
|
123
|
+
class="${this.getModalClass(this.opened, this._toChange)}"
|
|
124
|
+
@click="${this._backgroundModalClick}"
|
|
125
|
+
@transitionend="${this.animationEnd}"
|
|
126
|
+
id="backgroundmodal"
|
|
127
|
+
>
|
|
128
|
+
<div class="content" @click="${this.contentClick}">
|
|
129
|
+
${this.showCloseIcon
|
|
130
|
+
? html`<dile-icon .icon="${closeIcon}" @click="${this.close}" class="closeicon"></dile-icon>`
|
|
131
|
+
: ""}
|
|
132
|
+
<article class="${this.showCloseIcon ? "contentIconSeparation" : ""}">
|
|
133
|
+
<slot></slot>
|
|
134
|
+
</article>
|
|
135
|
+
</div>
|
|
136
|
+
</section>
|
|
137
|
+
`;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
getModalClass(opened, _toChange) {
|
|
141
|
+
if (!opened && !_toChange) {
|
|
142
|
+
return "transparent";
|
|
143
|
+
}
|
|
144
|
+
if (opened && _toChange) {
|
|
145
|
+
return "transparent opened";
|
|
146
|
+
}
|
|
147
|
+
if (opened && !_toChange) {
|
|
148
|
+
return "opaque";
|
|
149
|
+
}
|
|
150
|
+
if (!opened && _toChange) {
|
|
151
|
+
return "transparent opened";
|
|
152
|
+
}
|
|
153
|
+
return '';
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
open() {
|
|
157
|
+
this.opened = true;
|
|
158
|
+
this._toChange = true;
|
|
159
|
+
setTimeout(() => {
|
|
160
|
+
this._toChange = false;
|
|
161
|
+
}, 50);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
_backgroundModalClick(e) {
|
|
165
|
+
if (!this.blocking && e.target && e.target.getAttribute("id") === "backgroundmodal") {
|
|
166
|
+
this.close();
|
|
167
|
+
this.dispatchEvent(
|
|
168
|
+
new CustomEvent("dile-modal-background-closed", {
|
|
169
|
+
bubbles: true,
|
|
170
|
+
composed: true,
|
|
171
|
+
detail: this,
|
|
172
|
+
})
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
close() {
|
|
178
|
+
this.opened = false;
|
|
179
|
+
this._toChange = true;
|
|
180
|
+
this.dispatchEvent(
|
|
181
|
+
new CustomEvent("dile-modal-closed", {
|
|
182
|
+
bubbles: true,
|
|
183
|
+
composed: true,
|
|
184
|
+
detail: this,
|
|
185
|
+
})
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
animationEnd() {
|
|
190
|
+
this._toChange = false;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DileNav } from './src/DileNav.js';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { html, css, LitElement } from "lit";
|
|
2
|
+
|
|
3
|
+
export class DileNav extends LitElement {
|
|
4
|
+
static get styles() {
|
|
5
|
+
return css`
|
|
6
|
+
:host {
|
|
7
|
+
display: grid;
|
|
8
|
+
grid-template-columns: auto 1fr auto;
|
|
9
|
+
color: var(--dile-nav-color, #fff);
|
|
10
|
+
background-color: var(--dile-nav-background-color, #666);
|
|
11
|
+
align-items: var(--dile-nav-align-items, center);
|
|
12
|
+
column-gap: var(--dile-nav-column-gap, 1rem);
|
|
13
|
+
padding: var(--dile-nav-padding-y, 0.8rem) var(--dile-nav-padding-x, 0.6rem);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([menu="right"]) {
|
|
17
|
+
grid-template-columns: 1fr auto auto;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host([menu="right"]) .menu {
|
|
21
|
+
grid-row-start: 1;
|
|
22
|
+
grid-row-end: 2;
|
|
23
|
+
grid-column-start: 3;
|
|
24
|
+
grid-column-end: 4;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:host([menu="right"]) .title {
|
|
28
|
+
grid-row-start: 1;
|
|
29
|
+
grid-row-end: 2;
|
|
30
|
+
grid-column-start: 1;
|
|
31
|
+
grid-column-end: 2;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([menu="right"]) .actions {
|
|
35
|
+
grid-row-start: 1;
|
|
36
|
+
grid-row-end: 2;
|
|
37
|
+
grid-column-start: 2;
|
|
38
|
+
grid-column-end: 3;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.title {
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
}
|
|
44
|
+
`
|
|
45
|
+
}
|
|
46
|
+
static get properties() {
|
|
47
|
+
return {
|
|
48
|
+
menu: {
|
|
49
|
+
type: String,
|
|
50
|
+
reflect: true
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
constructor() {
|
|
56
|
+
super();
|
|
57
|
+
this.menu = "left"
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
render() {
|
|
61
|
+
return html`
|
|
62
|
+
<div class="menu"><slot name="menu"></slot></div>
|
|
63
|
+
<div class="title"><slot name="title"></slot></div>
|
|
64
|
+
<div class="actions"><slot name="actions"></slot></div>
|
|
65
|
+
`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DileOrderSwitch } from './src/DileOrderSwitch.js';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { html, css, LitElement } from "lit";
|
|
2
|
+
import { DileEmmitChange } from '../../../mixins/form/index.js';
|
|
3
|
+
import { switchLeftIcon } from '@dile/icons/index.js';
|
|
4
|
+
import '../../icon/icon.js';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export class DileOrderSwitch extends DileEmmitChange(LitElement) {
|
|
8
|
+
static get properties() {
|
|
9
|
+
return {
|
|
10
|
+
value: { type: String },
|
|
11
|
+
name: { type: String },
|
|
12
|
+
label: { type: String },
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
this.value = "asc";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static get styles() {
|
|
22
|
+
return css`
|
|
23
|
+
:host {
|
|
24
|
+
display: block;
|
|
25
|
+
margin-bottom: 10px;
|
|
26
|
+
}
|
|
27
|
+
div {
|
|
28
|
+
align-items: center;
|
|
29
|
+
display: flex;
|
|
30
|
+
}
|
|
31
|
+
span {
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
}
|
|
34
|
+
dile-icon {
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
transform: rotate(-90deg);
|
|
37
|
+
margin-right: 0.4rem;
|
|
38
|
+
transition: transform 0.3s ease-in-out;
|
|
39
|
+
}
|
|
40
|
+
.desc {
|
|
41
|
+
transform: rotate(90deg);
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
render() {
|
|
47
|
+
return html`
|
|
48
|
+
<div @click=${this.toggle}>
|
|
49
|
+
<dile-icon .icon="${switchLeftIcon}" class="${this.value}"></dile-icon>
|
|
50
|
+
<span>
|
|
51
|
+
${this.label}
|
|
52
|
+
</span>
|
|
53
|
+
</div>
|
|
54
|
+
`;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
updated(changedProperties) {
|
|
58
|
+
if(changedProperties.has('value')) {
|
|
59
|
+
if(this.value != "asc" && this.value != "desc") {
|
|
60
|
+
this.value = "asc";
|
|
61
|
+
} else if(changedProperties.get('value')) {
|
|
62
|
+
this.emmitChange();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
toggle() {
|
|
68
|
+
if (this.value === "asc") {
|
|
69
|
+
this.value = "desc";
|
|
70
|
+
} else {
|
|
71
|
+
this.value = "asc";
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DilePages } from './src/DilePages.js';
|