@dile/ui 2.1.6 → 2.1.8
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/components/box-selector/box-selector-item.js +2 -0
- package/components/box-selector/box-selector.js +2 -0
- package/components/box-selector/index.js +2 -0
- package/components/box-selector/src/DileBoxSelector.js +13 -0
- package/components/box-selector/src/DileBoxSelectorItem.js +52 -0
- package/components/button/src/DileButtonIcon.js +1 -1
- package/components/modal/src/DileModalHelp.js +1 -1
- package/components/select/src/DileSelectAjax.js +9 -4
- package/package.json +3 -3
- package/styles/colors.css +2 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { html, css, LitElement } from "lit";
|
|
2
|
+
import { DileSelectable } from "../../../mixins/selectable";
|
|
3
|
+
|
|
4
|
+
export class DileBoxSelector extends DileSelectable(LitElement) {
|
|
5
|
+
static get styles() {
|
|
6
|
+
return css`
|
|
7
|
+
:host {
|
|
8
|
+
display: block;
|
|
9
|
+
}
|
|
10
|
+
`;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { html, css, LitElement } from "lit";
|
|
2
|
+
import { DileSelectableItem } from "../../../mixins/selectable";
|
|
3
|
+
|
|
4
|
+
export class DileBoxSelectorItem extends DileSelectableItem(LitElement) {
|
|
5
|
+
|
|
6
|
+
static get styles() {
|
|
7
|
+
return css`
|
|
8
|
+
:host {
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
background-color: var(--dile-primary-color, #fff);
|
|
11
|
+
color: var(--dile-on-primary-color, #303030);
|
|
12
|
+
border: var(--dile-primary-dark-color, 1px solid #ccc);
|
|
13
|
+
border-radius: var(--dile-box-selector-item-border-radius, 0.5rem);
|
|
14
|
+
padding: var(--dile-box-selector-item-padding, 0.8rem);
|
|
15
|
+
text-align: var(--dile-box-selector-item-text-align, center);
|
|
16
|
+
font-weight: var(--dile-box-selector-item-font-weight, normal);
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static get properties() {
|
|
25
|
+
return {
|
|
26
|
+
label: { type: String },
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
this.label = '';
|
|
33
|
+
this.onClick = this.select.bind(this);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
connectedCallback() {
|
|
37
|
+
super.connectedCallback();
|
|
38
|
+
this.addEventListener('click', this.onClick);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
disconnectedCallback() {
|
|
42
|
+
super.disconnectedCallback();
|
|
43
|
+
this.removeEventListener('click', this.onClick);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
render() {
|
|
47
|
+
return html`
|
|
48
|
+
${this.label}
|
|
49
|
+
`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
}
|
|
@@ -16,7 +16,7 @@ export class DileButtonIcon extends DileButton {
|
|
|
16
16
|
button {
|
|
17
17
|
display: flex;
|
|
18
18
|
align-items: center;
|
|
19
|
-
--dile-icon-color: var(--dile-on-primary-color, #
|
|
19
|
+
--dile-icon-color: var(--dile-on-primary-color, #ffffff);
|
|
20
20
|
}
|
|
21
21
|
dile-icon {
|
|
22
22
|
margin-right: var(--dile-button-icon-separation, 0.3rem);
|
|
@@ -12,7 +12,7 @@ export class DileModalHelp extends LitElement {
|
|
|
12
12
|
--dile-modal-width: var(--dile-modal-help-width, 95vw);
|
|
13
13
|
--dile-modal-height: auto;
|
|
14
14
|
--dile-modal-max-height: 95vh;
|
|
15
|
-
color: #303030;
|
|
15
|
+
color: var(--dile-on-primary-color, #303030);
|
|
16
16
|
--dile-icon-rounded-background-color: var(--dile-primary-color, #2962FF);
|
|
17
17
|
--dile-icon-color: var(--dile-modal-help-icon-color, #fff);
|
|
18
18
|
}
|
|
@@ -151,6 +151,7 @@ export class DileSelectAjax extends DileEmmitChange(LitElement) {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
registerText(json) {
|
|
154
|
+
console.log('json', json);
|
|
154
155
|
this.selectedText = json[this.displayProperty];
|
|
155
156
|
this.loading = false;
|
|
156
157
|
}
|
|
@@ -287,12 +288,16 @@ export class DileSelectAjax extends DileEmmitChange(LitElement) {
|
|
|
287
288
|
}
|
|
288
289
|
|
|
289
290
|
registerData(json) {
|
|
290
|
-
|
|
291
|
-
|
|
291
|
+
this.data = this.getResultData(json);
|
|
292
|
+
this.updateComplete.then( () => this.loading = false )
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
getResultData(json) {
|
|
296
|
+
if (this.resultDataProperty === undefined || this.resultDataProperty === '') {
|
|
297
|
+
return json;
|
|
292
298
|
} else {
|
|
293
|
-
|
|
299
|
+
return json[this.resultDataProperty];
|
|
294
300
|
}
|
|
295
|
-
this.updateComplete.then( () => this.loading = false )
|
|
296
301
|
}
|
|
297
302
|
|
|
298
303
|
doSelected(e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dile/ui",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.8",
|
|
4
4
|
"description": "UI Core components from dile-components.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
},
|
|
21
21
|
"homepage": "https://dile-components.polydile.com/",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@dile/icons": "^2.0.
|
|
23
|
+
"@dile/icons": "^2.0.10",
|
|
24
24
|
"lit": "^2.7.0 || ^3.0.0"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "e3ddacef52e67cdc9c6b0f6e1beda9aa15aeb0f0"
|
|
30
30
|
}
|
package/styles/colors.css
CHANGED