@xdam/ember-partials 3.0.1 → 4.0.1
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/.gitattributes +5 -5
- package/.yarnrc.yml +1 -0
- package/LICENSE.md +9 -9
- package/README.md +9 -3
- package/addon/components/xep-avatar.js +9 -4
- package/addon/components/xep-bubble.js +6 -3
- package/addon/components/xep-button.hbs +2 -0
- package/addon/components/xep-button.js +9 -1
- package/addon/components/xep-checkbox.js +12 -8
- package/addon/components/xep-chip-icon.js +1 -3
- package/addon/components/xep-chip-set.js +14 -6
- package/addon/components/xep-chip-text.js +0 -0
- package/addon/components/xep-chip.js +11 -5
- package/addon/components/xep-dialog-actions.hbs +0 -0
- package/addon/components/xep-dialog-actions.js +7 -1
- package/addon/components/xep-dialog-content.hbs +0 -0
- package/addon/components/xep-dialog-content.js +7 -1
- package/addon/components/xep-dialog-title.hbs +0 -0
- package/addon/components/xep-dialog-title.js +7 -1
- package/addon/components/xep-dialog.js +4 -3
- package/addon/components/xep-drawer-content.js +0 -0
- package/addon/components/xep-drawer-header.js +0 -0
- package/addon/components/xep-drawer.js +14 -6
- package/addon/components/xep-input.js +14 -6
- package/addon/components/xep-list-divider.js +5 -1
- package/addon/components/xep-list-item-graphic.hbs +0 -0
- package/addon/components/xep-list-item-graphic.js +7 -1
- package/addon/components/xep-list-item-meta.js +4 -1
- package/addon/components/xep-list-item-text.js +5 -1
- package/addon/components/xep-list-item.js +13 -4
- package/addon/components/xep-list.js +8 -4
- package/addon/components/xep-menu-surface.js +4 -1
- package/addon/components/xep-menu.js +12 -5
- package/addon/components/xep-radio.js +11 -6
- package/addon/components/xep-slider.js +11 -6
- package/addon/components/xep-snackbar.js +12 -4
- package/addon/components/xep-switch.js +6 -4
- package/addon/components/xep-textarea.js +12 -5
- package/addon/components/xep-toolbar-divider.js +0 -0
- package/addon/components/xep-toolbar-item-icon.js +4 -1
- package/addon/components/xep-toolbar-item-text.js +4 -1
- package/addon/components/xep-toolbar-item.js +0 -0
- package/addon/components/xep-toolbar-section.js +5 -2
- package/addon/components/xep-toolbar.js +4 -3
- package/addon/mixins/xep-resize.js +1 -1
- package/addon/services/xep-manager.js +1 -1
- package/addon/templates/components/xep-avatar.hbs +0 -1
- package/addon/templates/components/xep-bubble.hbs +0 -0
- package/addon/templates/components/xep-checkbox.hbs +1 -1
- package/addon/templates/components/xep-chip-icon.hbs +0 -0
- package/addon/templates/components/xep-chip-set.hbs +0 -0
- package/addon/templates/components/xep-chip-text.hbs +0 -0
- package/addon/templates/components/xep-chip.hbs +0 -0
- package/addon/templates/components/xep-dialog.hbs +0 -0
- package/addon/templates/components/xep-drawer-content.hbs +0 -0
- package/addon/templates/components/xep-drawer-header.hbs +0 -0
- package/addon/templates/components/xep-drawer.hbs +0 -0
- package/addon/templates/components/xep-input.hbs +3 -6
- package/addon/templates/components/xep-list-divider.hbs +0 -0
- package/addon/templates/components/xep-list-item-meta.hbs +0 -0
- package/addon/templates/components/xep-list-item-text.hbs +0 -0
- package/addon/templates/components/xep-list-item.hbs +0 -0
- package/addon/templates/components/xep-list.hbs +0 -0
- package/addon/templates/components/xep-menu-surface.hbs +0 -0
- package/addon/templates/components/xep-menu.hbs +0 -0
- package/addon/templates/components/xep-power-select.hbs +0 -0
- package/addon/templates/components/xep-radio.hbs +5 -1
- package/addon/templates/components/xep-slider.hbs +0 -0
- package/addon/templates/components/xep-snackbar.hbs +0 -0
- package/addon/templates/components/xep-switch.hbs +10 -1
- package/addon/templates/components/xep-textarea.hbs +1 -2
- package/addon/templates/components/xep-toolbar-divider.hbs +0 -0
- package/addon/templates/components/xep-toolbar-item-icon.hbs +0 -0
- package/addon/templates/components/xep-toolbar-item-text.hbs +0 -0
- package/addon/templates/components/xep-toolbar-item.hbs +0 -0
- package/addon/templates/components/xep-toolbar-section.hbs +0 -0
- package/addon/templates/components/xep-toolbar.hbs +0 -0
- package/addon/utils/style-string.js +9 -3
- package/addon/utils/update-dirty-props.js +9 -4
- package/app/components/xep-avatar.js +0 -0
- package/app/components/xep-bubble.js +0 -0
- package/app/components/xep-button.js +0 -0
- package/app/components/xep-checkbox.js +1 -0
- package/app/components/xep-chip-icon.js +0 -0
- package/app/components/xep-chip-set.js +1 -0
- package/app/components/xep-chip-text.js +0 -0
- package/app/components/xep-chip.js +0 -0
- package/app/components/xep-dialog-actions.js +0 -0
- package/app/components/xep-dialog-content.js +0 -0
- package/app/components/xep-dialog-title.js +0 -0
- package/app/components/xep-dialog.js +1 -0
- package/app/components/xep-drawer-content.js +0 -0
- package/app/components/xep-drawer-header.js +0 -0
- package/app/components/xep-drawer.js +1 -0
- package/app/components/xep-input.js +1 -0
- package/app/components/xep-list-divider.js +0 -0
- package/app/components/xep-list-item-graphic.js +0 -0
- package/app/components/xep-list-item-meta.js +0 -0
- package/app/components/xep-list-item-text.js +0 -0
- package/app/components/xep-list-item.js +0 -0
- package/app/components/xep-list.js +1 -0
- package/app/components/xep-menu-surface.js +1 -0
- package/app/components/xep-menu.js +2 -0
- package/app/components/xep-radio.js +1 -0
- package/app/components/xep-slider.js +1 -0
- package/app/components/xep-snackbar.js +1 -0
- package/app/components/xep-switch.js +1 -0
- package/app/components/xep-textarea.js +0 -0
- package/app/components/xep-toolbar-divider.js +0 -0
- package/app/components/xep-toolbar-item-icon.js +0 -0
- package/app/components/xep-toolbar-item-text.js +0 -0
- package/app/components/xep-toolbar-item.js +0 -0
- package/app/components/xep-toolbar-section.js +0 -0
- package/app/components/xep-toolbar.js +0 -0
- package/app/mixins/xep-resize.js +0 -0
- package/app/services/xep-manager.js +0 -0
- package/app/styles/ember-partials/components/xep-avatar.scss +24 -24
- package/app/styles/ember-partials/components/xep-bubble.scss +20 -20
- package/app/styles/ember-partials/components/xep-button.scss +58 -58
- package/app/styles/ember-partials/components/xep-drawer.scss +21 -21
- package/app/styles/ember-partials/components/xep-snackbar.scss +3 -3
- package/app/styles/ember-partials/components/xep-toolbar.scss +107 -107
- package/app/styles/ember-partials/dark-theme.scss +42 -42
- package/app/styles/ember-partials/helpers/alignment.scss +59 -59
- package/app/styles/ember-partials/helpers/color.scss +27 -27
- package/app/styles/ember-partials/helpers/display.scss +27 -27
- package/app/styles/ember-partials/helpers/overrides.scss +7 -7
- package/app/styles/ember-partials/helpers/root.scss +13 -13
- package/app/styles/ember-partials/helpers/rotate.scss +11 -11
- package/app/styles/ember-partials/helpers/spacing.scss +25 -25
- package/app/styles/ember-partials/helpers/typography.scss +5 -5
- package/app/styles/ember-partials/helpers/visibility.scss +23 -23
- package/app/styles/ember-partials/light-theme.scss +42 -42
- package/app/styles/ember-partials/mixins/breakpoints.scss +24 -24
- package/app/styles/ember-partials/mixins/strip-unit.scss +12 -12
- package/app/styles/ember-partials/variables.scss +35 -35
- package/app/styles/ember-partials/xdam-theme.scss +49 -49
- package/app/styles/ember-partials.scss +50 -48
- package/app/utils/style-string.js +0 -0
- package/backstop.json +168 -168
- package/blueprints/xep-component/files/__root__/__path__/__name__.js +0 -0
- package/blueprints/xep-component/files/__root__/__templatepath__/__templatename__.hbs +0 -0
- package/blueprints/xep-component/index.js +1 -1
- package/blueprints/xep-component-test/index.js +1 -1
- package/blueprints/xep-component-test/qunit-files/__root__/__testType__/__path__/__test__.js +0 -0
- package/config/addon-docs.js +1 -1
- package/config/deploy.js +0 -0
- package/config/environment.js +1 -1
- package/config/release.js +0 -0
- package/index.js +70 -115
- package/package.json +151 -129
|
@@ -5,7 +5,6 @@ import { Corner } from '@material/menu-surface';
|
|
|
5
5
|
import { MDCMenu } from '@material/menu';
|
|
6
6
|
import { inject as service } from '@ember/service';
|
|
7
7
|
import { addEventListener, runDisposables } from 'ember-lifeline';
|
|
8
|
-
import classic from 'ember-classic-decorator';
|
|
9
8
|
|
|
10
9
|
import updateDirtyProps from '@xdam/ember-partials/utils/update-dirty-props';
|
|
11
10
|
|
|
@@ -18,7 +17,7 @@ import updateDirtyProps from '@xdam/ember-partials/utils/update-dirty-props';
|
|
|
18
17
|
* @yield {Hash} menu
|
|
19
18
|
* @yield {XepList} menu.list Menu content requires using XepList component
|
|
20
19
|
*/
|
|
21
|
-
|
|
20
|
+
|
|
22
21
|
@layout(template)
|
|
23
22
|
@classNames('xep-menu', 'mdc-menu', 'mdc-menu-surface')
|
|
24
23
|
export default class XepMenuComponent extends Component {
|
|
@@ -98,7 +97,10 @@ export default class XepMenuComponent extends Component {
|
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
if (this.absolutePosition) {
|
|
101
|
-
this.mdcComponent.setAbsolutePosition(
|
|
100
|
+
this.mdcComponent.setAbsolutePosition(
|
|
101
|
+
this.absolutePosition.x,
|
|
102
|
+
this.absolutePosition.y,
|
|
103
|
+
);
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
106
|
|
|
@@ -117,8 +119,12 @@ export default class XepMenuComponent extends Component {
|
|
|
117
119
|
|
|
118
120
|
this.setupPositioning();
|
|
119
121
|
|
|
120
|
-
addEventListener(this, this.element, 'MDCMenuSurface:closed', () =>
|
|
121
|
-
|
|
122
|
+
addEventListener(this, this.element, 'MDCMenuSurface:closed', () =>
|
|
123
|
+
this.set('open', false),
|
|
124
|
+
);
|
|
125
|
+
addEventListener(this, this.element, 'MDCList:action', () =>
|
|
126
|
+
this.set('open', false),
|
|
127
|
+
);
|
|
122
128
|
|
|
123
129
|
if (this.register) {
|
|
124
130
|
this.xepManager.registerComponent(this, this.register);
|
|
@@ -126,6 +132,7 @@ export default class XepMenuComponent extends Component {
|
|
|
126
132
|
}
|
|
127
133
|
|
|
128
134
|
didReceiveAttrs() {
|
|
135
|
+
super.didReceiveAttrs();
|
|
129
136
|
if (this.mdcComponent) {
|
|
130
137
|
updateDirtyProps(this.trackedProps, this, this.mdcComponent);
|
|
131
138
|
}
|
|
@@ -6,7 +6,6 @@ import { MDCRadio } from '@material/radio';
|
|
|
6
6
|
import { guidFor } from '@ember/object/internals';
|
|
7
7
|
import { inject as service } from '@ember/service';
|
|
8
8
|
import { addEventListener, runDisposables } from 'ember-lifeline';
|
|
9
|
-
import classic from 'ember-classic-decorator';
|
|
10
9
|
|
|
11
10
|
import updateDirtyProps from '@xdam/ember-partials/utils/update-dirty-props';
|
|
12
11
|
|
|
@@ -16,7 +15,6 @@ import updateDirtyProps from '@xdam/ember-partials/utils/update-dirty-props';
|
|
|
16
15
|
* @class XepRadio
|
|
17
16
|
* @public
|
|
18
17
|
*/
|
|
19
|
-
@classic
|
|
20
18
|
@layout(template)
|
|
21
19
|
@classNames('xep-radio', 'mdc-form-field')
|
|
22
20
|
export default class XepRadioComponent extends Component {
|
|
@@ -80,16 +78,22 @@ export default class XepRadioComponent extends Component {
|
|
|
80
78
|
*/
|
|
81
79
|
register;
|
|
82
80
|
|
|
83
|
-
trackedProps = ['disabled', 'checked', 'value']
|
|
81
|
+
trackedProps = ['disabled', 'checked', 'value'];
|
|
84
82
|
|
|
85
83
|
didInsertElement() {
|
|
86
84
|
super.didInsertElement(...arguments);
|
|
87
85
|
|
|
88
|
-
this.mdcComponent =
|
|
86
|
+
this.mdcComponent =
|
|
87
|
+
this.mdcComponent ||
|
|
88
|
+
new MDCRadio(this.element.querySelector('.mdc-radio'));
|
|
89
89
|
updateDirtyProps(this.trackedProps, this, this.mdcComponent);
|
|
90
90
|
|
|
91
|
-
const nativeInput = this.element.querySelector(
|
|
92
|
-
|
|
91
|
+
const nativeInput = this.element.querySelector(
|
|
92
|
+
'.mdc-radio__native-control',
|
|
93
|
+
);
|
|
94
|
+
addEventListener(this, nativeInput, 'change', (evt) =>
|
|
95
|
+
this.set('checked', evt.srcElement.checked),
|
|
96
|
+
);
|
|
93
97
|
|
|
94
98
|
if (this.register) {
|
|
95
99
|
this.xepManager.registerComponent(this, this.register);
|
|
@@ -97,6 +101,7 @@ export default class XepRadioComponent extends Component {
|
|
|
97
101
|
}
|
|
98
102
|
|
|
99
103
|
didReceiveAttrs() {
|
|
104
|
+
super.didReceiveAttrs();
|
|
100
105
|
if (this.mdcComponent) {
|
|
101
106
|
updateDirtyProps(this.trackedProps, this, this.mdcComponent);
|
|
102
107
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { set } from '@ember/object';
|
|
1
2
|
import {
|
|
2
|
-
classNames,
|
|
3
|
+
classNames,
|
|
4
|
+
layout,
|
|
5
|
+
attribute,
|
|
6
|
+
className,
|
|
3
7
|
} from '@ember-decorators/component';
|
|
4
8
|
import Component from '@ember/component';
|
|
5
9
|
import template from '@xdam/ember-partials/templates/components/xep-slider';
|
|
@@ -8,7 +12,6 @@ import { alias } from '@ember/object/computed';
|
|
|
8
12
|
import EmberObject, { computed } from '@ember/object';
|
|
9
13
|
import { inject as service } from '@ember/service';
|
|
10
14
|
import { addEventListener, runDisposables } from 'ember-lifeline';
|
|
11
|
-
import classic from 'ember-classic-decorator';
|
|
12
15
|
|
|
13
16
|
import updateDirtyProps from '@xdam/ember-partials/utils/update-dirty-props';
|
|
14
17
|
|
|
@@ -27,7 +30,7 @@ const VARIANT_TYPES = {
|
|
|
27
30
|
* @class XepSlider
|
|
28
31
|
* @public
|
|
29
32
|
*/
|
|
30
|
-
|
|
33
|
+
|
|
31
34
|
@layout(template)
|
|
32
35
|
@classNames('xep-slider', 'mdc-slider')
|
|
33
36
|
export default class XepSliderComponent extends Component {
|
|
@@ -182,11 +185,12 @@ export default class XepSliderComponent extends Component {
|
|
|
182
185
|
didInsertElement() {
|
|
183
186
|
super.didInsertElement(...arguments);
|
|
184
187
|
|
|
185
|
-
this
|
|
188
|
+
set(this, 'mdcComponent', new MDCSlider(this.element));
|
|
186
189
|
updateDirtyProps(this.trackedProps, this, this.mdcComponent);
|
|
187
190
|
|
|
188
|
-
addEventListener(this, this.element, 'MDCSlider:change',
|
|
189
|
-
|
|
191
|
+
addEventListener(this, this.element, 'MDCSlider:change', () =>
|
|
192
|
+
updateDirtyProps(this.trackedProps, this.mdcComponent, this),
|
|
193
|
+
);
|
|
190
194
|
|
|
191
195
|
if (this.register) {
|
|
192
196
|
this.xepManager.registerComponent(this, this.register);
|
|
@@ -194,6 +198,7 @@ export default class XepSliderComponent extends Component {
|
|
|
194
198
|
}
|
|
195
199
|
|
|
196
200
|
didReceiveAttrs() {
|
|
201
|
+
super.didReceiveAttrs();
|
|
197
202
|
if (this.mdcComponent) {
|
|
198
203
|
updateDirtyProps(this.trackedProps, this, this.mdcComponent);
|
|
199
204
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
classNames,
|
|
2
|
+
classNames,
|
|
3
|
+
layout,
|
|
4
|
+
attribute,
|
|
5
|
+
className,
|
|
3
6
|
} from '@ember-decorators/component';
|
|
4
7
|
import Component from '@ember/component';
|
|
5
8
|
import template from '@xdam/ember-partials/templates/components/xep-snackbar';
|
|
6
9
|
import { MDCSnackbar } from '@material/snackbar';
|
|
7
10
|
import { inject as service } from '@ember/service';
|
|
8
|
-
import classic from 'ember-classic-decorator';
|
|
9
11
|
|
|
10
12
|
import updateDirtyProps from '@xdam/ember-partials/utils/update-dirty-props';
|
|
11
13
|
|
|
@@ -18,7 +20,7 @@ import updateDirtyProps from '@xdam/ember-partials/utils/update-dirty-props';
|
|
|
18
20
|
* @class XepSnackbar
|
|
19
21
|
* @public
|
|
20
22
|
*/
|
|
21
|
-
|
|
23
|
+
|
|
22
24
|
@layout(template)
|
|
23
25
|
@classNames('xep-snackbar', 'mdc-snackbar')
|
|
24
26
|
export default class XepSnackbarComponent extends Component {
|
|
@@ -84,7 +86,12 @@ export default class XepSnackbarComponent extends Component {
|
|
|
84
86
|
*/
|
|
85
87
|
register;
|
|
86
88
|
|
|
87
|
-
trackedProps = [
|
|
89
|
+
trackedProps = [
|
|
90
|
+
'closeOnEscape',
|
|
91
|
+
'timeoutMs',
|
|
92
|
+
'labelText',
|
|
93
|
+
'actionButtonText',
|
|
94
|
+
];
|
|
88
95
|
|
|
89
96
|
didInsertElement() {
|
|
90
97
|
super.didInsertElement(...arguments);
|
|
@@ -97,6 +104,7 @@ export default class XepSnackbarComponent extends Component {
|
|
|
97
104
|
}
|
|
98
105
|
|
|
99
106
|
didReceiveAttrs() {
|
|
107
|
+
super.didReceiveAttrs();
|
|
100
108
|
if (this.mdcComponent) {
|
|
101
109
|
updateDirtyProps(this.trackedProps, this, this.mdcComponent);
|
|
102
110
|
}
|
|
@@ -5,7 +5,6 @@ import { MDCSwitch } from '@material/switch';
|
|
|
5
5
|
import { guidFor } from '@ember/object/internals';
|
|
6
6
|
import { inject as service } from '@ember/service';
|
|
7
7
|
import { runDisposables } from 'ember-lifeline';
|
|
8
|
-
import classic from 'ember-classic-decorator';
|
|
9
8
|
|
|
10
9
|
import updateDirtyProps from '@xdam/ember-partials/utils/update-dirty-props';
|
|
11
10
|
|
|
@@ -15,7 +14,7 @@ import updateDirtyProps from '@xdam/ember-partials/utils/update-dirty-props';
|
|
|
15
14
|
* @class XepSwitch
|
|
16
15
|
* @public
|
|
17
16
|
*/
|
|
18
|
-
|
|
17
|
+
|
|
19
18
|
@layout(template)
|
|
20
19
|
@classNames('xep-switch')
|
|
21
20
|
export default class XepSwitchComponent extends Component {
|
|
@@ -65,11 +64,13 @@ export default class XepSwitchComponent extends Component {
|
|
|
65
64
|
*/
|
|
66
65
|
label;
|
|
67
66
|
|
|
68
|
-
trackedProps = ['disabled', 'checked']
|
|
67
|
+
trackedProps = ['disabled', 'checked'];
|
|
69
68
|
|
|
70
69
|
didInsertElement() {
|
|
71
70
|
super.didInsertElement(...arguments);
|
|
72
|
-
this.mdcComponent =
|
|
71
|
+
this.mdcComponent =
|
|
72
|
+
this.mdcComponent ||
|
|
73
|
+
new MDCSwitch(this.element.querySelector('.mdc-switch'));
|
|
73
74
|
updateDirtyProps(this.trackedProps, this, this.mdcComponent);
|
|
74
75
|
|
|
75
76
|
if (this.register) {
|
|
@@ -78,6 +79,7 @@ export default class XepSwitchComponent extends Component {
|
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
didReceiveAttrs() {
|
|
82
|
+
super.didReceiveAttrs();
|
|
81
83
|
if (this.mdcComponent) {
|
|
82
84
|
updateDirtyProps(this.trackedProps, this, this.mdcComponent);
|
|
83
85
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
-
attribute,
|
|
2
|
+
attribute,
|
|
3
|
+
classNames,
|
|
4
|
+
className,
|
|
5
|
+
layout,
|
|
3
6
|
} from '@ember-decorators/component';
|
|
4
7
|
import Component from '@ember/component';
|
|
5
8
|
import { MDCTextField, MDCTextFieldHelperText } from '@material/textfield';
|
|
6
9
|
import template from '@xdam/ember-partials/templates/components/xep-textarea';
|
|
7
10
|
import { guidFor } from '@ember/object/internals';
|
|
8
11
|
import { inject as service } from '@ember/service';
|
|
9
|
-
import classic from 'ember-classic-decorator';
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* Component `<textarea>` element. Implements [material design's
|
|
@@ -16,7 +18,7 @@ import classic from 'ember-classic-decorator';
|
|
|
16
18
|
* @class XepTextarea
|
|
17
19
|
* @public
|
|
18
20
|
*/
|
|
19
|
-
|
|
21
|
+
|
|
20
22
|
@layout(template)
|
|
21
23
|
@classNames('xep-textarea', 'mdc-text-field', 'mdc-text-field--textarea')
|
|
22
24
|
export default class XepTextareaComponent extends Component {
|
|
@@ -273,8 +275,13 @@ export default class XepTextareaComponent extends Component {
|
|
|
273
275
|
this.mdcComponent = new MDCTextField(this.element);
|
|
274
276
|
|
|
275
277
|
if (this.helperText) {
|
|
276
|
-
this._mdcHelperText = new MDCTextFieldHelperText(
|
|
277
|
-
|
|
278
|
+
this._mdcHelperText = new MDCTextFieldHelperText(
|
|
279
|
+
this.element.querySelector('.mdc-text-field-helper-text'),
|
|
280
|
+
);
|
|
281
|
+
this.element.insertAdjacentElement(
|
|
282
|
+
'afterend',
|
|
283
|
+
this.element.querySelector('.mdc-text-field-helper-text'),
|
|
284
|
+
);
|
|
278
285
|
}
|
|
279
286
|
|
|
280
287
|
if (this.register) {
|
|
File without changes
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import Component from '@ember/component';
|
|
2
2
|
import {
|
|
3
|
-
classNames,
|
|
3
|
+
classNames,
|
|
4
|
+
layout,
|
|
5
|
+
tagName,
|
|
6
|
+
attribute,
|
|
4
7
|
} from '@ember-decorators/component';
|
|
5
8
|
import template from '@xdam/ember-partials/templates/components/xep-toolbar-item-icon';
|
|
6
9
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import Component from '@ember/component';
|
|
2
2
|
import {
|
|
3
|
-
classNames,
|
|
3
|
+
classNames,
|
|
4
|
+
layout,
|
|
5
|
+
tagName,
|
|
6
|
+
attribute,
|
|
4
7
|
} from '@ember-decorators/component';
|
|
5
8
|
import template from '@xdam/ember-partials/templates/components/xep-toolbar-item-text';
|
|
6
9
|
|
|
File without changes
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import Component from '@ember/component';
|
|
2
2
|
import {
|
|
3
|
-
classNames,
|
|
3
|
+
classNames,
|
|
4
|
+
layout,
|
|
5
|
+
tagName,
|
|
6
|
+
className,
|
|
7
|
+
attribute,
|
|
4
8
|
} from '@ember-decorators/component';
|
|
5
9
|
import template from '@xdam/ember-partials/templates/components/xep-toolbar-section';
|
|
6
10
|
import EmberObject, { computed } from '@ember/object';
|
|
@@ -63,7 +67,6 @@ export default class XepToolbarSectionComponent extends Component {
|
|
|
63
67
|
return this.alignTypeMap[this.align];
|
|
64
68
|
}
|
|
65
69
|
|
|
66
|
-
|
|
67
70
|
/**
|
|
68
71
|
* Define the section flex sizing. Defaults to `"grow"`.
|
|
69
72
|
* @argument [flex]
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
classNames,
|
|
2
|
+
classNames,
|
|
3
|
+
layout,
|
|
4
|
+
className,
|
|
5
|
+
attribute,
|
|
3
6
|
} from '@ember-decorators/component';
|
|
4
7
|
import template from '@xdam/ember-partials/templates/components/xep-toolbar';
|
|
5
8
|
import Component from '@ember/component';
|
|
6
9
|
import EmberObject, { computed } from '@ember/object';
|
|
7
10
|
import { inject as service } from '@ember/service';
|
|
8
|
-
import classic from 'ember-classic-decorator';
|
|
9
11
|
|
|
10
12
|
import styleString from '@xdam/ember-partials/utils/style-string';
|
|
11
13
|
|
|
@@ -25,7 +27,6 @@ const VARIANT_TYPES = {
|
|
|
25
27
|
* @yield {Hash} toolbar
|
|
26
28
|
* @yield {Hash} toolbar.section
|
|
27
29
|
*/
|
|
28
|
-
@classic
|
|
29
30
|
@layout(template)
|
|
30
31
|
@classNames('xep-toolbar')
|
|
31
32
|
export default class XepToolbarComponent extends Component {
|
|
@@ -35,7 +35,7 @@ export default Mixin.create({
|
|
|
35
35
|
* @return {Void}
|
|
36
36
|
*/
|
|
37
37
|
// eslint-disable-next-line no-unused-vars
|
|
38
|
-
didResizeElement(contentRect) {
|
|
38
|
+
didResizeElement(contentRect) {},
|
|
39
39
|
|
|
40
40
|
registerResizeObserver: on('didInsertElement', function () {
|
|
41
41
|
this.xepManager._registerResizeObserved(this);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Service from '@ember/service';
|
|
2
2
|
import Evented from '@ember/object/evented';
|
|
3
3
|
import { action } from '@ember/object';
|
|
4
|
-
import ResizeObserver from 'resize-observer-polyfill';
|
|
4
|
+
// import ResizeObserver from 'resize-observer-polyfill';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A service for managing xep components
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
{{!-- template-lint-disable no-positive-tabindex --}}
|
|
7
7
|
<Input
|
|
8
8
|
class="mdc-text-field__input"
|
|
9
|
-
|
|
9
|
+
id={{this.inputId}}
|
|
10
10
|
@type={{@type}}
|
|
11
11
|
@value={{@value}}
|
|
12
12
|
placeholder={{@placeholder}}
|
|
@@ -23,11 +23,8 @@
|
|
|
23
23
|
multiple={{@multiple}}
|
|
24
24
|
readonly={{@readonly}}
|
|
25
25
|
spellcheck={{@spellcheck}}
|
|
26
|
-
{{on "
|
|
27
|
-
@
|
|
28
|
-
@focus-out={{optional @handleFocusOut}}
|
|
29
|
-
{{on "change" (optional @handleChange)}}
|
|
30
|
-
{{on "input" (optional @handleInput)}}
|
|
26
|
+
{{on "keydown" (optional @handleKeyDown)}} {{on "change" (optional @handleChange)}}
|
|
27
|
+
{{on "input" (optional @handleInput)}} {{on "focusin" (optional @handleFocusIn)}} {{on "focusout" (optional @handleFocusOut)}}
|
|
31
28
|
/>
|
|
32
29
|
|
|
33
30
|
{{#if (and @label (not @outlined))}}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
{{!-- template-lint-disable builtin-component-arguments --}}
|
|
2
|
+
{{!-- FIXME(XDAM-6252): the rule wants @checked here, but @checked and @value
|
|
3
|
+
are mutually exclusive on the builtin <Input>. Resolving it is a public
|
|
4
|
+
API decision for xep-radio, not a lint fix. --}}
|
|
1
5
|
<div class="mdc-radio">
|
|
2
6
|
<Input
|
|
3
7
|
class="mdc-radio__native-control"
|
|
4
8
|
@type="radio"
|
|
5
|
-
|
|
9
|
+
id={{this.radioId}}
|
|
6
10
|
checked={{@checked}}
|
|
7
11
|
disabled={{@disabled}}
|
|
8
12
|
@value={{@value}}
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
{{!-- template-lint-disable require-presentational-children --}}
|
|
2
|
+
{{!-- The svg icons inside the switch button are decorative and the DOM
|
|
3
|
+
structure is dictated by @material/switch. --}}
|
|
4
|
+
<button
|
|
5
|
+
id={{this.switchId}}
|
|
6
|
+
class="mdc-switch mdc-switch--unselected"
|
|
7
|
+
type="button"
|
|
8
|
+
role="switch"
|
|
9
|
+
aria-checked="false"
|
|
10
|
+
>
|
|
2
11
|
<div class="mdc-switch__track"></div>
|
|
3
12
|
<div class="mdc-switch__handle-track">
|
|
4
13
|
<div class="mdc-switch__handle">
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { dasherize } from '@ember/-internals/string';
|
|
2
|
+
import { htmlSafe } from '@ember/template';
|
|
2
3
|
|
|
3
4
|
// Lifted from React
|
|
4
5
|
const isUnitlessNumber = {
|
|
@@ -59,7 +60,8 @@ function transformStyleValue(key, value) {
|
|
|
59
60
|
* @param {HTMLElement} element The element to extract current styles from
|
|
60
61
|
*/
|
|
61
62
|
function deserializeStyleString(styles = {}, element) {
|
|
62
|
-
const currentStylesObj = element.style.cssText
|
|
63
|
+
const currentStylesObj = element.style.cssText
|
|
64
|
+
.split(';')
|
|
63
65
|
.reduce((prev, curr) => {
|
|
64
66
|
const [key, value] = curr.split(':');
|
|
65
67
|
|
|
@@ -84,7 +86,11 @@ export default function styleString(styles = {}, element) {
|
|
|
84
86
|
styles = deserializeStyleString(styles, element);
|
|
85
87
|
}
|
|
86
88
|
|
|
87
|
-
if (
|
|
89
|
+
if (
|
|
90
|
+
styles !== null &&
|
|
91
|
+
typeof styles === 'object' &&
|
|
92
|
+
styles.length === undefined
|
|
93
|
+
) {
|
|
88
94
|
let string = Object.entries(styles)
|
|
89
95
|
.map(([key, value]) => transformStyleValue(key, value))
|
|
90
96
|
.join(';');
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
/**
|
|
3
2
|
* Update Dirty Props: Update some object with specific properties from another object
|
|
4
3
|
*
|
|
@@ -7,11 +6,17 @@
|
|
|
7
6
|
* @param {Object} target The object which will receive new properties
|
|
8
7
|
*/
|
|
9
8
|
export default function updateDirtyProps(props, source, target) {
|
|
10
|
-
if (!target) {
|
|
11
|
-
|
|
9
|
+
if (!target) {
|
|
10
|
+
throw new Error('target parameter is undefined');
|
|
11
|
+
}
|
|
12
|
+
if (!source) {
|
|
13
|
+
throw new Error('source parameter is undefined');
|
|
14
|
+
}
|
|
12
15
|
|
|
13
16
|
props.forEach((prop) => {
|
|
14
|
-
if (typeof source[prop] === 'undefined') {
|
|
17
|
+
if (typeof source[prop] === 'undefined') {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
15
20
|
|
|
16
21
|
if (target[prop] !== source[prop]) {
|
|
17
22
|
if (target.set && target.set.call) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|