mdui 2.0.5 → 2.0.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.
Files changed (94) hide show
  1. package/components/avatar/index.js +2 -7
  2. package/components/avatar/style.js +1 -31
  3. package/components/badge/style.js +1 -25
  4. package/components/bottom-app-bar/style.js +1 -92
  5. package/components/button/button-base-style.js +1 -28
  6. package/components/button/button-base.js +1 -8
  7. package/components/button/index.js +8 -18
  8. package/components/button/style.js +2 -111
  9. package/components/button-icon/index.js +5 -22
  10. package/components/button-icon/style.js +2 -103
  11. package/components/card/index.js +1 -5
  12. package/components/card/style.js +1 -72
  13. package/components/checkbox/index.js +7 -50
  14. package/components/checkbox/style.js +1 -131
  15. package/components/chip/index.js +9 -33
  16. package/components/chip/style.js +2 -205
  17. package/components/circular-progress/index.js +5 -39
  18. package/components/circular-progress/style.js +1 -136
  19. package/components/collapse/collapse-item-style.js +1 -21
  20. package/components/collapse/collapse-item.js +2 -10
  21. package/components/collapse/collapse-style.js +1 -5
  22. package/components/collapse/collapse.js +1 -4
  23. package/components/dialog/index.js +7 -35
  24. package/components/dialog/style.js +1 -116
  25. package/components/divider/style.js +1 -18
  26. package/components/dropdown/index.js +1 -8
  27. package/components/dropdown/style.js +1 -11
  28. package/components/fab/index.js +5 -13
  29. package/components/fab/style.js +4 -153
  30. package/components/icon/index.js +1 -5
  31. package/components/icon/style.js +1 -29
  32. package/components/layout/layout-item-style.js +1 -6
  33. package/components/layout/layout-main-style.js +1 -7
  34. package/components/layout/layout-style.js +1 -11
  35. package/components/linear-progress/index.js +2 -6
  36. package/components/linear-progress/style.js +1 -73
  37. package/components/list/list-item-style.js +2 -153
  38. package/components/list/list-item.js +8 -27
  39. package/components/list/list-style.js +1 -10
  40. package/components/list/list-subheader-style.js +1 -19
  41. package/components/menu/menu-item-style.js +1 -125
  42. package/components/menu/menu-item.js +13 -55
  43. package/components/menu/menu-style.js +1 -19
  44. package/components/menu/menu.js +1 -5
  45. package/components/navigation-bar/navigation-bar-item-style.js +1 -132
  46. package/components/navigation-bar/navigation-bar-item.js +7 -23
  47. package/components/navigation-bar/navigation-bar-style.js +1 -28
  48. package/components/navigation-bar/navigation-bar.js +1 -4
  49. package/components/navigation-drawer/index.js +1 -12
  50. package/components/navigation-drawer/style.js +1 -66
  51. package/components/navigation-rail/navigation-rail-item-style.js +1 -122
  52. package/components/navigation-rail/navigation-rail-item.js +7 -26
  53. package/components/navigation-rail/navigation-rail-style.js +1 -79
  54. package/components/navigation-rail/navigation-rail.js +1 -10
  55. package/components/radio/radio-group-style.js +1 -20
  56. package/components/radio/radio-group.js +1 -19
  57. package/components/radio/radio-style.js +1 -107
  58. package/components/radio/radio.js +5 -23
  59. package/components/range-slider/index.d.ts +1 -1
  60. package/components/range-slider/index.js +5 -53
  61. package/components/ripple/index.js +2 -5
  62. package/components/ripple/style.js +1 -96
  63. package/components/segmented-button/segmented-button-group-style.js +1 -28
  64. package/components/segmented-button/segmented-button-group.js +1 -21
  65. package/components/segmented-button/segmented-button-style.js +2 -81
  66. package/components/segmented-button/segmented-button.js +11 -27
  67. package/components/select/index.js +6 -87
  68. package/components/select/style.js +1 -27
  69. package/components/slider/index.js +2 -33
  70. package/components/slider/slider-base-style.js +1 -173
  71. package/components/slider/slider-base.js +1 -6
  72. package/components/slider/style.js +1 -7
  73. package/components/snackbar/index.js +5 -32
  74. package/components/snackbar/style.js +1 -100
  75. package/components/switch/index.js +6 -40
  76. package/components/switch/style.js +1 -202
  77. package/components/tabs/tab-panel-style.js +1 -10
  78. package/components/tabs/tab-style.js +1 -85
  79. package/components/tabs/tab.js +4 -24
  80. package/components/tabs/tabs-style.js +1 -138
  81. package/components/tabs/tabs.js +1 -9
  82. package/components/text-field/index.js +32 -160
  83. package/components/text-field/style.js +1 -362
  84. package/components/tooltip/index.js +1 -10
  85. package/components/tooltip/style.js +1 -57
  86. package/components/top-app-bar/top-app-bar-style.js +1 -78
  87. package/components/top-app-bar/top-app-bar-title-style.js +1 -81
  88. package/components/top-app-bar/top-app-bar-title.js +3 -17
  89. package/custom-elements.json +1105 -1105
  90. package/mdui.esm.js +22 -0
  91. package/mdui.global.js +22 -0
  92. package/package.json +1 -1
  93. package/web-types.en.json +1 -1
  94. package/web-types.zh-cn.json +1 -1
