@mdui/shared 1.0.4 → 1.0.5

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.
@@ -1,2 +1,10 @@
1
1
  import { css } from 'lit';
2
- export const style = css `:host{display:inline-block;width:1em;height:1em;line-height:1;font-size:1.5rem}`;
2
+ export const style = css `
3
+ :host {
4
+ display: inline-block;
5
+ width: 1em;
6
+ height: 1em;
7
+ line-height: 1;
8
+ font-size: 1.5rem;
9
+ }
10
+ `;
@@ -1,3 +1,11 @@
1
1
  import { html } from 'lit';
2
2
  import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
3
- export const svgTag = (svgPaths) => html `<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fill="currentColor">${unsafeSVG(svgPaths)}</svg>`;
3
+ export const svgTag = (svgPaths) => html `<svg
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ width="100%"
6
+ height="100%"
7
+ viewBox="0 0 24 24"
8
+ fill="currentColor"
9
+ >
10
+ ${unsafeSVG(svgPaths)}
11
+ </svg>`;
@@ -1,2 +1,20 @@
1
1
  import { css } from 'lit';
2
- export const componentStyle = css `:host{box-sizing:border-box}:host *,:host ::after,:host ::before{box-sizing:inherit}:host :focus,:host :focus-visible,:host(:focus),:host(:focus-visible){outline:0}[hidden]{display:none!important}`;
2
+ export const componentStyle = css `
3
+ :host {
4
+ box-sizing: border-box;
5
+ }
6
+ :host *,
7
+ :host *::before,
8
+ :host *::after {
9
+ box-sizing: inherit;
10
+ }
11
+ :host(:focus),
12
+ :host(:focus-visible),
13
+ :host *:focus,
14
+ :host *:focus-visible {
15
+ outline: none;
16
+ }
17
+ [hidden] {
18
+ display: none !important;
19
+ }
20
+ `;
package/mixins/anchor.js CHANGED
@@ -5,7 +5,19 @@ import { ifDefined } from 'lit/directives/if-defined.js';
5
5
  export const AnchorMixin = (superclass) => {
6
6
  class AnchorMixinClass extends superclass {
7
7
  renderAnchor({ id, className, part, content = html `<slot></slot>`, refDirective, tabIndex, }) {
8
- return html `<a ${refDirective} id="${ifDefined(id)}" class="_a ${className ? className : ''}" part="${ifDefined(part)}" href="${ifDefined(this.href)}" download="${ifDefined(this.download)}" target="${ifDefined(this.target)}" rel="${ifDefined(this.rel)}" tabindex="${ifDefined(tabIndex)}">${content}</a>`;
8
+ return html `<a
9
+ ${refDirective}
10
+ id=${ifDefined(id)}
11
+ class="_a ${className ? className : ''}"
12
+ part=${ifDefined(part)}
13
+ href=${ifDefined(this.href)}
14
+ download=${ifDefined(this.download)}
15
+ target=${ifDefined(this.target)}
16
+ rel=${ifDefined(this.rel)}
17
+ tabindex=${ifDefined(tabIndex)}
18
+ >
19
+ ${content}
20
+ </a>`;
9
21
  }
10
22
  }
11
23
  __decorate([
@@ -48,7 +48,6 @@ export const ScrollBehaviorMixin = (superclass) => {
48
48
  if ((oldValue && !newValue) || (!oldValue && newValue)) {
49
49
  this.updateContainerPadding();
50
50
  }
51
- // @ts-ignore
52
51
  if (!this.scrollBehavior) {
53
52
  return;
54
53
  }
@@ -72,7 +71,6 @@ export const ScrollBehaviorMixin = (superclass) => {
72
71
  if (!listening) {
73
72
  return;
74
73
  }
75
- // @ts-ignore
76
74
  if (this.scrollBehavior) {
77
75
  this.updateScrollTop(listening);
78
76
  listening.addEventListener('scroll', this.onListeningScroll);
@@ -100,7 +98,6 @@ export const ScrollBehaviorMixin = (superclass) => {
100
98
  * @param behavior 为数组时,只要其中一个行为在 scrollBehavior 中,即返回 `true`
101
99
  */
102
100
  hasScrollBehavior(behavior) {
103
- // @ts-ignore
104
101
  const behaviors = (this.scrollBehavior?.split(' ') ??
105
102
  []);
106
103
  if (Array.isArray(behavior)) {
@@ -196,6 +193,9 @@ export const ScrollBehaviorMixin = (superclass) => {
196
193
  __decorate([
197
194
  property({ attribute: 'scroll-target' })
198
195
  ], ScrollBehaviorMixinClass.prototype, "scrollTarget", void 0);
196
+ __decorate([
197
+ property({ reflect: true, attribute: 'scroll-behavior' })
198
+ ], ScrollBehaviorMixinClass.prototype, "scrollBehavior", void 0);
199
199
  __decorate([
200
200
  property({ type: Number, reflect: true, attribute: 'scroll-threshold' })
201
201
  ], ScrollBehaviorMixinClass.prototype, "scrollThreshold", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdui/shared",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "mdui 项目的公共部分",
5
5
  "type": "module",
6
6
  "files": [