-
-
- {{type}}
-
-
-
- {{option}}
-
+
+
+
+
+ {{type}}
+
+
+
+ {{option}}
+
- Selected Value: {{ selectedValue }}
-
+ Selected Value: {{ selectedValue }}
+
-
-
- {{option}}
-
-
- Multi Select: {{ selectedValues }}
-
+
-
+
diff --git a/components/select/index.js b/components/select/index.js
index 700f934b..14b0d6f6 100644
--- a/components/select/index.js
+++ b/components/select/index.js
@@ -1,14 +1,12 @@
-import {BasePlugin} from '../base'
-import mdcSelect from './mdc-select.vue'
-import mdcOption from './mdc-option.vue'
+import { BasePlugin } from '../base';
+import mdcSelect from './mdc-select.vue';
+import mdcOption from './mdc-option.vue';
+import mdcOptgroup from './mdc-optgroup.vue';
-
-export {
- mdcSelect,
- mdcOption,
-}
+export { mdcSelect, mdcOption, mdcOptgroup };
export default BasePlugin({
mdcSelect,
mdcOption,
-})
+ mdcOptgroup,
+});
diff --git a/components/select/mdc-menu-option.vue b/components/select/mdc-menu-option.vue
deleted file mode 100644
index 454f26d2..00000000
--- a/components/select/mdc-menu-option.vue
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
diff --git a/components/select/mdc-menu-select.vue b/components/select/mdc-menu-select.vue
deleted file mode 100644
index 3f2c3e16..00000000
--- a/components/select/mdc-menu-select.vue
+++ /dev/null
@@ -1,265 +0,0 @@
-
-
-
-
-
diff --git a/components/select/mdc-multi-option.vue b/components/select/mdc-multi-option.vue
deleted file mode 100644
index 6bdadfc0..00000000
--- a/components/select/mdc-multi-option.vue
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
diff --git a/components/select/mdc-multi-select.vue b/components/select/mdc-multi-select.vue
deleted file mode 100644
index 86ac000e..00000000
--- a/components/select/mdc-multi-select.vue
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
diff --git a/components/select/mdc-native-option.vue b/components/select/mdc-native-option.vue
deleted file mode 100644
index e6b2b73f..00000000
--- a/components/select/mdc-native-option.vue
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
diff --git a/components/select/mdc-native-select.vue b/components/select/mdc-native-select.vue
deleted file mode 100644
index 6b11762d..00000000
--- a/components/select/mdc-native-select.vue
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
diff --git a/components/select/mdc-optgroup.vue b/components/select/mdc-optgroup.vue
new file mode 100644
index 00000000..39dcb6a4
--- /dev/null
+++ b/components/select/mdc-optgroup.vue
@@ -0,0 +1,16 @@
+
+
+
+
+
diff --git a/components/select/mdc-option.vue b/components/select/mdc-option.vue
index f9e23e06..e703d999 100644
--- a/components/select/mdc-option.vue
+++ b/components/select/mdc-option.vue
@@ -1,42 +1,24 @@
-
-
-
+
+
+
diff --git a/components/select/styles.scss b/components/select/styles.scss
index bdc8e128..2d46ab44 100644
--- a/components/select/styles.scss
+++ b/components/select/styles.scss
@@ -1,75 +1 @@
-@import "@material/select/mdc-select";
-
-// TODO: MDCFIX
-// should have top bottom margins?
-// should align same way if label float-above
-
-
-// TODO: MDCFIX
-// implement new select
-.mdc-multi-select {
- @include mdc-theme-prop(border-color, text-hint-on-light);
-
- width: 250px;
- padding: 0;
- border-width: 1px;
- border-style: solid;
- outline: none;
- appearance: none;
-
- .mdc-list-divider {
- margin-bottom: 8px;
- padding-top: 8px;
- font-size: 0;
- }
-
- .mdc-list-group {
- @include mdc-theme-prop(color, text-hint-on-light);
-
- margin: 16px 0 0;
- padding: 0 0 0 16px;
- font-weight: normal;
-
- &:last-child {
- margin-bottom: 16px;
- }
-
- .mdc-list-divider {
- margin-left: -16px;
- }
- }
-
- .mdc-list-item {
- @include mdc-theme-prop(color, text-primary-on-light);
-
- margin: 0 0 0 -16px;
- padding: 0 16px;
-
- &:first-child {
- margin-top: 12px;
- }
-
- &:last-child {
- margin-bottom: 8px;
- }
-
- // Browsers are inconsistent in what they allow us to override, and some (e.g. Chrome) don't allow overriding the
- // OS-determined selection color, which states styles are not going to play well with.
- // Additionally, Firefox seems to ignore position: relative on option elements, which causes the pseudo elements
- // that we use for ripple/states to position and size themselves relative to the entire body instead.
- // Disabling states-specific styles on multi-select options altogether is the most straightforward recourse.
- &::before,
- &::after {
- content: none;
- }
- }
-
- .mdc-list-item:checked {
- @include mdc-theme-prop(background-color, background);
- }
-
-}
-
-.mdc-multi-select:focus .mdc-list-item:checked {
- @include mdc-theme-prop(background-color, primary);
-}
+@import '@material/select/mdc-select';
diff --git a/components/select/test.spec.js b/components/select/test.spec.js
index 6f3c374b..f5d640c8 100644
--- a/components/select/test.spec.js
+++ b/components/select/test.spec.js
@@ -1,45 +1,30 @@
-import { mount, createLocalVue, checkValidMdcAdapter } from '../unit-test'
-
-import mdcMenuSelect from './mdc-menu-select.vue'
-import mdcMenuOption from './mdc-menu-option.vue'
-import mdcNativeSelect from './mdc-native-select.vue'
-import mdcNativeOption from './mdc-native-option.vue'
-import mdcMultiSelect from './mdc-multi-select.vue'
-import mdcMultiOption from './mdc-multi-option.vue'
-
+import {
+ mount,
+ createLocalVue,
+ checkValidMdcAdapter
+} from '../unit-test'
+import {
+ mdcSelect,
+ mdcOption,
+ mdcOptgroup
+} from './index.js'
import Spec from './test.spec.vue';
describe(__dirname, () => {
-
const localVue = createLocalVue()
-
describe('mdcSelect', () => {
const spec = mount(Spec, localVue)
test('is a Vue instance', () => {
expect(spec.isVueInstance()).toBeTruthy()
})
-
- describe('mdcMenuSelect', () => {
- checkValidMdcAdapter(spec.find(mdcMenuSelect).vm)
- })
- describe('mdcMenuOption', () => {
- checkValidMdcAdapter(spec.find(mdcMenuOption).vm)
+ describe('mdcSelect', () => {
+ checkValidMdcAdapter(spec.find(mdcSelect).vm)
})
-
- describe('mdcNativeSelect', () => {
- checkValidMdcAdapter(spec.find(mdcNativeSelect).vm)
- })
- describe('mdcNativeOption', () => {
- checkValidMdcAdapter(spec.find(mdcNativeOption).vm)
- })
-
- describe('mdcMultiSelect', () => {
- checkValidMdcAdapter(spec.find(mdcMultiSelect).vm)
+ describe('mdcOption', () => {
+ checkValidMdcAdapter(spec.find(mdcOption).vm)
})
- describe('mdcMultiOption', () => {
- checkValidMdcAdapter(spec.find(mdcMultiOption).vm)
+ describe('mdcOptgroup', () => {
+ checkValidMdcAdapter(spec.find(mdcOptgroup).vm)
})
-
})
-
-})
\ No newline at end of file
+})
diff --git a/components/select/test.spec.vue b/components/select/test.spec.vue
index 087d8695..96fa6e32 100644
--- a/components/select/test.spec.vue
+++ b/components/select/test.spec.vue
@@ -1,38 +1,19 @@
-
- option1
- Option2
-
-
-
- option1
- Option2
-
-
-
- option3
- option3
-
-
+
+ option1
+ Option2
+