mdui 2.0.4 → 2.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.
Files changed (98) hide show
  1. package/components/avatar/index.js +7 -2
  2. package/components/avatar/style.js +31 -1
  3. package/components/badge/style.js +25 -1
  4. package/components/bottom-app-bar/style.js +92 -1
  5. package/components/button/button-base-style.js +28 -1
  6. package/components/button/button-base.js +8 -1
  7. package/components/button/index.js +18 -8
  8. package/components/button/style.js +111 -2
  9. package/components/button-icon/index.js +22 -5
  10. package/components/button-icon/style.js +103 -2
  11. package/components/card/index.js +5 -1
  12. package/components/card/style.js +72 -1
  13. package/components/checkbox/index.js +50 -7
  14. package/components/checkbox/style.js +131 -1
  15. package/components/chip/index.js +33 -9
  16. package/components/chip/style.js +205 -2
  17. package/components/circular-progress/index.js +39 -5
  18. package/components/circular-progress/style.js +136 -1
  19. package/components/collapse/collapse-item-style.js +21 -1
  20. package/components/collapse/collapse-item.js +10 -2
  21. package/components/collapse/collapse-style.js +5 -1
  22. package/components/collapse/collapse.js +4 -1
  23. package/components/dialog/index.js +35 -7
  24. package/components/dialog/style.js +116 -1
  25. package/components/divider/style.js +18 -1
  26. package/components/dropdown/index.js +8 -1
  27. package/components/dropdown/style.js +11 -1
  28. package/components/fab/index.js +13 -5
  29. package/components/fab/style.js +153 -4
  30. package/components/icon/index.js +5 -1
  31. package/components/icon/style.js +29 -1
  32. package/components/layout/layout-item-style.js +6 -1
  33. package/components/layout/layout-main-style.js +7 -1
  34. package/components/layout/layout-style.js +11 -1
  35. package/components/linear-progress/index.js +6 -2
  36. package/components/linear-progress/style.js +73 -1
  37. package/components/list/list-item-style.js +153 -2
  38. package/components/list/list-item.js +27 -8
  39. package/components/list/list-style.js +10 -1
  40. package/components/list/list-subheader-style.js +19 -1
  41. package/components/menu/menu-item-style.js +125 -1
  42. package/components/menu/menu-item.js +55 -13
  43. package/components/menu/menu-style.js +19 -1
  44. package/components/menu/menu.js +5 -1
  45. package/components/navigation-bar/navigation-bar-item-style.js +132 -1
  46. package/components/navigation-bar/navigation-bar-item.js +23 -7
  47. package/components/navigation-bar/navigation-bar-style.js +28 -1
  48. package/components/navigation-bar/navigation-bar.js +4 -1
  49. package/components/navigation-drawer/index.js +12 -1
  50. package/components/navigation-drawer/style.js +66 -1
  51. package/components/navigation-rail/navigation-rail-item-style.js +122 -1
  52. package/components/navigation-rail/navigation-rail-item.js +26 -7
  53. package/components/navigation-rail/navigation-rail-style.js +79 -1
  54. package/components/navigation-rail/navigation-rail.js +10 -1
  55. package/components/radio/radio-group-style.js +20 -1
  56. package/components/radio/radio-group.js +19 -1
  57. package/components/radio/radio-style.js +107 -1
  58. package/components/radio/radio.js +23 -5
  59. package/components/range-slider/index.d.ts +1 -1
  60. package/components/range-slider/index.js +53 -5
  61. package/components/ripple/index.js +5 -2
  62. package/components/ripple/style.js +96 -1
  63. package/components/segmented-button/segmented-button-group-style.js +28 -1
  64. package/components/segmented-button/segmented-button-group.js +21 -1
  65. package/components/segmented-button/segmented-button-style.js +81 -2
  66. package/components/segmented-button/segmented-button.js +27 -11
  67. package/components/select/index.js +87 -6
  68. package/components/select/style.js +27 -1
  69. package/components/slider/index.js +33 -2
  70. package/components/slider/slider-base-style.js +173 -1
  71. package/components/slider/slider-base.js +6 -1
  72. package/components/slider/style.js +7 -1
  73. package/components/snackbar/index.js +32 -5
  74. package/components/snackbar/style.js +100 -1
  75. package/components/switch/index.js +40 -6
  76. package/components/switch/style.js +202 -1
  77. package/components/tabs/tab-panel-style.js +10 -1
  78. package/components/tabs/tab-style.js +85 -1
  79. package/components/tabs/tab.js +24 -4
  80. package/components/tabs/tabs-style.js +138 -1
  81. package/components/tabs/tabs.js +9 -1
  82. package/components/text-field/index.js +160 -32
  83. package/components/text-field/style.js +362 -1
  84. package/components/tooltip/index.js +10 -1
  85. package/components/tooltip/style.js +57 -1
  86. package/components/top-app-bar/top-app-bar-style.js +78 -1
  87. package/components/top-app-bar/top-app-bar-title-style.js +81 -1
  88. package/components/top-app-bar/top-app-bar-title.js +17 -3
  89. package/custom-elements.json +1144 -1101
  90. package/html-data.en.json +15 -6
  91. package/html-data.zh-cn.json +15 -6
  92. package/jsx.en.d.ts +2 -2
  93. package/jsx.zh-cn.d.ts +2 -2
  94. package/package.json +2 -2
  95. package/web-types.en.json +20 -4
  96. package/web-types.zh-cn.json +20 -4
  97. package/mdui.esm.js +0 -22
  98. package/mdui.global.js +0 -22
@@ -1,2 +1,58 @@
1
1
  import { css } from 'lit';
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}`;
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
+ `;
@@ -1,2 +1,79 @@
1
1
  import { css } from 'lit';
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}`;
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
+ `;
@@ -1,2 +1,82 @@
1
1
  import { css } from 'lit';
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}`;
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
+ `;
@@ -50,9 +50,23 @@ 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 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>`}`;
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>`}`;
56
70
  }
57
71
  /**
58
72
  * default slot 变化时,同步到 label-large 中