@@ -1,58 +1,2 @@
1
1
  import { css } from 'lit';
2
- export const style = css `
3
- :host {
4
- --shape-corner-plain: var(--mdui-shape-corner-extra-small);
5
- --shape-corner-rich: var(--mdui-shape-corner-medium);
6
- --z-index: 2500;
7
- display: contents;
8
- }
9
- .popup {
10
- position: fixed;
11
- display: flex;
12
- flex-direction: column;
13
- z-index: var(--z-index);
14
- border-radius: var(--shape-corner-plain);
15
- background-color: rgb(var(--mdui-color-inverse-surface));
16
- padding: 0rem 0.5rem;
17
- min-width: 1.75rem;
18
- max-width: 20rem;
19
- }
20
- :host([variant='rich']) .popup {
21
- border-radius: var(--shape-corner-rich);
22
- background-color: rgb(var(--mdui-color-surface-container));
23
- box-shadow: var(--mdui-elevation-level2);
24
- padding: 0.75rem 1rem 0.5rem 1rem;
25
- }
26
- .headline {
27
- display: flex;
28
- color: rgb(var(--mdui-color-on-surface-variant));
29
- font-size: var(--mdui-typescale-title-small-size);
30
- font-weight: var(--mdui-typescale-title-small-weight);
31
- letter-spacing: var(--mdui-typescale-title-small-tracking);
32
- line-height: var(--mdui-typescale-title-small-line-height);
33
- }
34
- .content {
35
- display: flex;
36
- padding: 0.25rem 0rem;
37
- color: rgb(var(--mdui-color-inverse-on-surface));
38
- font-size: var(--mdui-typescale-body-small-size);
39
- font-weight: var(--mdui-typescale-body-small-weight);
40
- letter-spacing: var(--mdui-typescale-body-small-tracking);
41
- line-height: var(--mdui-typescale-body-small-line-height);
42
- }
43
- :host([variant='rich']) .content {
44
- color: rgb(var(--mdui-color-on-surface-variant));
45
- font-size: var(--mdui-typescale-body-medium-size);
46
- font-weight: var(--mdui-typescale-body-medium-weight);
47
- letter-spacing: var(--mdui-typescale-body-medium-tracking);
48
- line-height: var(--mdui-typescale-body-medium-line-height);
49
- }
50
- .action {
51
- display: flex;
52
- justify-content: flex-start;
53
- padding-top: 0.5rem;
54
- }
55
- .action ::slotted(:not(:last-child)) {
56
- margin-right: 0.5rem;
57
- }
58
- `;
2
+ export const style = css `:host{--shape-corner-plain:var(--mdui-shape-corner-extra-small);--shape-corner-rich:var(--mdui-shape-corner-medium);--z-index:2500;display:contents}.popup{position:fixed;display:flex;flex-direction:column;z-index:var(--z-index);border-radius:var(--shape-corner-plain);background-color:rgb(var(--mdui-color-inverse-surface));padding:0 .5rem;min-width:1.75rem;max-width:20rem}:host([variant=rich]) .popup{border-radius:var(--shape-corner-rich);background-color:rgb(var(--mdui-color-surface-container));box-shadow:var(--mdui-elevation-level2);padding:.75rem 1rem .5rem 1rem}.headline{display:flex;color:rgb(var(--mdui-color-on-surface-variant));font-size:var(--mdui-typescale-title-small-size);font-weight:var(--mdui-typescale-title-small-weight);letter-spacing:var(--mdui-typescale-title-small-tracking);line-height:var(--mdui-typescale-title-small-line-height)}.content{display:flex;padding:.25rem 0;color:rgb(var(--mdui-color-inverse-on-surface));font-size:var(--mdui-typescale-body-small-size);font-weight:var(--mdui-typescale-body-small-weight);letter-spacing:var(--mdui-typescale-body-small-tracking);line-height:var(--mdui-typescale-body-small-line-height)}:host([variant=rich]) .content{color:rgb(var(--mdui-color-on-surface-variant));font-size:var(--mdui-typescale-body-medium-size);font-weight:var(--mdui-typescale-body-medium-weight);letter-spacing:var(--mdui-typescale-body-medium-tracking);line-height:var(--mdui-typescale-body-medium-line-height)}.action{display:flex;justify-content:flex-start;padding-top:.5rem}.action ::slotted(:not(:last-child)){margin-right:.5rem}`;
@@ -1,79 +1,2 @@
1
1
  import { css } from 'lit';
