diff --git a/src/Popconfirm/index.js b/src/Popconfirm/index.js deleted file mode 100644 index 865a1916a..000000000 --- a/src/Popconfirm/index.js +++ /dev/null @@ -1,8 +0,0 @@ -/* istanbul ignore file */ -import Popconfirm from './src/Popconfirm.vue' - -Popconfirm.install = function (Vue) { - Vue.component(Popconfirm.name, Popconfirm) -} - -export default Popconfirm diff --git a/src/_styles/Popconfirm.scss b/src/_styles/Popconfirm.scss index c7c76e3c0..3de2e250f 100644 --- a/src/_styles/Popconfirm.scss +++ b/src/_styles/Popconfirm.scss @@ -1,33 +1,33 @@ -@import './mixins/mixins.scss'; +// @import './mixins/mixins.scss'; -@include b(popconfirm-content) { - padding: 4px 0; - @include m(no-icon) { - @include e(body) { - padding-left: 0; - } - } - @include e(body) { - font-size: 13px; - white-space: nowrap; - padding-left: 22px; - position: relative; - @include b(icon) { - position: absolute; - font-size: 18px; - left: 0; - top: 0; - } - } - @include e(action) { - margin-top: 14px; - display: flex; - justify-content: flex-end; - @include b(button) { - margin-right: 8px; - &:last-child { - margin-right: 0; - } - } - } -} \ No newline at end of file +// @include b(popconfirm-content) { +// padding: 4px 0; +// @include m(no-icon) { +// @include e(body) { +// padding-left: 0; +// } +// } +// @include e(body) { +// font-size: 13px; +// white-space: nowrap; +// padding-left: 22px; +// position: relative; +// @include b(icon) { +// position: absolute; +// font-size: 18px; +// left: 0; +// top: 0; +// } +// } +// @include e(action) { +// margin-top: 14px; +// display: flex; +// justify-content: flex-end; +// @include b(button) { +// margin-right: 8px; +// &:last-child { +// margin-right: 0; +// } +// } +// } +// } \ No newline at end of file diff --git a/src/index.js b/src/index.js index 5db343413..cd57955ee 100644 --- a/src/index.js +++ b/src/index.js @@ -43,6 +43,8 @@ import Message from './Message' import Modal from './modal' import Notification from './Notification' import Pagination from './Pagination' +import Popconfirm from './pop-confirm' +import Popselect from './Popselect' import Popconfirm from './Popconfirm' import Popselect from './pop-select' import Popup from './Popover' @@ -140,6 +142,8 @@ import loadingBarLightStyle from './loading-bar/styles/light' import loadingBarDarkStyle from './loading-bar/styles/dark' import modalDarkStyle from './modal/styles/dark' import modalLightStyle from './modal/styles/light' +import popConfirmDarkStyle from './pop-confirm/styles/dark' +import popConfirmLightStyle from './pop-confirm/styles/light' import popSelectLightStyle from './pop-select/styles/light' import popSelectDarkStyle from './pop-select/styles/dark' import resultDarkStyle from './result/styles/dark' @@ -313,6 +317,8 @@ export default create({ loadingBarLightStyle, modalDarkStyle, modalLightStyle, + popConfirmDarkStyle, + popConfirmLightStyle, popSelectLightStyle, popSelectDarkStyle, resultDarkStyle, diff --git a/src/pop-confirm/index.js b/src/pop-confirm/index.js new file mode 100644 index 000000000..45761eb32 --- /dev/null +++ b/src/pop-confirm/index.js @@ -0,0 +1,8 @@ +/* istanbul ignore file */ +import Popconfirm from './src/Popconfirm.vue' + +Popconfirm.install = function (Vue, naive) { + Vue.component(naive.componentPrefix + Popconfirm.name, Popconfirm) +} + +export default Popconfirm diff --git a/src/Popconfirm/src/Popconfirm.vue b/src/pop-confirm/src/Popconfirm.vue similarity index 98% rename from src/Popconfirm/src/Popconfirm.vue rename to src/pop-confirm/src/Popconfirm.vue index b77bfd868..2a7f09dc9 100644 --- a/src/Popconfirm/src/Popconfirm.vue +++ b/src/pop-confirm/src/Popconfirm.vue @@ -3,7 +3,7 @@ import NPopover from '../../Popover' import PopconfirmPanel from './PopconfirmPanel' export default { - name: 'NPopconfirm', + name: 'Popconfirm', functional: true, props: { ...NPopover.props, diff --git a/src/Popconfirm/src/PopconfirmPanel.vue b/src/pop-confirm/src/PopconfirmPanel.vue similarity index 87% rename from src/Popconfirm/src/PopconfirmPanel.vue rename to src/pop-confirm/src/PopconfirmPanel.vue index d7c012320..92be55562 100644 --- a/src/Popconfirm/src/PopconfirmPanel.vue +++ b/src/pop-confirm/src/PopconfirmPanel.vue @@ -45,15 +45,25 @@ import NButton from '../../button' import NIcon from '../../icon' import mdAlert from '../../_icons/md-alert' import locale from '../../_mixins/locale' +import withapp from '../../_mixins/withapp' +import themeable from '../../_mixins/themeable' +import usecssr from '../../_mixins/usecssr' +import styles from './styles' export default { name: 'NPopconfirmPanel', + cssrName: 'Popconfirm', components: { NButton, NIcon, mdAlert }, - mixins: [ locale('Popconfirm') ], + mixins: [ + locale('Popconfirm'), + withapp, + themeable, + usecssr(styles) + ], props: { positiveText: { type: String, diff --git a/src/pop-confirm/src/styles/index.js b/src/pop-confirm/src/styles/index.js new file mode 100644 index 000000000..958d3000d --- /dev/null +++ b/src/pop-confirm/src/styles/index.js @@ -0,0 +1,9 @@ +import baseStyle from './themed-base.cssr.js' + +export default [ + { + key: 'syntheticTheme', + watch: ['syntheticTheme'], + CNode: baseStyle + } +] diff --git a/src/pop-confirm/src/styles/themed-base.cssr.js b/src/pop-confirm/src/styles/themed-base.cssr.js new file mode 100644 index 000000000..d38f1ae83 --- /dev/null +++ b/src/pop-confirm/src/styles/themed-base.cssr.js @@ -0,0 +1,57 @@ +import { cTB, c, cB, cE, cM } from '../../../_utils/cssr' + +export default c([ + ({ props }) => { + return [ + cTB('popconfirm-content', { + raw: ` + padding: 4px 0; + ` + }, [ + cE('body', { + raw: ` + font-size: 13px; + white-space: nowrap; + padding-left: 22px; + position: relative; + ` + }, [ + cB('icon', { + raw: ` + position: absolute; + font-size: 18px; + left: 0; + top: 0; + ` + }) + ]), + cM('no-icon', [ + cE('body', { + raw: ` + padding-left: 0; + ` + }) + ]), + cE('action', { + raw: ` + margin-top: 14px; + display: flex; + justify-content: flex-end; + ` + }, [ + cB('button', { + raw: ` + margin-right: 8px; + ` + }, [ + c('&:last-child', { + raw: ` + margin-right: 0; + ` + }) + ]) + ]) + ]) + ] + } +]) diff --git a/src/pop-confirm/styles/dark.js b/src/pop-confirm/styles/dark.js new file mode 100644 index 000000000..c25c324ab --- /dev/null +++ b/src/pop-confirm/styles/dark.js @@ -0,0 +1,11 @@ +import create from '../../styles/_utils/create-component-base' + +export default create({ + name: 'Popconfirm', + theme: 'dark', + getDerivedVariables ({ base, derived }) { + return { + + } + } +}) diff --git a/src/pop-confirm/styles/light.js b/src/pop-confirm/styles/light.js new file mode 100644 index 000000000..9830f1388 --- /dev/null +++ b/src/pop-confirm/styles/light.js @@ -0,0 +1,11 @@ +import create from '../../styles/_utils/create-component-base' + +export default create({ + name: 'Popconfirm', + theme: 'light', + getDerivedVariables ({ base, derived }) { + return { + + } + } +})