Skip to content

Commit

Permalink
refactor(mobile): remove @opentiny/mobile-utils package, and add alia…
Browse files Browse the repository at this point in the history
…s to utils
  • Loading branch information
shenjunjian committed Jan 9, 2025
1 parent 6eb80f1 commit 249f86c
Show file tree
Hide file tree
Showing 60 changed files with 128 additions and 3,406 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module.exports = {
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-invalid-this': 'off',
'vue/no-deprecated-dollar-scopedslots-api': 'off',
'@typescript-eslint/lines-between-class-members': 'off'
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/no-this-alias': 'off'
}
}
1 change: 1 addition & 0 deletions examples/sites/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export default defineConfig((config) => {
resolve: {
extensions: ['.js', '.ts', '.tsx', '.vue'],
alias: {
'@mobile-root': pathFromWorkspaceRoot('packages/mobile'),
'@': path.resolve('src'),
'@demos': path.resolve(`${demosPath}`),
'@menu': menuPath,
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/components/badge/src/renderless/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

import { computedContent, computedValueRef, computedTransform } from './index'
import { xss } from '@opentiny/mobile-utils/xss'
import { xss } from '@mobile-root/utils/xss'
import type { IBadgeState, IBadgeProps, IBadgeApi, IBadgeRenderlessParams } from '../badge'

export const api = ['state']
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/components/button/src/renderless/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
*/
import type { IButtonRenderlessParams, IButtonState } from '../button'
import { xss } from '@opentiny/mobile-utils'
import { xss } from '@mobile-root/utils'

export const handleClick =
({ emit, props, state }: Pick<IButtonRenderlessParams, 'emit' | 'props' | 'state'>) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

import type { ICheckboxRenderlessParams, ICheckboxState, ICheckboxChangeEvent, ICheckboxProps } from '../checkbox'
import { isNull } from '@opentiny/mobile-utils/type'
import { isNull } from '@mobile-root/utils/type'

export const addToStore =
({ state, props }: Pick<ICheckboxRenderlessParams, 'state' | 'props'>) =>
Expand Down
4 changes: 2 additions & 2 deletions packages/mobile/components/container/src/renderless/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
*/

import { isNumber } from '@opentiny/mobile-utils/type'
import { isNumber } from '@mobile-root/utils/type'

export const computedShowHeader =
({ constants, props }) =>
Expand Down Expand Up @@ -128,7 +128,7 @@ export const computedLeftStyle =
export const computedShowRight =
({ constants, props }) =>
() => {
return props.pattern === constants.DEFAULT ? false : true
return props.pattern !== constants.DEFAULT
}

export const computedRightStyle =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
onChange,
updateColumnValue
} from './index'
import { DATE } from '@opentiny/mobile-utils'
import { DATE } from '@mobile-root/utils'
import type {
IDatePickerApi,
IDatePickerProps,
Expand Down
6 changes: 3 additions & 3 deletions packages/mobile/components/dialog-box/src/renderless/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
*
*/

import { on, off, addClass, removeClass } from '@opentiny/mobile-utils/deps/dom'
import { emitEvent } from '@opentiny/mobile-utils/event'
import { getDomNode } from '@opentiny/mobile-utils/deps/dom'
import { on, off, addClass, removeClass } from '@mobile-root/utils/deps/dom'
import { emitEvent } from '@mobile-root/utils/event'
import { getDomNode } from '@mobile-root/utils/deps/dom'
import type { IDialogBoxRenderlessParams, IDialogBoxStyle } from '../dialog-box'

export const computedAnimationName =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
hideScrollbar,
computedBodyStyle
} from './index'
import usePopup from '@opentiny/mobile-utils/deps/vue-popup'
import usePopup from '@mobile-root/utils/deps/vue-popup'
import type {
IDialogBoxApi,
IDialogBoxProps,
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/components/dropdown-item/src/mobile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ import { setup, defineComponent, directive } from '../../../vue-common'
import { iconYes } from '@opentiny/vue-icon'
import Popup from '../../popup'
import Button from '../../button'
import Clickoutside from '@opentiny/mobile-utils/deps/clickoutside'
import Clickoutside from '@mobile-root/utils/deps/clickoutside'
import '@opentiny/vue-theme-mobile/dropdown-item/index.less'
import { dropdownItemProps } from './dropdown-item'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
IDropdownItemTag,
IDropdownItemOptionStyle
} from '../dropdown-item'
import { on, off } from '@opentiny/mobile-utils/deps/dom'
import { on, off } from '@mobile-root/utils/deps/dom'

export const getTitle = (props: IDropdownItemRenderlessParams['props']) => (): string => {
if (props.title) {
Expand Down
6 changes: 3 additions & 3 deletions packages/mobile/components/dropdown-menu/src/mobile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
item.type === 'filter'
? 'IconUnfilter'
: item.type === 'selection' && item.state.showPopup
? 'IconUp'
: 'IconDown'
? 'IconUp'
: 'IconDown'
"
:class="[item.type === 'filter' ? 'filter-icon' : '']"
/>
Expand All @@ -71,7 +71,7 @@ import { renderless, api } from './renderless/vue'
import { setup, defineComponent, directive } from '../../../vue-common'
import { iconUp, iconDown, iconUnfilter, iconSort, iconDeltaDown, iconDeltaUp } from '@opentiny/vue-icon'
import { dropdownMenuProps } from './dropdown-menu'
import Clickoutside from '@opentiny/mobile-utils/deps/clickoutside'
import Clickoutside from '@mobile-root/utils/deps/clickoutside'
import '@opentiny/vue-theme-mobile/dropdown-menu/index.less'

export default defineComponent({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

import type { IDropdownMenuRenderlessParams, IDropdownMenuPopperParams, IDropdownItemVm } from '../dropdown-menu'
import userPopper from '@opentiny/mobile-utils/deps/vue-popper'
import userPopper from '@mobile-root/utils/deps/vue-popper'

export const toggleItem =
(state: IDropdownMenuRenderlessParams['state']) =>
Expand Down
Loading

0 comments on commit 249f86c

Please sign in to comment.