2
- export const topAppBarStyle = css `
3
- :host {
4
- --shape-corner: var(--mdui-shape-corner-none);
5
- --z-index: 2000;
6
- position: fixed;
7
- top: 0;
8
- right: 0;
9
- left: 0;
10
- display: flex;
11
- flex: 0 0 auto;
12
- align-items: flex-start;
13
- justify-content: flex-start;
14
- border-bottom-left-radius: var(--shape-corner);
15
- border-bottom-right-radius: var(--shape-corner);
16
- z-index: var(--z-index);
17
- transition:
18
- top var(--mdui-motion-duration-long2) var(--mdui-motion-easing-standard),
19
- height var(--mdui-motion-duration-long2)
20
- var(--mdui-motion-easing-standard),
21
- box-shadow var(--mdui-motion-duration-short4)
22
- var(--mdui-motion-easing-linear),
23
- background-color var(--mdui-motion-duration-short4)
24
- var(--mdui-motion-easing-linear);
25
- padding: 0.75rem 0.5rem;
26
- height: 4rem;
27
- background-color: rgb(var(--mdui-color-surface));
28
- }
29
- :host([scroll-target]:not([scroll-target=''])) {
30
- position: absolute;
31
- }
32
- :host([scroll-behavior~='shrink']) {
33
- transition-duration: var(--mdui-motion-duration-short4);
34
- }
35
- :host([scrolling]) {
36
- background-color: rgb(var(--mdui-color-surface-container));
37
- box-shadow: var(--mdui-elevation-level2);
38
- }
39
- ::slotted(mdui-button-icon) {
40
- color: rgb(var(--mdui-color-on-surface-variant));
41
- font-size: 1.5rem;
42
- }
43
- ::slotted(mdui-button-icon:first-child) {
44
- color: rgb(var(--mdui-color-on-surface));
45
- }
46
- ::slotted(mdui-avatar) {
47
- width: 1.875rem;
48
- height: 1.875rem;
49
- margin-top: 0.3125rem;
50
- margin-bottom: 0.3125rem;
51
- }
52
- ::slotted(*) {
53
- flex-shrink: 0;
54
- }
55
- ::slotted(:not(:last-child)) {
56
- margin-right: 0.5rem;
57
- }
58
- :host([variant='medium']) {
59
- height: 7rem;
60
- }
61
- :host([variant='large']) {
62
- height: 9.5rem;
63
- }
64
- :host([hide]) {
65
- transition-duration: var(--mdui-motion-duration-short4);
66
- top: -4.625rem;
67
- }
68
- :host([hide][variant='medium']) {
69
- top: -7.625rem;
70
- }
71
- :host([hide][variant='large']) {
72
- top: -10.125rem;
73
- }
74
- :host([shrink][variant='medium']),
75
- :host([shrink][variant='large']) {
76
- transition-duration: var(--mdui-motion-duration-short4);
77
- height: 4rem;
78
- }
79
- `;
2
+ export const topAppBarStyle = css `:host{--shape-corner:var(--mdui-shape-corner-none);--z-index:2000;position:fixed;top:0;right:0;left:0;display:flex;flex:0 0 auto;align-items:flex-start;justify-content:flex-start;border-bottom-left-radius:var(--shape-corner);border-bottom-right-radius:var(--shape-corner);z-index:var(--z-index);transition:top var(--mdui-motion-duration-long2) var(--mdui-motion-easing-standard),height var(--mdui-motion-duration-long2) var(--mdui-motion-easing-standard),box-shadow var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear),background-color var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);padding:.75rem .5rem;height:4rem;background-color:rgb(var(--mdui-color-surface))}:host([scroll-target]:not([scroll-target=''])){position:absolute}:host([scroll-behavior~=shrink]){transition-duration:var(--mdui-motion-duration-short4)}:host([scrolling]){background-color:rgb(var(--mdui-color-surface-container));box-shadow:var(--mdui-elevation-level2)}::slotted(mdui-button-icon){color:rgb(var(--mdui-color-on-surface-variant));font-size:1.5rem}::slotted(mdui-button-icon:first-child){color:rgb(var(--mdui-color-on-surface))}::slotted(mdui-avatar){width:1.875rem;height:1.875rem;margin-top:.3125rem;margin-bottom:.3125rem}::slotted(*){flex-shrink:0}::slotted(:not(:last-child)){margin-right:.5rem}:host([variant=medium]){height:7rem}:host([variant=large]){height:9.5rem}:host([hide]){transition-duration:var(--mdui-motion-duration-short4);top:-4.625rem}:host([hide][variant=medium]){top:-7.625rem}:host([hide][variant=large]){top:-10.125rem}:host([shrink][variant=large]),:host([shrink][variant=medium]){transition-duration:var(--mdui-motion-duration-short4);height:4rem}`;
@@ -1,82 +1,2 @@
1
1
  import { css } from 'lit';
