@mmlogic/components 0.3.4 → 0.3.6
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/{collection/utils/cell-renderer.js → mosterdcomponents/cell-renderer-CbRwLOo8.js} +9 -3
- package/dist/mosterdcomponents/cell-renderer-CbRwLOo8.js.map +1 -0
- package/dist/{esm/index.js → mosterdcomponents/client-layout-D88nn5zf.js} +4 -1
- package/dist/mosterdcomponents/client-layout-D88nn5zf.js.map +1 -0
- package/dist/{collection/utils/format.js → mosterdcomponents/format-BAfsQfy1.js} +12 -7
- package/dist/mosterdcomponents/format-BAfsQfy1.js.map +1 -0
- package/dist/{collection/utils/i18n.js → mosterdcomponents/i18n-hoGGKbKU.js} +6 -1
- package/dist/mosterdcomponents/i18n-hoGGKbKU.js.map +1 -0
- package/dist/mosterdcomponents/index-B_tPFIvS.js +4585 -0
- package/dist/mosterdcomponents/index-B_tPFIvS.js.map +1 -0
- package/dist/mosterdcomponents/index-I5SuYv7a.js +4 -0
- package/dist/mosterdcomponents/index-I5SuYv7a.js.map +1 -0
- package/dist/mosterdcomponents/index.esm.js +5 -1
- package/dist/mosterdcomponents/index.esm.js.map +1 -0
- package/dist/mosterdcomponents/mosterdcomponents.css +180 -1
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +50 -1
- package/dist/mosterdcomponents/mosterdcomponents.esm.js.map +1 -0
- package/dist/mosterdcomponents/mrd-boolean-field.entry.js +37 -0
- package/dist/mosterdcomponents/mrd-boolean-field.entry.js.map +1 -0
- package/dist/mosterdcomponents/mrd-currency-field.entry.js +67 -0
- package/dist/mosterdcomponents/mrd-currency-field.entry.js.map +1 -0
- package/dist/mosterdcomponents/mrd-date-field.entry.js +46 -0
- package/dist/mosterdcomponents/mrd-date-field.entry.js.map +1 -0
- package/dist/mosterdcomponents/mrd-datetime-field.entry.js +78 -0
- package/dist/mosterdcomponents/mrd-datetime-field.entry.js.map +1 -0
- package/dist/mosterdcomponents/mrd-email-field.entry.js +50 -0
- package/dist/mosterdcomponents/mrd-email-field.entry.js.map +1 -0
- package/dist/{collection/components/mrd-field/mrd-field.js → mosterdcomponents/mrd-field.entry.js} +28 -179
- package/dist/mosterdcomponents/mrd-field.entry.js.map +1 -0
- package/dist/mosterdcomponents/mrd-file-field.entry.js +108 -0
- package/dist/mosterdcomponents/mrd-file-field.entry.js.map +1 -0
- package/dist/{collection/components/mrd-form/mrd-form.js → mosterdcomponents/mrd-form.entry.js} +82 -280
- package/dist/mosterdcomponents/mrd-form.entry.js.map +1 -0
- package/dist/mosterdcomponents/mrd-hyperlink-field.entry.js +87 -0
- package/dist/mosterdcomponents/mrd-hyperlink-field.entry.js.map +1 -0
- package/dist/mosterdcomponents/mrd-image-field.entry.js +122 -0
- package/dist/mosterdcomponents/mrd-image-field.entry.js.map +1 -0
- package/dist/{collection/components/mrd-layout-section/mrd-layout-section.js → mosterdcomponents/mrd-layout-section.entry.js} +31 -418
- package/dist/mosterdcomponents/mrd-layout-section.entry.js.map +1 -0
- package/dist/mosterdcomponents/mrd-list-field.entry.js +107 -0
- package/dist/mosterdcomponents/mrd-list-field.entry.js.map +1 -0
- package/dist/mosterdcomponents/mrd-longtext-field.entry.js +47 -0
- package/dist/mosterdcomponents/mrd-longtext-field.entry.js.map +1 -0
- package/dist/mosterdcomponents/mrd-number-field.entry.js +87 -0
- package/dist/mosterdcomponents/mrd-number-field.entry.js.map +1 -0
- package/dist/mosterdcomponents/mrd-relation-field.entry.js +267 -0
- package/dist/mosterdcomponents/mrd-relation-field.entry.js.map +1 -0
- package/dist/mosterdcomponents/mrd-secret-field.entry.js +49 -0
- package/dist/mosterdcomponents/mrd-secret-field.entry.js.map +1 -0
- package/dist/{collection/components/mrd-table/mrd-table.js → mosterdcomponents/mrd-table.entry.js} +67 -398
- package/dist/mosterdcomponents/mrd-table.entry.js.map +1 -0
- package/dist/mosterdcomponents/mrd-text-field.entry.js +47 -0
- package/dist/mosterdcomponents/mrd-text-field.entry.js.map +1 -0
- package/dist/mosterdcomponents/mrd-textarea-field.entry.js +86 -0
- package/dist/mosterdcomponents/mrd-textarea-field.entry.js.map +1 -0
- package/dist/mosterdcomponents/mrd-time-field.entry.js +46 -0
- package/dist/mosterdcomponents/mrd-time-field.entry.js.map +1 -0
- package/dist/{esm/quill-CiuCgGz_.js → mosterdcomponents/quill-C9pgw_k-.js} +16282 -1397
- package/dist/mosterdcomponents/quill-C9pgw_k-.js.map +1 -0
- package/dist/{collection/utils/validation.js → mosterdcomponents/validation-ixb43cqU.js} +12 -5
- package/dist/mosterdcomponents/validation-ixb43cqU.js.map +1 -0
- package/dist/types/components/mrd-form/mrd-form.d.ts +13 -1
- package/dist/types/components/mrd-relation-field/mrd-relation-field.d.ts +3 -0
- package/dist/types/components/mrd-table/mrd-table.d.ts +4 -0
- package/dist/types/components.d.ts +19 -9
- package/package.json +1 -1
- package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -5
- package/dist/cjs/index-BPj2cBXs.js +0 -1570
- package/dist/cjs/index.cjs.js +0 -66
- package/dist/cjs/loader.cjs.js +0 -13
- package/dist/cjs/mosterdcomponents.cjs.js +0 -25
- package/dist/cjs/mrd-boolean-field_20.cjs.entry.js +0 -3848
- package/dist/cjs/quill-DmFfnC1f.js +0 -16272
- package/dist/collection/collection-manifest.json +0 -32
- package/dist/collection/components/mrd-boolean-field/mrd-boolean-field.js +0 -199
- package/dist/collection/components/mrd-boolean-field/mrd-boolean-field.scss +0 -77
- package/dist/collection/components/mrd-currency-field/mrd-currency-field.js +0 -248
- package/dist/collection/components/mrd-currency-field/mrd-currency-field.scss +0 -100
- package/dist/collection/components/mrd-date-field/mrd-date-field.js +0 -206
- package/dist/collection/components/mrd-date-field/mrd-date-field.scss +0 -66
- package/dist/collection/components/mrd-datetime-field/mrd-datetime-field.js +0 -240
- package/dist/collection/components/mrd-datetime-field/mrd-datetime-field.scss +0 -66
- package/dist/collection/components/mrd-email-field/mrd-email-field.js +0 -230
- package/dist/collection/components/mrd-email-field/mrd-email-field.scss +0 -69
- package/dist/collection/components/mrd-field/mrd-field.scss +0 -118
- package/dist/collection/components/mrd-file-field/mrd-file-field.js +0 -341
- package/dist/collection/components/mrd-file-field/mrd-file-field.scss +0 -153
- package/dist/collection/components/mrd-form/mrd-form.scss +0 -148
- package/dist/collection/components/mrd-hyperlink-field/mrd-hyperlink-field.js +0 -291
- package/dist/collection/components/mrd-hyperlink-field/mrd-hyperlink-field.scss +0 -91
- package/dist/collection/components/mrd-image-field/mrd-image-field.js +0 -356
- package/dist/collection/components/mrd-image-field/mrd-image-field.scss +0 -190
- package/dist/collection/components/mrd-layout-section/mrd-layout-section.scss +0 -445
- package/dist/collection/components/mrd-list-field/mrd-list-field.js +0 -313
- package/dist/collection/components/mrd-list-field/mrd-list-field.scss +0 -109
- package/dist/collection/components/mrd-longtext-field/mrd-longtext-field.js +0 -227
- package/dist/collection/components/mrd-longtext-field/mrd-longtext-field.scss +0 -78
- package/dist/collection/components/mrd-number-field/mrd-number-field.js +0 -316
- package/dist/collection/components/mrd-number-field/mrd-number-field.scss +0 -77
- package/dist/collection/components/mrd-relation-field/mrd-relation-field.js +0 -678
- package/dist/collection/components/mrd-relation-field/mrd-relation-field.scss +0 -266
- package/dist/collection/components/mrd-secret-field/mrd-secret-field.js +0 -229
- package/dist/collection/components/mrd-secret-field/mrd-secret-field.scss +0 -73
- package/dist/collection/components/mrd-table/mrd-table.scss +0 -742
- package/dist/collection/components/mrd-text-field/mrd-text-field.js +0 -227
- package/dist/collection/components/mrd-text-field/mrd-text-field.scss +0 -69
- package/dist/collection/components/mrd-textarea-field/mrd-textarea-field.js +0 -267
- package/dist/collection/components/mrd-textarea-field/mrd-textarea-field.scss +0 -79
- package/dist/collection/components/mrd-time-field/mrd-time-field.js +0 -206
- package/dist/collection/components/mrd-time-field/mrd-time-field.scss +0 -66
- package/dist/collection/dev/api.js +0 -136
- package/dist/collection/dev/app.js +0 -868
- package/dist/collection/dev/auth.js +0 -156
- package/dist/collection/dev/example-data.js +0 -403
- package/dist/collection/dev/sprites.svg +0 -55
- package/dist/collection/index.js +0 -1
- package/dist/collection/types/client-layout.js +0 -64
- package/dist/collection/types/index.js +0 -1
- package/dist/components/client-layout.js +0 -1
- package/dist/components/format.js +0 -1
- package/dist/components/i18n.js +0 -1
- package/dist/components/index.js +0 -1
- package/dist/components/mrd-boolean-field.js +0 -1
- package/dist/components/mrd-boolean-field2.js +0 -1
- package/dist/components/mrd-currency-field.js +0 -1
- package/dist/components/mrd-currency-field2.js +0 -1
- package/dist/components/mrd-date-field.js +0 -1
- package/dist/components/mrd-date-field2.js +0 -1
- package/dist/components/mrd-datetime-field.js +0 -1
- package/dist/components/mrd-datetime-field2.js +0 -1
- package/dist/components/mrd-email-field.js +0 -1
- package/dist/components/mrd-email-field2.js +0 -1
- package/dist/components/mrd-field.js +0 -1
- package/dist/components/mrd-field2.js +0 -1
- package/dist/components/mrd-file-field.js +0 -1
- package/dist/components/mrd-file-field2.js +0 -1
- package/dist/components/mrd-form.js +0 -1
- package/dist/components/mrd-hyperlink-field.js +0 -1
- package/dist/components/mrd-hyperlink-field2.js +0 -1
- package/dist/components/mrd-image-field.js +0 -1
- package/dist/components/mrd-image-field2.js +0 -1
- package/dist/components/mrd-layout-section.js +0 -1
- package/dist/components/mrd-list-field.js +0 -1
- package/dist/components/mrd-list-field2.js +0 -1
- package/dist/components/mrd-longtext-field.js +0 -1
- package/dist/components/mrd-longtext-field2.js +0 -1
- package/dist/components/mrd-number-field.js +0 -1
- package/dist/components/mrd-number-field2.js +0 -1
- package/dist/components/mrd-relation-field.js +0 -1
- package/dist/components/mrd-relation-field2.js +0 -1
- package/dist/components/mrd-secret-field.js +0 -1
- package/dist/components/mrd-secret-field2.js +0 -1
- package/dist/components/mrd-table.js +0 -1
- package/dist/components/mrd-table2.js +0 -1
- package/dist/components/mrd-text-field.js +0 -1
- package/dist/components/mrd-text-field2.js +0 -1
- package/dist/components/mrd-textarea-field.js +0 -1
- package/dist/components/mrd-textarea-field2.js +0 -1
- package/dist/components/mrd-time-field.js +0 -1
- package/dist/components/mrd-time-field2.js +0 -1
- package/dist/components/quill.js +0 -1
- package/dist/components/validation.js +0 -1
- package/dist/esm/app-globals-DQuL1Twl.js +0 -3
- package/dist/esm/index-_tsCCkAi.js +0 -1561
- package/dist/esm/loader.js +0 -11
- package/dist/esm/mosterdcomponents.js +0 -21
- package/dist/esm/mrd-boolean-field_20.entry.js +0 -3827
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/mosterdcomponents/p-CiuCgGz_.js +0 -1
- package/dist/mosterdcomponents/p-DQuL1Twl.js +0 -1
- package/dist/mosterdcomponents/p-_tsCCkAi.js +0 -2
- package/dist/mosterdcomponents/p-c9839596.entry.js +0 -1
|
@@ -1,313 +0,0 @@
|
|
|
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
|
-
/** List items from the API. Each item has a `key` (stored value) and `label`. */
|
|
14
|
-
this.listItems = [];
|
|
15
|
-
this.error = '';
|
|
16
|
-
this.selected = [];
|
|
17
|
-
this.handleSelectChange = (e) => {
|
|
18
|
-
const select = e.target;
|
|
19
|
-
if (this.multiple) {
|
|
20
|
-
const vals = Array.from(select.selectedOptions).map(o => o.value);
|
|
21
|
-
this.selected = vals;
|
|
22
|
-
if (this.required && !validateRequired(vals)) {
|
|
23
|
-
this.error = t('required', this.locale);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
this.error = '';
|
|
27
|
-
}
|
|
28
|
-
this.mrdChange.emit({ name: this.name, value: vals });
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
const val = select.value;
|
|
32
|
-
if (this.required && !validateRequired(val)) {
|
|
33
|
-
this.error = t('required', this.locale);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
this.error = '';
|
|
37
|
-
}
|
|
38
|
-
this.mrdChange.emit({ name: this.name, value: val });
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
this.handleBlur = () => {
|
|
42
|
-
const val = this.multiple ? this.selected : this.value;
|
|
43
|
-
this.mrdBlur.emit({ name: this.name, value: val });
|
|
44
|
-
};
|
|
45
|
-
this.toggleCheckbox = (key) => {
|
|
46
|
-
if (this.selected.includes(key)) {
|
|
47
|
-
this.selected = this.selected.filter(v => v !== key);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
this.selected = [...this.selected, key];
|
|
51
|
-
}
|
|
52
|
-
if (this.required && !validateRequired(this.selected)) {
|
|
53
|
-
this.error = t('required', this.locale);
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
this.error = '';
|
|
57
|
-
}
|
|
58
|
-
this.mrdChange.emit({ name: this.name, value: this.selected });
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
componentWillLoad() {
|
|
62
|
-
if (this.multiple) {
|
|
63
|
-
this.selected = Array.isArray(this.value) ? this.value : this.value ? [this.value] : [];
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
getContrastColor(bgColor) {
|
|
67
|
-
if (!bgColor)
|
|
68
|
-
return '#000000';
|
|
69
|
-
const hex = bgColor.replace('#', '');
|
|
70
|
-
const r = parseInt(hex.substr(0, 2), 16);
|
|
71
|
-
const g = parseInt(hex.substr(2, 2), 16);
|
|
72
|
-
const b = parseInt(hex.substr(4, 2), 16);
|
|
73
|
-
const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
|
74
|
-
return luminance > 0.5 ? '#000000' : '#ffffff';
|
|
75
|
-
}
|
|
76
|
-
render() {
|
|
77
|
-
var _a, _b;
|
|
78
|
-
const hasError = !!this.error;
|
|
79
|
-
const currentValue = Array.isArray(this.value) ? ((_a = this.value[0]) !== null && _a !== void 0 ? _a : '') : ((_b = this.value) !== null && _b !== void 0 ? _b : '');
|
|
80
|
-
if (this.multiple) {
|
|
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.listItems.map(lv => {
|
|
82
|
-
var _a, _b;
|
|
83
|
-
return (h("label", { key: lv.key, class: "mrd-list-field__checkbox-item" }, h("input", { type: "checkbox", checked: this.selected.includes(lv.key), disabled: this.disabled, onChange: () => this.toggleCheckbox(lv.key) }), (lv.color || lv.backgroundColor) && (h("span", { class: "mrd-list-field__color-dot", style: { backgroundColor: (_b = (_a = lv.backgroundColor) !== null && _a !== void 0 ? _a : lv.color) !== null && _b !== void 0 ? _b : '' } })), h("span", null, lv.label)));
|
|
84
|
-
})), hasError && h("span", { class: "mrd-list-field__error" }, this.error))));
|
|
85
|
-
}
|
|
86
|
-
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.listItems.map(lv => {
|
|
87
|
-
var _a, _b;
|
|
88
|
-
const bg = (_b = (_a = lv.backgroundColor) !== null && _a !== void 0 ? _a : lv.color) !== null && _b !== void 0 ? _b : null;
|
|
89
|
-
const style = bg ? { backgroundColor: bg, color: this.getContrastColor(bg) } : {};
|
|
90
|
-
return (h("option", { key: lv.key, value: lv.key, selected: lv.key === currentValue, style: style }, lv.label));
|
|
91
|
-
})), hasError && h("span", { class: "mrd-list-field__error" }, this.error))));
|
|
92
|
-
}
|
|
93
|
-
static get is() { return "mrd-list-field"; }
|
|
94
|
-
static get encapsulation() { return "scoped"; }
|
|
95
|
-
static get originalStyleUrls() {
|
|
96
|
-
return {
|
|
97
|
-
"$": ["mrd-list-field.scss"]
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
static get styleUrls() {
|
|
101
|
-
return {
|
|
102
|
-
"$": ["mrd-list-field.css"]
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
static get properties() {
|
|
106
|
-
return {
|
|
107
|
-
"name": {
|
|
108
|
-
"type": "string",
|
|
109
|
-
"mutable": false,
|
|
110
|
-
"complexType": {
|
|
111
|
-
"original": "string",
|
|
112
|
-
"resolved": "string",
|
|
113
|
-
"references": {}
|
|
114
|
-
},
|
|
115
|
-
"required": false,
|
|
116
|
-
"optional": false,
|
|
117
|
-
"docs": {
|
|
118
|
-
"tags": [],
|
|
119
|
-
"text": ""
|
|
120
|
-
},
|
|
121
|
-
"getter": false,
|
|
122
|
-
"setter": false,
|
|
123
|
-
"reflect": false,
|
|
124
|
-
"attribute": "name",
|
|
125
|
-
"defaultValue": "''"
|
|
126
|
-
},
|
|
127
|
-
"label": {
|
|
128
|
-
"type": "string",
|
|
129
|
-
"mutable": false,
|
|
130
|
-
"complexType": {
|
|
131
|
-
"original": "string",
|
|
132
|
-
"resolved": "string",
|
|
133
|
-
"references": {}
|
|
134
|
-
},
|
|
135
|
-
"required": false,
|
|
136
|
-
"optional": false,
|
|
137
|
-
"docs": {
|
|
138
|
-
"tags": [],
|
|
139
|
-
"text": ""
|
|
140
|
-
},
|
|
141
|
-
"getter": false,
|
|
142
|
-
"setter": false,
|
|
143
|
-
"reflect": false,
|
|
144
|
-
"attribute": "label",
|
|
145
|
-
"defaultValue": "''"
|
|
146
|
-
},
|
|
147
|
-
"value": {
|
|
148
|
-
"type": "string",
|
|
149
|
-
"mutable": false,
|
|
150
|
-
"complexType": {
|
|
151
|
-
"original": "string | string[]",
|
|
152
|
-
"resolved": "string | string[]",
|
|
153
|
-
"references": {}
|
|
154
|
-
},
|
|
155
|
-
"required": false,
|
|
156
|
-
"optional": false,
|
|
157
|
-
"docs": {
|
|
158
|
-
"tags": [],
|
|
159
|
-
"text": ""
|
|
160
|
-
},
|
|
161
|
-
"getter": false,
|
|
162
|
-
"setter": false,
|
|
163
|
-
"reflect": false,
|
|
164
|
-
"attribute": "value",
|
|
165
|
-
"defaultValue": "''"
|
|
166
|
-
},
|
|
167
|
-
"required": {
|
|
168
|
-
"type": "boolean",
|
|
169
|
-
"mutable": false,
|
|
170
|
-
"complexType": {
|
|
171
|
-
"original": "boolean",
|
|
172
|
-
"resolved": "boolean",
|
|
173
|
-
"references": {}
|
|
174
|
-
},
|
|
175
|
-
"required": false,
|
|
176
|
-
"optional": false,
|
|
177
|
-
"docs": {
|
|
178
|
-
"tags": [],
|
|
179
|
-
"text": ""
|
|
180
|
-
},
|
|
181
|
-
"getter": false,
|
|
182
|
-
"setter": false,
|
|
183
|
-
"reflect": false,
|
|
184
|
-
"attribute": "required",
|
|
185
|
-
"defaultValue": "false"
|
|
186
|
-
},
|
|
187
|
-
"disabled": {
|
|
188
|
-
"type": "boolean",
|
|
189
|
-
"mutable": false,
|
|
190
|
-
"complexType": {
|
|
191
|
-
"original": "boolean",
|
|
192
|
-
"resolved": "boolean",
|
|
193
|
-
"references": {}
|
|
194
|
-
},
|
|
195
|
-
"required": false,
|
|
196
|
-
"optional": false,
|
|
197
|
-
"docs": {
|
|
198
|
-
"tags": [],
|
|
199
|
-
"text": ""
|
|
200
|
-
},
|
|
201
|
-
"getter": false,
|
|
202
|
-
"setter": false,
|
|
203
|
-
"reflect": false,
|
|
204
|
-
"attribute": "disabled",
|
|
205
|
-
"defaultValue": "false"
|
|
206
|
-
},
|
|
207
|
-
"multiple": {
|
|
208
|
-
"type": "boolean",
|
|
209
|
-
"mutable": false,
|
|
210
|
-
"complexType": {
|
|
211
|
-
"original": "boolean",
|
|
212
|
-
"resolved": "boolean",
|
|
213
|
-
"references": {}
|
|
214
|
-
},
|
|
215
|
-
"required": false,
|
|
216
|
-
"optional": false,
|
|
217
|
-
"docs": {
|
|
218
|
-
"tags": [],
|
|
219
|
-
"text": ""
|
|
220
|
-
},
|
|
221
|
-
"getter": false,
|
|
222
|
-
"setter": false,
|
|
223
|
-
"reflect": false,
|
|
224
|
-
"attribute": "multiple",
|
|
225
|
-
"defaultValue": "false"
|
|
226
|
-
},
|
|
227
|
-
"locale": {
|
|
228
|
-
"type": "string",
|
|
229
|
-
"mutable": false,
|
|
230
|
-
"complexType": {
|
|
231
|
-
"original": "string",
|
|
232
|
-
"resolved": "string",
|
|
233
|
-
"references": {}
|
|
234
|
-
},
|
|
235
|
-
"required": false,
|
|
236
|
-
"optional": false,
|
|
237
|
-
"docs": {
|
|
238
|
-
"tags": [],
|
|
239
|
-
"text": ""
|
|
240
|
-
},
|
|
241
|
-
"getter": false,
|
|
242
|
-
"setter": false,
|
|
243
|
-
"reflect": false,
|
|
244
|
-
"attribute": "locale",
|
|
245
|
-
"defaultValue": "navigator.language"
|
|
246
|
-
},
|
|
247
|
-
"listItems": {
|
|
248
|
-
"type": "unknown",
|
|
249
|
-
"mutable": false,
|
|
250
|
-
"complexType": {
|
|
251
|
-
"original": "ClientListValue[]",
|
|
252
|
-
"resolved": "ClientListValue[]",
|
|
253
|
-
"references": {
|
|
254
|
-
"ClientListValue": {
|
|
255
|
-
"location": "import",
|
|
256
|
-
"path": "../../types",
|
|
257
|
-
"id": "src/types/index.ts::ClientListValue",
|
|
258
|
-
"referenceLocation": "ClientListValue"
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
},
|
|
262
|
-
"required": false,
|
|
263
|
-
"optional": false,
|
|
264
|
-
"docs": {
|
|
265
|
-
"tags": [],
|
|
266
|
-
"text": "List items from the API. Each item has a `key` (stored value) and `label`."
|
|
267
|
-
},
|
|
268
|
-
"getter": false,
|
|
269
|
-
"setter": false,
|
|
270
|
-
"defaultValue": "[]"
|
|
271
|
-
}
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
static get states() {
|
|
275
|
-
return {
|
|
276
|
-
"error": {},
|
|
277
|
-
"selected": {}
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
static get events() {
|
|
281
|
-
return [{
|
|
282
|
-
"method": "mrdChange",
|
|
283
|
-
"name": "mrdChange",
|
|
284
|
-
"bubbles": true,
|
|
285
|
-
"cancelable": true,
|
|
286
|
-
"composed": true,
|
|
287
|
-
"docs": {
|
|
288
|
-
"tags": [],
|
|
289
|
-
"text": ""
|
|
290
|
-
},
|
|
291
|
-
"complexType": {
|
|
292
|
-
"original": "{ name: string; value: string | string[] }",
|
|
293
|
-
"resolved": "{ name: string; value: string | string[]; }",
|
|
294
|
-
"references": {}
|
|
295
|
-
}
|
|
296
|
-
}, {
|
|
297
|
-
"method": "mrdBlur",
|
|
298
|
-
"name": "mrdBlur",
|
|
299
|
-
"bubbles": true,
|
|
300
|
-
"cancelable": true,
|
|
301
|
-
"composed": true,
|
|
302
|
-
"docs": {
|
|
303
|
-
"tags": [],
|
|
304
|
-
"text": ""
|
|
305
|
-
},
|
|
306
|
-
"complexType": {
|
|
307
|
-
"original": "{ name: string; value: string | string[] }",
|
|
308
|
-
"resolved": "{ name: string; value: string | string[]; }",
|
|
309
|
-
"references": {}
|
|
310
|
-
}
|
|
311
|
-
}];
|
|
312
|
-
}
|
|
313
|
-
}
|
|
@@ -1,109 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { t } from "../../utils/i18n";
|
|
3
|
-
import { validateRequired } from "../../utils/validation";
|
|
4
|
-
export class MrdLongtextField {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.name = '';
|
|
7
|
-
this.label = '';
|
|
8
|
-
this.value = '';
|
|
9
|
-
this.placeholder = '';
|
|
10
|
-
this.required = false;
|
|
11
|
-
this.disabled = false;
|
|
12
|
-
this.locale = navigator.language;
|
|
13
|
-
this.error = '';
|
|
14
|
-
this.handleInput = (e) => {
|
|
15
|
-
const val = e.target.value;
|
|
16
|
-
this.mrdChange.emit({ name: this.name, value: val });
|
|
17
|
-
};
|
|
18
|
-
this.handleBlur = (e) => {
|
|
19
|
-
const val = e.target.value;
|
|
20
|
-
if (this.required && !validateRequired(val)) {
|
|
21
|
-
this.error = t('required', this.locale);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
this.error = '';
|
|
25
|
-
}
|
|
26
|
-
this.mrdBlur.emit({ name: this.name, value: val });
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
render() {
|
|
30
|
-
const hasError = !!this.error;
|
|
31
|
-
return (h(Host, { key: '10d998b80f54cf7b10be26bf451d808c78579e69' }, h("div", { key: 'af45fe94a41f668bf6ddca670b42e065ee83ef23', class: "mrd-longtext-field" }, this.label && (h("label", { key: '31a08490d695ac9f4bbe5dff6a1ae3bb2a94337d', class: `mrd-longtext-field__label${this.required ? ' mrd-longtext-field__label--required' : ''}` }, this.label)), this.disabled ? (h("pre", { class: "mrd-longtext-field__content" }, this.value)) : (h("textarea", { class: `mrd-longtext-field__input${hasError ? ' mrd-longtext-field__input--error' : ''}`, name: this.name, placeholder: this.placeholder, required: this.required, rows: 10, onInput: this.handleInput, onBlur: this.handleBlur }, this.value)), hasError && h("span", { key: '7f133e72a882a8aaf33245445829754da1e6377b', class: "mrd-longtext-field__error" }, this.error))));
|
|
32
|
-
}
|
|
33
|
-
static get is() { return "mrd-longtext-field"; }
|
|
34
|
-
static get encapsulation() { return "scoped"; }
|
|
35
|
-
static get originalStyleUrls() {
|
|
36
|
-
return {
|
|
37
|
-
"$": ["mrd-longtext-field.scss"]
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
static get styleUrls() {
|
|
41
|
-
return {
|
|
42
|
-
"$": ["mrd-longtext-field.css"]
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
static get properties() {
|
|
46
|
-
return {
|
|
47
|
-
"name": {
|
|
48
|
-
"type": "string",
|
|
49
|
-
"mutable": false,
|
|
50
|
-
"complexType": {
|
|
51
|
-
"original": "string",
|
|
52
|
-
"resolved": "string",
|
|
53
|
-
"references": {}
|
|
54
|
-
},
|
|
55
|
-
"required": false,
|
|
56
|
-
"optional": false,
|
|
57
|
-
"docs": {
|
|
58
|
-
"tags": [],
|
|
59
|
-
"text": ""
|
|
60
|
-
},
|
|
61
|
-
"getter": false,
|
|
62
|
-
"setter": false,
|
|
63
|
-
"reflect": false,
|
|
64
|
-
"attribute": "name",
|
|
65
|
-
"defaultValue": "''"
|
|
66
|
-
},
|
|
67
|
-
"label": {
|
|
68
|
-
"type": "string",
|
|
69
|
-
"mutable": false,
|
|
70
|
-
"complexType": {
|
|
71
|
-
"original": "string",
|
|
72
|
-
"resolved": "string",
|
|
73
|
-
"references": {}
|
|
74
|
-
},
|
|
75
|
-
"required": false,
|
|
76
|
-
"optional": false,
|
|
77
|
-
"docs": {
|
|
78
|
-
"tags": [],
|
|
79
|
-
"text": ""
|
|
80
|
-
},
|
|
81
|
-
"getter": false,
|
|
82
|
-
"setter": false,
|
|
83
|
-
"reflect": false,
|
|
84
|
-
"attribute": "label",
|
|
85
|
-
"defaultValue": "''"
|
|
86
|
-
},
|
|
87
|
-
"value": {
|
|
88
|
-
"type": "string",
|
|
89
|
-
"mutable": false,
|
|
90
|
-
"complexType": {
|
|
91
|
-
"original": "string",
|
|
92
|
-
"resolved": "string",
|
|
93
|
-
"references": {}
|
|
94
|
-
},
|
|
95
|
-
"required": false,
|
|
96
|
-
"optional": false,
|
|
97
|
-
"docs": {
|
|
98
|
-
"tags": [],
|
|
99
|
-
"text": ""
|
|
100
|
-
},
|
|
101
|
-
"getter": false,
|
|
102
|
-
"setter": false,
|
|
103
|
-
"reflect": false,
|
|
104
|
-
"attribute": "value",
|
|
105
|
-
"defaultValue": "''"
|
|
106
|
-
},
|
|
107
|
-
"placeholder": {
|
|
108
|
-
"type": "string",
|
|
109
|
-
"mutable": false,
|
|
110
|
-
"complexType": {
|
|
111
|
-
"original": "string",
|
|
112
|
-
"resolved": "string",
|
|
113
|
-
"references": {}
|
|
114
|
-
},
|
|
115
|
-
"required": false,
|
|
116
|
-
"optional": false,
|
|
117
|
-
"docs": {
|
|
118
|
-
"tags": [],
|
|
119
|
-
"text": ""
|
|
120
|
-
},
|
|
121
|
-
"getter": false,
|
|
122
|
-
"setter": false,
|
|
123
|
-
"reflect": false,
|
|
124
|
-
"attribute": "placeholder",
|
|
125
|
-
"defaultValue": "''"
|
|
126
|
-
},
|
|
127
|
-
"required": {
|
|
128
|
-
"type": "boolean",
|
|
129
|
-
"mutable": false,
|
|
130
|
-
"complexType": {
|
|
131
|
-
"original": "boolean",
|
|
132
|
-
"resolved": "boolean",
|
|
133
|
-
"references": {}
|
|
134
|
-
},
|
|
135
|
-
"required": false,
|
|
136
|
-
"optional": false,
|
|
137
|
-
"docs": {
|
|
138
|
-
"tags": [],
|
|
139
|
-
"text": ""
|
|
140
|
-
},
|
|
141
|
-
"getter": false,
|
|
142
|
-
"setter": false,
|
|
143
|
-
"reflect": false,
|
|
144
|
-
"attribute": "required",
|
|
145
|
-
"defaultValue": "false"
|
|
146
|
-
},
|
|
147
|
-
"disabled": {
|
|
148
|
-
"type": "boolean",
|
|
149
|
-
"mutable": false,
|
|
150
|
-
"complexType": {
|
|
151
|
-
"original": "boolean",
|
|
152
|
-
"resolved": "boolean",
|
|
153
|
-
"references": {}
|
|
154
|
-
},
|
|
155
|
-
"required": false,
|
|
156
|
-
"optional": false,
|
|
157
|
-
"docs": {
|
|
158
|
-
"tags": [],
|
|
159
|
-
"text": ""
|
|
160
|
-
},
|
|
161
|
-
"getter": false,
|
|
162
|
-
"setter": false,
|
|
163
|
-
"reflect": false,
|
|
164
|
-
"attribute": "disabled",
|
|
165
|
-
"defaultValue": "false"
|
|
166
|
-
},
|
|
167
|
-
"locale": {
|
|
168
|
-
"type": "string",
|
|
169
|
-
"mutable": false,
|
|
170
|
-
"complexType": {
|
|
171
|
-
"original": "string",
|
|
172
|
-
"resolved": "string",
|
|
173
|
-
"references": {}
|
|
174
|
-
},
|
|
175
|
-
"required": false,
|
|
176
|
-
"optional": false,
|
|
177
|
-
"docs": {
|
|
178
|
-
"tags": [],
|
|
179
|
-
"text": ""
|
|
180
|
-
},
|
|
181
|
-
"getter": false,
|
|
182
|
-
"setter": false,
|
|
183
|
-
"reflect": false,
|
|
184
|
-
"attribute": "locale",
|
|
185
|
-
"defaultValue": "navigator.language"
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
static get states() {
|
|
190
|
-
return {
|
|
191
|
-
"error": {}
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
static get events() {
|
|
195
|
-
return [{
|
|
196
|
-
"method": "mrdChange",
|
|
197
|
-
"name": "mrdChange",
|
|
198
|
-
"bubbles": true,
|
|
199
|
-
"cancelable": true,
|
|
200
|
-
"composed": true,
|
|
201
|
-
"docs": {
|
|
202
|
-
"tags": [],
|
|
203
|
-
"text": ""
|
|
204
|
-
},
|
|
205
|
-
"complexType": {
|
|
206
|
-
"original": "{ name: string; value: string }",
|
|
207
|
-
"resolved": "{ name: string; value: string; }",
|
|
208
|
-
"references": {}
|
|
209
|
-
}
|
|
210
|
-
}, {
|
|
211
|
-
"method": "mrdBlur",
|
|
212
|
-
"name": "mrdBlur",
|
|
213
|
-
"bubbles": true,
|
|
214
|
-
"cancelable": true,
|
|
215
|
-
"composed": true,
|
|
216
|
-
"docs": {
|
|
217
|
-
"tags": [],
|
|
218
|
-
"text": ""
|
|
219
|
-
},
|
|
220
|
-
"complexType": {
|
|
221
|
-
"original": "{ name: string; value: string }",
|
|
222
|
-
"resolved": "{ name: string; value: string; }",
|
|
223
|
-
"references": {}
|
|
224
|
-
}
|
|
225
|
-
}];
|
|
226
|
-
}
|
|
227
|
-
}
|