@g1cloud/open-bluesea-nuxt-module
v1.1.1
Published
Open Bluesea Next Module
Readme
@g1cloud/open-bluesea-nuxt-module
Nuxt module for @g1cloud/open-bluesea-core - Vue UI component library.
Features
- Auto-import of 25+ UI components (BSButton, BSTextInput, BSCheckbox, BSSelect, etc.)
- Auto-import of composables (useBlueseaConfig, showNotification, useSavePoint, etc.)
- Vue directives (v-tooltip, v-focus-on-load, v-click-outside)
- Notification system
- Context menu support
- SavePoint (change tracking) support
Quick Setup
Install the module to your Nuxt application:
pnpm add @g1cloud/open-bluesea-nuxt-moduleAdd to your nuxt.config.ts:
export default defineNuxtConfig({
modules: ['@g1cloud/open-bluesea-nuxt-module'],
openBluesea: {
// Optional configuration
dateFormat: 'YYYY-MM-DD HH:mm',
},
})Usage
Components are auto-imported and can be used directly in your templates:
<template>
<div>
<BSButton @click="handleClick">
Click me
</BSButton>
<BSTextInput v-model="text" placeholder="Enter text..." />
<BSCheckbox v-model="checked">
Check me
</BSCheckbox>
<span v-tooltip="'Tooltip text'">Hover me</span>
<!-- Required for notifications -->
<BSNotificationContainer />
</div>
</template>
<script setup>
const text = ref('')
const checked = ref(false)
const handleClick = () => {
showNotification('Button clicked!', 'info')
}
</script>Available Components
Basic Components
BSButton- ButtonBSPageNavigation- PaginationBSLoadingIcon- Loading indicatorBSPopup- Popup/ModalBSTooltip- TooltipBSCalendar- Calendar pickerBSCalendarRange- Date range calendar
Input Components
BSTextInput- Text inputBSNumberInput- Number inputBSTextArea- Text areaBSCheckbox/BSCheckboxGroup- CheckboxBSRadioButton/BSRadioButtonGroup- Radio buttonBSSelect/BSMultiSelect- Dropdown selectBSDateInput/BSDateInputPopup- Date inputBSDateRange/BSDateRangeInputPopup- Date range input
Layout Components
BSCardLayout- Card layout
Container Components
BSNotificationContainer- Notification containerBSContextMenuContainer- Context menu containerBSContextMenu- Context menu
Available Composables
useBlueseaConfig()- Access configurationshowNotification()/showAlarm()/closeAlarm()- Notification systemshowTooltip()/hideTooltip()- Tooltip controlshowLoading()/hideLoading()/withLoading()- Loading stateuseContextMenu()/createContextMenuPlugin()- Context menuprovideSavePoint()/useSavePoint()- Change trackingprovideFieldContext()/useFieldContext()- Field contextdebounce()- Debounce utilitywaitUntil()/waitDuring()/tryUntil()- Async utilities
Configuration Options
interface ModuleOptions {
dateFormat?: string // Default: 'YYYY-MM-DD HH:mm'
dateFormatDay?: string // Default: 'YYYY-MM-DD'
dateFormatMinute?: string // Default: 'YYYY-MM-DD HH:mm'
dateFormatSecond?: string // Default: 'YYYY-MM-DD HH:mm:ss'
minDateValue?: string
maxDateValue?: string
timeZone?: string
componentConfig?: {
popup?: {
container?: string | HTMLElement
hideOnScroll?: boolean
}
calendar?: {
startYear?: string
endYear?: string
}
}
}Development
# Install dependencies
pnpm install
# Generate type stubs
pnpm dev:prepare
# Develop with the playground
pnpm dev
# Run ESLint
pnpm lint
# Run tests
pnpm test
# Type check
pnpm test:typesPublishing
# Full release (lint, test, build, changelog, publish, push tags)
pnpm release
# Or step by step:
# 1. Build the module
pnpm prepack
# 2. Generate changelog and bump version
npx changelogen --release
# 3. Publish to npm
npm publish
# 4. Push tags to git
git push --follow-tags