2
- export const topAppBarTitleStyle = css `
3
- :host {
4
- display: block;
5
- width: 100%;
6
- flex-shrink: initial !important;
7
- overflow: hidden;
8
- color: rgb(var(--mdui-color-on-surface));
9
- font-size: var(--mdui-typescale-title-large-size);
10
- font-weight: var(--mdui-typescale-title-large-weight);
11
- letter-spacing: var(--mdui-typescale-title-large-tracking);
12
- line-height: var(--mdui-typescale-title-large-line-height);
13
- line-height: 2.5rem;
14
- }
15
- .label {
16
- display: block;
17
- overflow: hidden;
18
- text-overflow: ellipsis;
19
- white-space: nowrap;
20
- opacity: 1;
21
- transition: opacity var(--mdui-motion-duration-short2)
22
- var(--mdui-motion-easing-linear);
23
- }
24
- .label.variant-center-aligned {
25
- text-align: center;
26
- }
27
- .label.variant-medium:not(.shrink),
28
- .label.variant-large:not(.shrink) {
29
- opacity: 0;
30
- }
31
- .label.variant-medium.shrink,
32
- .label.variant-large.shrink {
33
- transition-delay: var(--mdui-motion-duration-short2);
34
- }
35
- .label-large {
36
- display: none;
37
- position: absolute;
38
- width: 100%;
39
- left: 0;
40
- margin-right: 0;
41
- padding: 0rem 1rem;
42
- transition: opacity var(--mdui-motion-duration-short2)
43
- var(--mdui-motion-easing-linear);
44
- }
45
- .label-large.variant-medium,
46
- .label-large.variant-large {
47
- display: block;
48
- }
49
- .label-large.variant-medium {
50
- overflow: hidden;
51
- text-overflow: ellipsis;
52
- white-space: nowrap;
53
- bottom: 0.75rem;
54
- font-size: var(--mdui-typescale-headline-small-size);
55
- font-weight: var(--mdui-typescale-headline-small-weight);
56
- letter-spacing: var(--mdui-typescale-headline-small-tracking);
57
- line-height: var(--mdui-typescale-headline-small-line-height);
58
- }
59
- .label-large.variant-large {
60
- display: -webkit-box;
61
- /* stylelint-disable-line value-no-vendor-prefix */
62
- overflow: hidden;
63
- white-space: normal;
64
- -webkit-box-orient: vertical;
65
- -webkit-line-clamp: 2;
66
- bottom: 1.25rem;
67
- font-size: var(--mdui-typescale-headline-medium-size);
68
- font-weight: var(--mdui-typescale-headline-medium-weight);
69
- letter-spacing: var(--mdui-typescale-headline-medium-tracking);
70
- line-height: var(--mdui-typescale-headline-medium-line-height);
71
- }
72
- .label-large.variant-medium:not(.shrink),
73
- .label-large.variant-large:not(.shrink) {
74
- opacity: 1;
75
- transition-delay: var(--mdui-motion-duration-short2);
76
- }
77
- .label-large.variant-medium.shrink,
78
- .label-large.variant-large.shrink {
79
- opacity: 0;
80
- z-index: -1;
81
- }
82
- `;
2
+ export const topAppBarTitleStyle = css `:host{display:block;width:100%;flex-shrink:initial!important;overflow:hidden;color:rgb(var(--mdui-color-on-surface));font-size:var(--mdui-typescale-title-large-size);font-weight:var(--mdui-typescale-title-large-weight);letter-spacing:var(--mdui-typescale-title-large-tracking);line-height:var(--mdui-typescale-title-large-line-height);line-height:2.5rem}.label{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;opacity:1;transition:opacity var(--mdui-motion-duration-short2) var(--mdui-motion-easing-linear)}.label.variant-center-aligned{text-align:center}.label.variant-large:not(.shrink),.label.variant-medium:not(.shrink){opacity:0}.label.variant-large.shrink,.label.variant-medium.shrink{transition-delay:var(--mdui-motion-duration-short2)}.label-large{display:none;position:absolute;width:100%;left:0;margin-right:0;padding:0 1rem;transition:opacity var(--mdui-motion-duration-short2) var(--mdui-motion-easing-linear)}.label-large.variant-large,.label-large.variant-medium{display:block}.label-large.variant-medium{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;bottom:.75rem;font-size:var(--mdui-typescale-headline-small-size);font-weight:var(--mdui-typescale-headline-small-weight);letter-spacing:var(--mdui-typescale-headline-small-tracking);line-height:var(--mdui-typescale-headline-small-line-height)}.label-large.variant-large{display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2;bottom:1.25rem;font-size:var(--mdui-typescale-headline-medium-size);font-weight:var(--mdui-typescale-headline-medium-weight);letter-spacing:var(--mdui-typescale-headline-medium-tracking);line-height:var(--mdui-typescale-headline-medium-line-height)}.label-large.variant-large:not(.shrink),.label-large.variant-medium:not(.shrink){opacity:1;transition-delay:var(--mdui-motion-duration-short2)}.label-large.variant-large.shrink,.label-large.variant-medium.shrink{opacity:0;z-index:-1}`;
@@ -50,23 +50,9 @@ let TopAppBarTitle = class TopAppBarTitle extends MduiElement {
50
50
  'variant-medium': this.variant === 'medium',
51
51
  'variant-large': this.variant === 'large',
52
52
  });
53
- return html `<slot
54
- part="label"
55
- class="label ${className}"
56
- ${ref(this.defaultSlotRef)}
57
- @slotchange="${() => this.onSlotChange(hasLabelLargeSlot)}"
58
- ></slot>
59
- ${hasLabelLargeSlot
60
- ? html `<slot
61
- name="label-large"
62
- part="label-large"
63
- class="label-large ${className}"
64
- ></slot>`
65
- : html `<div
66
- ${ref(this.labelLargeRef)}
67
- part="label-large"
68
- class="label-large ${className}"
69
- ></div>`}`;
53
+ return html `<slot part="label" class="label ${className}" ${ref(this.defaultSlotRef)} @slotchange="${() => this.onSlotChange(hasLabelLargeSlot)}"></slot>${hasLabelLargeSlot
54
+ ? html `<slot name="label-large" part="label-large" class="label-large ${className}"></slot>`
55
+ : html `<div ${ref(this.labelLargeRef)} part="label-large" class="label-large ${className}"></div>`}`;
70
56
  }
71
57
  /**
72
58
  * default slot 变化时,同步到 label-large 中