@shortfuse/materialdesignweb 0.7.4 → 0.7.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.
@@ -25,7 +25,7 @@ export default CustomElement
25
25
  delegatesFocus: true,
26
26
  })
27
27
  .observe({
28
- type: { value: 'button' },
28
+ type: { empty: 'button' },
29
29
  elevated: 'boolean',
30
30
  filled: 'string',
31
31
  outlined: 'boolean',
@@ -57,7 +57,6 @@ export default CustomElement
57
57
 
58
58
  shape.setAttribute('filled', '{filled}');
59
59
  control.setAttribute('role', 'button');
60
- control.setAttribute('type', 'button');
61
60
  },
62
61
  })
63
62
  .css`
@@ -139,7 +139,6 @@ export default CustomElement
139
139
  <slot id=slot></slot>
140
140
  `);
141
141
 
142
- control.setAttribute('type', 'checkbox');
143
142
  // Indeterminate must be manually expressed for ARIA
144
143
  control.setAttribute('aria-checked', '{_ariaChecked}');
145
144
  },
@@ -33,7 +33,6 @@ export default Chip
33
33
  icon.setAttribute('ink', '{iconInk}');
34
34
 
35
35
  control.removeAttribute('role');
36
- control.setAttribute('type', 'checkbox');
37
36
 
38
37
  outline.removeAttribute('ink');
39
38
  outline.removeAttribute('color');
@@ -11,6 +11,11 @@ export default CustomElement
11
11
 
12
12
  :host {
13
13
  display: block;
14
+
15
+ /* QOL */
16
+ font: var(--mdw-typescale__body-large__font);
17
+ letter-spacing: var(--mdw-typescale__body-large__letter-spacing);
18
+
14
19
  }
15
20
 
16
21
  /* Pane Slot */
@@ -149,6 +149,10 @@ export default class ListOption extends ListItem
149
149
  if (selected !== undefined) {
150
150
  this._selected = selected;
151
151
  }
152
+ }
153
+
154
+ connectedCallback() {
155
+ super.connectedCallback();
152
156
  if (!this.hasAttribute('tabindex')) {
153
157
  this.tabIndex = 0;
154
158
  }
@@ -41,14 +41,18 @@ export default class ListSelect extends List
41
41
 
42
42
  constructor() {
43
43
  super();
44
- if (!this.hasAttribute('tabindex')) {
45
- this.tabIndex = 0;
46
- }
47
44
  this.refs.slot.addEventListener('slotchange', this.onSlotChange);
48
45
  this.addEventListener('keydown', this.onControlKeydown);
49
46
  this.addEventListener('click', this.onListSelectClick);
50
47
  }
51
48
 
49
+ connectedCallback() {
50
+ super.connectedCallback();
51
+ if (!this.hasAttribute('tabindex')) {
52
+ this.tabIndex = 0;
53
+ }
54
+ }
55
+
52
56
  * _selectedOptionsGenerator() {
53
57
  for (const el of this.options) {
54
58
  if (!el.selected) continue;
@@ -32,8 +32,6 @@ export default CustomElement
32
32
  </div>
33
33
  <slot id=slot></slot>
34
34
  `);
35
-
36
- control.setAttribute('type', 'radio');
37
35
  },
38
36
  })
39
37
  .css`
@@ -29,7 +29,6 @@ export default Button
29
29
  outline.setAttribute('inner-segmented-button', '{innerSegmentedButton}');
30
30
  outline.setAttribute('shape-start', '{shapeStart}');
31
31
  outline.setAttribute('shape-end', '{shapeEnd}');
32
- control.setAttribute('type', 'radio');
33
32
  control.setAttribute('role', 'option');
34
33
  control.setAttribute('aria-checked', inline(
35
34
  ({ type, checked }) => (type === 'checkbox' ? `${(!!checked)}` : null),
@@ -194,7 +194,6 @@ export default CustomElement
194
194
  </div>
195
195
  `);
196
196
  label.removeAttribute('aria-labelledby');
197
- control.setAttribute('type', 'range');
198
197
  },
199
198
  valueChanged(oldValue, newValue) {
200
199
  this._previewValue = newValue;
@@ -43,7 +43,6 @@ export default CustomElement
43
43
  </mdw-switch-icon>
44
44
  <slot id=slot></slot>
45
45
  `);
46
- control.setAttribute('type', 'checkbox');
47
46
  control.setAttribute('role', 'switch');
48
47
  },
49
48
  })
@@ -133,7 +133,6 @@ export default CustomElement
133
133
 
134
134
  /** @param {ResizeObserverEntry} entry */
135
135
  onResizeObserved(entry) {
136
- super.onResizeObserved(entry);
137
136
  if (this.matches(':active')) return;
138
137
  this.resize();
139
138
  },
@@ -173,10 +172,8 @@ export default CustomElement
173
172
  // Custom
174
173
  control.setAttribute('input-prefix', '{inputPrefix}');
175
174
  control.setAttribute('input-suffix', '{inputSuffix}');
176
- control.setAttribute('minrows', '{minRows}');
177
175
  control.setAttribute('fixed', '{fixed}');
178
176
  control.setAttribute('icon', '{icon}');
179
- control.setAttribute('maxrows', '{maxRows}');
180
177
  },
181
178
  defaultValueAttrChanged(oldValue, newValue) {
182
179
  this.defaultValue = newValue;
@@ -210,6 +207,8 @@ export default CustomElement
210
207
  minlength: cloneAttributeCallback('minlength', 'control'),
211
208
  maxlength: cloneAttributeCallback('maxlength', 'control'),
212
209
  placeholder: cloneAttributeCallback('placeholder', 'control'),
210
+ minrows: cloneAttributeCallback('minrows', 'control'),
211
+ maxrows: cloneAttributeCallback('maxrows', 'control'),
213
212
  },
214
213
  })
215
214
  .css`
@@ -231,7 +230,11 @@ export default CustomElement
231
230
  #label {
232
231
  --max-rows: none;
233
232
  --line-height: var(--mdw-typescale__body-large__line-height);
234
- --expected-height: calc((var(--control__margin-top) + var(--control__padding-top) + var(--line-height) + var(--control__padding-bottom) + var(--control__margin-bottom)));
233
+ --expected-height: calc(var(--line-height)
234
+ + var(--control__margin-top)
235
+ + var(--control__padding-top)
236
+ + var(--control__padding-bottom)
237
+ + var(--control__margin-bottom));
235
238
  max-block-size: 100%;
236
239
  grid-row: 1 / 1;
237
240
  padding: 0;