@mmlogic/components 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/README.md +221 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/format-CDw-zie_.js +82 -0
- package/dist/cjs/index-OvnIRO4Y.js +1523 -0
- package/dist/cjs/index.cjs.js +32 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/mosterdcomponents.cjs.js +25 -0
- package/dist/cjs/mrd-boolean-field_16.cjs.entry.js +1185 -0
- package/dist/cjs/mrd-table.cjs.entry.js +322 -0
- package/dist/cjs/quill-DmFfnC1f.js +16272 -0
- package/dist/collection/collection-manifest.json +29 -0
- package/dist/collection/components/mrd-boolean-field/mrd-boolean-field.js +199 -0
- package/dist/collection/components/mrd-boolean-field/mrd-boolean-field.scss +77 -0
- package/dist/collection/components/mrd-currency-field/mrd-currency-field.js +248 -0
- package/dist/collection/components/mrd-currency-field/mrd-currency-field.scss +100 -0
- package/dist/collection/components/mrd-date-field/mrd-date-field.js +206 -0
- package/dist/collection/components/mrd-date-field/mrd-date-field.scss +66 -0
- package/dist/collection/components/mrd-datetime-field/mrd-datetime-field.js +206 -0
- package/dist/collection/components/mrd-datetime-field/mrd-datetime-field.scss +66 -0
- package/dist/collection/components/mrd-email-field/mrd-email-field.js +230 -0
- package/dist/collection/components/mrd-email-field/mrd-email-field.scss +69 -0
- package/dist/collection/components/mrd-field/mrd-field.js +187 -0
- package/dist/collection/components/mrd-file-field/mrd-file-field.js +273 -0
- package/dist/collection/components/mrd-file-field/mrd-file-field.scss +140 -0
- package/dist/collection/components/mrd-form/mrd-form.js +245 -0
- package/dist/collection/components/mrd-form/mrd-form.scss +116 -0
- package/dist/collection/components/mrd-hyperlink-field/mrd-hyperlink-field.js +230 -0
- package/dist/collection/components/mrd-hyperlink-field/mrd-hyperlink-field.scss +69 -0
- package/dist/collection/components/mrd-image-field/mrd-image-field.js +287 -0
- package/dist/collection/components/mrd-image-field/mrd-image-field.scss +166 -0
- package/dist/collection/components/mrd-list-field/mrd-list-field.js +311 -0
- package/dist/collection/components/mrd-list-field/mrd-list-field.scss +109 -0
- package/dist/collection/components/mrd-number-field/mrd-number-field.js +316 -0
- package/dist/collection/components/mrd-number-field/mrd-number-field.scss +77 -0
- package/dist/collection/components/mrd-relation-field/mrd-relation-field.js +490 -0
- package/dist/collection/components/mrd-relation-field/mrd-relation-field.scss +266 -0
- package/dist/collection/components/mrd-table/mrd-table.js +522 -0
- package/dist/collection/components/mrd-table/mrd-table.scss +158 -0
- package/dist/collection/components/mrd-text-field/mrd-text-field.js +227 -0
- package/dist/collection/components/mrd-text-field/mrd-text-field.scss +69 -0
- package/dist/collection/components/mrd-textarea-field/mrd-textarea-field.js +267 -0
- package/dist/collection/components/mrd-textarea-field/mrd-textarea-field.scss +79 -0
- package/dist/collection/components/mrd-time-field/mrd-time-field.js +206 -0
- package/dist/collection/components/mrd-time-field/mrd-time-field.scss +66 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/types/client-layout.js +30 -0
- package/dist/collection/types/index.js +1 -0
- package/dist/collection/utils/cell-renderer.js +57 -0
- package/dist/collection/utils/format.js +72 -0
- package/dist/collection/utils/i18n.js +80 -0
- package/dist/collection/utils/validation.js +46 -0
- package/dist/components/client-layout.js +1 -0
- package/dist/components/format.js +1 -0
- package/dist/components/i18n.js +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/mrd-boolean-field.d.ts +11 -0
- package/dist/components/mrd-boolean-field.js +1 -0
- package/dist/components/mrd-boolean-field2.js +1 -0
- package/dist/components/mrd-currency-field.d.ts +11 -0
- package/dist/components/mrd-currency-field.js +1 -0
- package/dist/components/mrd-currency-field2.js +1 -0
- package/dist/components/mrd-date-field.d.ts +11 -0
- package/dist/components/mrd-date-field.js +1 -0
- package/dist/components/mrd-date-field2.js +1 -0
- package/dist/components/mrd-datetime-field.d.ts +11 -0
- package/dist/components/mrd-datetime-field.js +1 -0
- package/dist/components/mrd-datetime-field2.js +1 -0
- package/dist/components/mrd-email-field.d.ts +11 -0
- package/dist/components/mrd-email-field.js +1 -0
- package/dist/components/mrd-email-field2.js +1 -0
- package/dist/components/mrd-field.d.ts +11 -0
- package/dist/components/mrd-field.js +1 -0
- package/dist/components/mrd-field2.js +1 -0
- package/dist/components/mrd-file-field.d.ts +11 -0
- package/dist/components/mrd-file-field.js +1 -0
- package/dist/components/mrd-file-field2.js +1 -0
- package/dist/components/mrd-form.d.ts +11 -0
- package/dist/components/mrd-form.js +1 -0
- package/dist/components/mrd-hyperlink-field.d.ts +11 -0
- package/dist/components/mrd-hyperlink-field.js +1 -0
- package/dist/components/mrd-hyperlink-field2.js +1 -0
- package/dist/components/mrd-image-field.d.ts +11 -0
- package/dist/components/mrd-image-field.js +1 -0
- package/dist/components/mrd-image-field2.js +1 -0
- package/dist/components/mrd-list-field.d.ts +11 -0
- package/dist/components/mrd-list-field.js +1 -0
- package/dist/components/mrd-list-field2.js +1 -0
- package/dist/components/mrd-number-field.d.ts +11 -0
- package/dist/components/mrd-number-field.js +1 -0
- package/dist/components/mrd-number-field2.js +1 -0
- package/dist/components/mrd-relation-field.d.ts +11 -0
- package/dist/components/mrd-relation-field.js +1 -0
- package/dist/components/mrd-relation-field2.js +1 -0
- package/dist/components/mrd-table.d.ts +11 -0
- package/dist/components/mrd-table.js +1 -0
- package/dist/components/mrd-text-field.d.ts +11 -0
- package/dist/components/mrd-text-field.js +1 -0
- package/dist/components/mrd-text-field2.js +1 -0
- package/dist/components/mrd-textarea-field.d.ts +11 -0
- package/dist/components/mrd-textarea-field.js +1 -0
- package/dist/components/mrd-textarea-field2.js +1 -0
- package/dist/components/mrd-time-field.d.ts +11 -0
- package/dist/components/mrd-time-field.js +1 -0
- package/dist/components/mrd-time-field2.js +1 -0
- package/dist/components/quill.js +1 -0
- package/dist/components/validation.js +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/format-Dt-aHxkM.js +74 -0
- package/dist/esm/index-DQ_he8te.js +1514 -0
- package/dist/esm/index.js +32 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/mosterdcomponents.js +21 -0
- package/dist/esm/mrd-boolean-field_16.entry.js +1168 -0
- package/dist/esm/mrd-table.entry.js +320 -0
- package/dist/esm/quill-CiuCgGz_.js +16266 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/mosterdcomponents/index.esm.js +1 -0
- package/dist/mosterdcomponents/mosterdcomponents.css +1 -0
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -0
- package/dist/mosterdcomponents/p-88cd0930.entry.js +1 -0
- package/dist/mosterdcomponents/p-926ed331.entry.js +1 -0
- package/dist/mosterdcomponents/p-CiuCgGz_.js +1 -0
- package/dist/mosterdcomponents/p-DQ_he8te.js +2 -0
- package/dist/mosterdcomponents/p-DQuL1Twl.js +1 -0
- package/dist/mosterdcomponents/p-Dt-aHxkM.js +1 -0
- package/dist/types/components/mrd-boolean-field/mrd-boolean-field.d.ts +22 -0
- package/dist/types/components/mrd-currency-field/mrd-currency-field.d.ts +26 -0
- package/dist/types/components/mrd-date-field/mrd-date-field.d.ts +21 -0
- package/dist/types/components/mrd-datetime-field/mrd-datetime-field.d.ts +21 -0
- package/dist/types/components/mrd-email-field/mrd-email-field.d.ts +22 -0
- package/dist/types/components/mrd-field/mrd-field.d.ts +23 -0
- package/dist/types/components/mrd-file-field/mrd-file-field.d.ts +30 -0
- package/dist/types/components/mrd-form/mrd-form.d.ts +24 -0
- package/dist/types/components/mrd-hyperlink-field/mrd-hyperlink-field.d.ts +22 -0
- package/dist/types/components/mrd-image-field/mrd-image-field.d.ts +31 -0
- package/dist/types/components/mrd-list-field/mrd-list-field.d.ts +28 -0
- package/dist/types/components/mrd-number-field/mrd-number-field.d.ts +29 -0
- package/dist/types/components/mrd-relation-field/mrd-relation-field.d.ts +44 -0
- package/dist/types/components/mrd-table/mrd-table.d.ts +72 -0
- package/dist/types/components/mrd-text-field/mrd-text-field.d.ts +22 -0
- package/dist/types/components/mrd-textarea-field/mrd-textarea-field.d.ts +25 -0
- package/dist/types/components/mrd-time-field/mrd-time-field.d.ts +21 -0
- package/dist/types/components.d.ts +1609 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1860 -0
- package/dist/types/types/client-layout.d.ts +76 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/utils/cell-renderer.d.ts +14 -0
- package/dist/types/utils/format.d.ts +7 -0
- package/dist/types/utils/i18n.d.ts +1 -0
- package/dist/types/utils/validation.d.ts +5 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +54 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { t } from "../../utils/i18n";
|
|
3
|
+
import { validateRequired } from "../../utils/validation";
|
|
4
|
+
export class MrdListField {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = '';
|
|
7
|
+
this.label = '';
|
|
8
|
+
this.value = '';
|
|
9
|
+
this.required = false;
|
|
10
|
+
this.disabled = false;
|
|
11
|
+
this.multiple = false;
|
|
12
|
+
this.locale = navigator.language;
|
|
13
|
+
this.listValues = [];
|
|
14
|
+
this.error = '';
|
|
15
|
+
this.selected = [];
|
|
16
|
+
this.handleSelectChange = (e) => {
|
|
17
|
+
const select = e.target;
|
|
18
|
+
if (this.multiple) {
|
|
19
|
+
const vals = Array.from(select.selectedOptions).map(o => o.value);
|
|
20
|
+
this.selected = vals;
|
|
21
|
+
if (this.required && !validateRequired(vals)) {
|
|
22
|
+
this.error = t('required', this.locale);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
this.error = '';
|
|
26
|
+
}
|
|
27
|
+
this.mrdChange.emit({ name: this.name, value: vals });
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
const val = select.value;
|
|
31
|
+
if (this.required && !validateRequired(val)) {
|
|
32
|
+
this.error = t('required', this.locale);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
this.error = '';
|
|
36
|
+
}
|
|
37
|
+
this.mrdChange.emit({ name: this.name, value: val });
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
this.handleBlur = () => {
|
|
41
|
+
const val = this.multiple ? this.selected : this.value;
|
|
42
|
+
this.mrdBlur.emit({ name: this.name, value: val });
|
|
43
|
+
};
|
|
44
|
+
this.toggleCheckbox = (val) => {
|
|
45
|
+
if (this.selected.includes(val)) {
|
|
46
|
+
this.selected = this.selected.filter(v => v !== val);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
this.selected = [...this.selected, val];
|
|
50
|
+
}
|
|
51
|
+
if (this.required && !validateRequired(this.selected)) {
|
|
52
|
+
this.error = t('required', this.locale);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
this.error = '';
|
|
56
|
+
}
|
|
57
|
+
this.mrdChange.emit({ name: this.name, value: this.selected });
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
componentWillLoad() {
|
|
61
|
+
if (this.multiple) {
|
|
62
|
+
this.selected = Array.isArray(this.value) ? this.value : this.value ? [this.value] : [];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
getContrastColor(bgColor) {
|
|
66
|
+
if (!bgColor)
|
|
67
|
+
return '#000000';
|
|
68
|
+
const hex = bgColor.replace('#', '');
|
|
69
|
+
const r = parseInt(hex.substr(0, 2), 16);
|
|
70
|
+
const g = parseInt(hex.substr(2, 2), 16);
|
|
71
|
+
const b = parseInt(hex.substr(4, 2), 16);
|
|
72
|
+
const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
|
73
|
+
return luminance > 0.5 ? '#000000' : '#ffffff';
|
|
74
|
+
}
|
|
75
|
+
render() {
|
|
76
|
+
var _a, _b;
|
|
77
|
+
const hasError = !!this.error;
|
|
78
|
+
const currentValue = Array.isArray(this.value) ? ((_a = this.value[0]) !== null && _a !== void 0 ? _a : '') : ((_b = this.value) !== null && _b !== void 0 ? _b : '');
|
|
79
|
+
if (this.multiple) {
|
|
80
|
+
// Render checkbox list for multi-select
|
|
81
|
+
return (h(Host, null, h("div", { class: "mrd-list-field" }, this.label && (h("label", { class: `mrd-list-field__label${this.required ? ' mrd-list-field__label--required' : ''}` }, this.label)), h("div", { class: `mrd-list-field__checkbox-list${hasError ? ' mrd-list-field__checkbox-list--error' : ''}` }, this.listValues.map(lv => (h("label", { key: lv.value, class: "mrd-list-field__checkbox-item" }, h("input", { type: "checkbox", checked: this.selected.includes(lv.value), disabled: this.disabled, onChange: () => this.toggleCheckbox(lv.value) }), lv.color && (h("span", { class: "mrd-list-field__color-dot", style: { backgroundColor: lv.color } })), h("span", null, lv.label))))), hasError && h("span", { class: "mrd-list-field__error" }, this.error))));
|
|
82
|
+
}
|
|
83
|
+
// Single select dropdown
|
|
84
|
+
return (h(Host, null, h("div", { class: "mrd-list-field" }, this.label && (h("label", { class: `mrd-list-field__label${this.required ? ' mrd-list-field__label--required' : ''}` }, this.label)), h("select", { class: `mrd-list-field__select${hasError ? ' mrd-list-field__select--error' : ''}`, name: this.name, required: this.required, disabled: this.disabled, onChange: this.handleSelectChange, onBlur: this.handleBlur }, h("option", { value: "" }, t('select_placeholder', this.locale)), this.listValues.map(lv => {
|
|
85
|
+
const style = lv.color
|
|
86
|
+
? { backgroundColor: lv.color, color: this.getContrastColor(lv.color) }
|
|
87
|
+
: {};
|
|
88
|
+
return (h("option", { key: lv.value, value: lv.value, selected: lv.value === currentValue, style: style }, lv.label));
|
|
89
|
+
})), hasError && h("span", { class: "mrd-list-field__error" }, this.error))));
|
|
90
|
+
}
|
|
91
|
+
static get is() { return "mrd-list-field"; }
|
|
92
|
+
static get encapsulation() { return "scoped"; }
|
|
93
|
+
static get originalStyleUrls() {
|
|
94
|
+
return {
|
|
95
|
+
"$": ["mrd-list-field.scss"]
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
static get styleUrls() {
|
|
99
|
+
return {
|
|
100
|
+
"$": ["mrd-list-field.css"]
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
static get properties() {
|
|
104
|
+
return {
|
|
105
|
+
"name": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"mutable": false,
|
|
108
|
+
"complexType": {
|
|
109
|
+
"original": "string",
|
|
110
|
+
"resolved": "string",
|
|
111
|
+
"references": {}
|
|
112
|
+
},
|
|
113
|
+
"required": false,
|
|
114
|
+
"optional": false,
|
|
115
|
+
"docs": {
|
|
116
|
+
"tags": [],
|
|
117
|
+
"text": ""
|
|
118
|
+
},
|
|
119
|
+
"getter": false,
|
|
120
|
+
"setter": false,
|
|
121
|
+
"reflect": false,
|
|
122
|
+
"attribute": "name",
|
|
123
|
+
"defaultValue": "''"
|
|
124
|
+
},
|
|
125
|
+
"label": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"mutable": false,
|
|
128
|
+
"complexType": {
|
|
129
|
+
"original": "string",
|
|
130
|
+
"resolved": "string",
|
|
131
|
+
"references": {}
|
|
132
|
+
},
|
|
133
|
+
"required": false,
|
|
134
|
+
"optional": false,
|
|
135
|
+
"docs": {
|
|
136
|
+
"tags": [],
|
|
137
|
+
"text": ""
|
|
138
|
+
},
|
|
139
|
+
"getter": false,
|
|
140
|
+
"setter": false,
|
|
141
|
+
"reflect": false,
|
|
142
|
+
"attribute": "label",
|
|
143
|
+
"defaultValue": "''"
|
|
144
|
+
},
|
|
145
|
+
"value": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"mutable": false,
|
|
148
|
+
"complexType": {
|
|
149
|
+
"original": "string | string[]",
|
|
150
|
+
"resolved": "string | string[]",
|
|
151
|
+
"references": {}
|
|
152
|
+
},
|
|
153
|
+
"required": false,
|
|
154
|
+
"optional": false,
|
|
155
|
+
"docs": {
|
|
156
|
+
"tags": [],
|
|
157
|
+
"text": ""
|
|
158
|
+
},
|
|
159
|
+
"getter": false,
|
|
160
|
+
"setter": false,
|
|
161
|
+
"reflect": false,
|
|
162
|
+
"attribute": "value",
|
|
163
|
+
"defaultValue": "''"
|
|
164
|
+
},
|
|
165
|
+
"required": {
|
|
166
|
+
"type": "boolean",
|
|
167
|
+
"mutable": false,
|
|
168
|
+
"complexType": {
|
|
169
|
+
"original": "boolean",
|
|
170
|
+
"resolved": "boolean",
|
|
171
|
+
"references": {}
|
|
172
|
+
},
|
|
173
|
+
"required": false,
|
|
174
|
+
"optional": false,
|
|
175
|
+
"docs": {
|
|
176
|
+
"tags": [],
|
|
177
|
+
"text": ""
|
|
178
|
+
},
|
|
179
|
+
"getter": false,
|
|
180
|
+
"setter": false,
|
|
181
|
+
"reflect": false,
|
|
182
|
+
"attribute": "required",
|
|
183
|
+
"defaultValue": "false"
|
|
184
|
+
},
|
|
185
|
+
"disabled": {
|
|
186
|
+
"type": "boolean",
|
|
187
|
+
"mutable": false,
|
|
188
|
+
"complexType": {
|
|
189
|
+
"original": "boolean",
|
|
190
|
+
"resolved": "boolean",
|
|
191
|
+
"references": {}
|
|
192
|
+
},
|
|
193
|
+
"required": false,
|
|
194
|
+
"optional": false,
|
|
195
|
+
"docs": {
|
|
196
|
+
"tags": [],
|
|
197
|
+
"text": ""
|
|
198
|
+
},
|
|
199
|
+
"getter": false,
|
|
200
|
+
"setter": false,
|
|
201
|
+
"reflect": false,
|
|
202
|
+
"attribute": "disabled",
|
|
203
|
+
"defaultValue": "false"
|
|
204
|
+
},
|
|
205
|
+
"multiple": {
|
|
206
|
+
"type": "boolean",
|
|
207
|
+
"mutable": false,
|
|
208
|
+
"complexType": {
|
|
209
|
+
"original": "boolean",
|
|
210
|
+
"resolved": "boolean",
|
|
211
|
+
"references": {}
|
|
212
|
+
},
|
|
213
|
+
"required": false,
|
|
214
|
+
"optional": false,
|
|
215
|
+
"docs": {
|
|
216
|
+
"tags": [],
|
|
217
|
+
"text": ""
|
|
218
|
+
},
|
|
219
|
+
"getter": false,
|
|
220
|
+
"setter": false,
|
|
221
|
+
"reflect": false,
|
|
222
|
+
"attribute": "multiple",
|
|
223
|
+
"defaultValue": "false"
|
|
224
|
+
},
|
|
225
|
+
"locale": {
|
|
226
|
+
"type": "string",
|
|
227
|
+
"mutable": false,
|
|
228
|
+
"complexType": {
|
|
229
|
+
"original": "string",
|
|
230
|
+
"resolved": "string",
|
|
231
|
+
"references": {}
|
|
232
|
+
},
|
|
233
|
+
"required": false,
|
|
234
|
+
"optional": false,
|
|
235
|
+
"docs": {
|
|
236
|
+
"tags": [],
|
|
237
|
+
"text": ""
|
|
238
|
+
},
|
|
239
|
+
"getter": false,
|
|
240
|
+
"setter": false,
|
|
241
|
+
"reflect": false,
|
|
242
|
+
"attribute": "locale",
|
|
243
|
+
"defaultValue": "navigator.language"
|
|
244
|
+
},
|
|
245
|
+
"listValues": {
|
|
246
|
+
"type": "unknown",
|
|
247
|
+
"mutable": false,
|
|
248
|
+
"complexType": {
|
|
249
|
+
"original": "ClientListValue[]",
|
|
250
|
+
"resolved": "ClientListValue[]",
|
|
251
|
+
"references": {
|
|
252
|
+
"ClientListValue": {
|
|
253
|
+
"location": "import",
|
|
254
|
+
"path": "../../types",
|
|
255
|
+
"id": "src/types/index.ts::ClientListValue",
|
|
256
|
+
"referenceLocation": "ClientListValue"
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"required": false,
|
|
261
|
+
"optional": false,
|
|
262
|
+
"docs": {
|
|
263
|
+
"tags": [],
|
|
264
|
+
"text": ""
|
|
265
|
+
},
|
|
266
|
+
"getter": false,
|
|
267
|
+
"setter": false,
|
|
268
|
+
"defaultValue": "[]"
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
static get states() {
|
|
273
|
+
return {
|
|
274
|
+
"error": {},
|
|
275
|
+
"selected": {}
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
static get events() {
|
|
279
|
+
return [{
|
|
280
|
+
"method": "mrdChange",
|
|
281
|
+
"name": "mrdChange",
|
|
282
|
+
"bubbles": true,
|
|
283
|
+
"cancelable": true,
|
|
284
|
+
"composed": true,
|
|
285
|
+
"docs": {
|
|
286
|
+
"tags": [],
|
|
287
|
+
"text": ""
|
|
288
|
+
},
|
|
289
|
+
"complexType": {
|
|
290
|
+
"original": "{ name: string; value: string | string[] }",
|
|
291
|
+
"resolved": "{ name: string; value: string | string[]; }",
|
|
292
|
+
"references": {}
|
|
293
|
+
}
|
|
294
|
+
}, {
|
|
295
|
+
"method": "mrdBlur",
|
|
296
|
+
"name": "mrdBlur",
|
|
297
|
+
"bubbles": true,
|
|
298
|
+
"cancelable": true,
|
|
299
|
+
"composed": true,
|
|
300
|
+
"docs": {
|
|
301
|
+
"tags": [],
|
|
302
|
+
"text": ""
|
|
303
|
+
},
|
|
304
|
+
"complexType": {
|
|
305
|
+
"original": "{ name: string; value: string | string[] }",
|
|
306
|
+
"resolved": "{ name: string; value: string | string[]; }",
|
|
307
|
+
"references": {}
|
|
308
|
+
}
|
|
309
|
+
}];
|
|
310
|
+
}
|
|
311
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.mrd-list-field {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: var(--mrd-space-1);
|
|
9
|
+
width: 100%;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.mrd-list-field__label {
|
|
13
|
+
display: block;
|
|
14
|
+
font-family: var(--mrd-font-family);
|
|
15
|
+
font-size: var(--mrd-label-font-size);
|
|
16
|
+
font-weight: var(--mrd-label-font-weight);
|
|
17
|
+
color: var(--mrd-label-color);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.mrd-list-field__label--required::after {
|
|
21
|
+
content: ' *';
|
|
22
|
+
color: var(--mrd-color-danger);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.mrd-list-field__select {
|
|
26
|
+
display: block;
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: var(--mrd-input-height);
|
|
29
|
+
padding: var(--mrd-input-padding-y) var(--mrd-input-padding-x);
|
|
30
|
+
padding-right: calc(var(--mrd-input-padding-x) + 1.5rem);
|
|
31
|
+
font-family: var(--mrd-font-family);
|
|
32
|
+
font-size: var(--mrd-font-size-base);
|
|
33
|
+
color: var(--mrd-input-color);
|
|
34
|
+
background-color: var(--mrd-input-bg);
|
|
35
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
|
|
36
|
+
background-repeat: no-repeat;
|
|
37
|
+
background-position: right var(--mrd-space-3) center;
|
|
38
|
+
border: var(--mrd-border-width) solid var(--mrd-border-color);
|
|
39
|
+
border-radius: var(--mrd-border-radius);
|
|
40
|
+
transition: border-color var(--mrd-transition), box-shadow var(--mrd-transition);
|
|
41
|
+
outline: none;
|
|
42
|
+
appearance: none;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.mrd-list-field__select:focus {
|
|
48
|
+
border-color: var(--mrd-border-color-focus);
|
|
49
|
+
box-shadow: var(--mrd-shadow-focus);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.mrd-list-field__select:disabled {
|
|
53
|
+
background-color: var(--mrd-input-bg-disabled);
|
|
54
|
+
cursor: not-allowed;
|
|
55
|
+
opacity: 0.7;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.mrd-list-field__select--error {
|
|
59
|
+
border-color: var(--mrd-border-color-error);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.mrd-list-field__select--error:focus {
|
|
63
|
+
box-shadow: var(--mrd-shadow-focus-error);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.mrd-list-field__checkbox-list {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
gap: var(--mrd-space-2);
|
|
70
|
+
padding: var(--mrd-space-3);
|
|
71
|
+
border: var(--mrd-border-width) solid var(--mrd-border-color);
|
|
72
|
+
border-radius: var(--mrd-border-radius);
|
|
73
|
+
background-color: var(--mrd-input-bg);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.mrd-list-field__checkbox-list--error {
|
|
77
|
+
border-color: var(--mrd-border-color-error);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.mrd-list-field__checkbox-item {
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
gap: var(--mrd-space-2);
|
|
84
|
+
font-family: var(--mrd-font-family);
|
|
85
|
+
font-size: var(--mrd-font-size-base);
|
|
86
|
+
color: var(--mrd-input-color);
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.mrd-list-field__checkbox-item input[type='checkbox'] {
|
|
91
|
+
width: 1rem;
|
|
92
|
+
height: 1rem;
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
accent-color: var(--mrd-color-primary);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.mrd-list-field__color-dot {
|
|
98
|
+
display: inline-block;
|
|
99
|
+
width: 12px;
|
|
100
|
+
height: 12px;
|
|
101
|
+
border-radius: 50%;
|
|
102
|
+
flex-shrink: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.mrd-list-field__error {
|
|
106
|
+
font-family: var(--mrd-font-family);
|
|
107
|
+
font-size: var(--mrd-error-font-size);
|
|
108
|
+
color: var(--mrd-error-color);
|
|
109
|
+
}
|