mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-20 15:01:46 +01:00
Compare commits
5 Commits
chore/dyna
...
pr/3973
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b17c66b6c | ||
|
|
8dfdd63ce3 | ||
|
|
e6369a6746 | ||
|
|
a4f3f6d531 | ||
|
|
c5bdec0f64 |
@@ -11,7 +11,7 @@ export default defineBuildConfig({
|
|||||||
delimiters: ['', ''],
|
delimiters: ['', ''],
|
||||||
values: {
|
values: {
|
||||||
// Used in development to import directly from theme
|
// Used in development to import directly from theme
|
||||||
'const isUiDev = true': 'const isUiDev = false'
|
'process.argv.includes(\'--uiDev\')': 'false'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ const modal = overlay.create(LazyModalExample, {
|
|||||||
})
|
})
|
||||||
|
|
||||||
async function open() {
|
async function open() {
|
||||||
const shouldIncrement = await modal.open()
|
const instance = modal.open()
|
||||||
|
|
||||||
|
const shouldIncrement = await instance.result
|
||||||
|
|
||||||
if (shouldIncrement) {
|
if (shouldIncrement) {
|
||||||
count.value++
|
count.value++
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ const slideover = overlay.create(LazySlideoverExample, {
|
|||||||
})
|
})
|
||||||
|
|
||||||
async function open() {
|
async function open() {
|
||||||
const shouldIncrement = await slideover.open()
|
const instance = slideover.open()
|
||||||
|
|
||||||
|
const shouldIncrement = await instance.result
|
||||||
|
|
||||||
if (shouldIncrement) {
|
if (shouldIncrement) {
|
||||||
count.value++
|
count.value++
|
||||||
|
|||||||
@@ -66,6 +66,13 @@ Update an overlay using its `id`
|
|||||||
|
|
||||||
Removes the overlay from the DOM using its `id`
|
Removes the overlay from the DOM using its `id`
|
||||||
|
|
||||||
|
- Parameters:
|
||||||
|
- `id`: The identifier of the overlay
|
||||||
|
|
||||||
|
### `isOpen(id: symbol): boolean`
|
||||||
|
|
||||||
|
Checks if an overlay its open using its `id`
|
||||||
|
|
||||||
- Parameters:
|
- Parameters:
|
||||||
- `id`: The identifier of the overlay
|
- `id`: The identifier of the overlay
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,7 @@
|
|||||||
},
|
},
|
||||||
"style": "./dist/runtime/index.css",
|
"style": "./dist/runtime/index.css",
|
||||||
"main": "./dist/module.mjs",
|
"main": "./dist/module.mjs",
|
||||||
|
"types": "./dist/types.d.mts",
|
||||||
"files": [
|
"files": [
|
||||||
".nuxt/ui",
|
".nuxt/ui",
|
||||||
".nuxt/ui.css",
|
".nuxt/ui.css",
|
||||||
@@ -96,12 +97,12 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "nuxt-module-build build",
|
"build": "nuxt-module-build build",
|
||||||
"prepack": "pnpm build",
|
"prepack": "pnpm build",
|
||||||
"dev": "nuxi dev playground",
|
"dev": "nuxi dev playground --uiDev",
|
||||||
"dev:build": "nuxi build playground",
|
"dev:build": "nuxi build playground",
|
||||||
"dev:vue": "vite playground-vue",
|
"dev:vue": "vite playground-vue -- --uiDev",
|
||||||
"dev:vue:build": "vite build playground-vue",
|
"dev:vue:build": "vite build playground-vue",
|
||||||
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground && nuxi prepare docs && vite build playground-vue",
|
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground && nuxi prepare docs && vite build playground-vue",
|
||||||
"docs": "nuxi dev docs",
|
"docs": "nuxi dev docs --uiDev",
|
||||||
"docs:build": "nuxi build docs",
|
"docs:build": "nuxi build docs",
|
||||||
"docs:prepare": "nuxt-component-meta docs",
|
"docs:prepare": "nuxt-component-meta docs",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
|
|||||||
3245
pnpm-lock.yaml
generated
3245
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -122,6 +122,12 @@ function _useOverlay() {
|
|||||||
return overlay
|
return overlay
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isOpen = (id: symbol): boolean => {
|
||||||
|
const overlay = getOverlay(id)
|
||||||
|
|
||||||
|
return overlay.isOpen
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
overlays,
|
overlays,
|
||||||
open,
|
open,
|
||||||
@@ -129,7 +135,8 @@ function _useOverlay() {
|
|||||||
closeAll,
|
closeAll,
|
||||||
create,
|
create,
|
||||||
patch,
|
patch,
|
||||||
unMount
|
unMount,
|
||||||
|
isOpen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,8 +51,7 @@ export function getTemplates(options: ModuleOptions, uiConfig: Record<string, an
|
|||||||
}
|
}
|
||||||
|
|
||||||
// For local development, import directly from theme
|
// For local development, import directly from theme
|
||||||
const isUiDev = true
|
if (process.argv.includes('--uiDev')) {
|
||||||
if (isUiDev) {
|
|
||||||
const templatePath = fileURLToPath(new URL(`./theme/${kebabCase(component)}`, import.meta.url))
|
const templatePath = fileURLToPath(new URL(`./theme/${kebabCase(component)}`, import.meta.url))
|
||||||
return [
|
return [
|
||||||
`import template from ${JSON.stringify(templatePath)}`,
|
`import template from ${JSON.stringify(templatePath)}`,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
body: 'flex flex-col space-y-4 pt-4 sm:flex-row sm:space-x-4 sm:space-y-0',
|
body: 'flex flex-col space-y-4 pt-4 sm:flex-row sm:space-x-4 sm:space-y-0',
|
||||||
heading: 'text-center font-medium truncate mx-auto',
|
heading: 'text-center font-medium truncate mx-auto',
|
||||||
grid: 'w-full border-collapse select-none space-y-1 focus:outline-none',
|
grid: 'w-full border-collapse select-none space-y-1 focus:outline-none',
|
||||||
gridRow: 'grid grid-cols-7',
|
gridRow: 'grid grid-cols-7 place-items-center',
|
||||||
gridWeekDaysRow: 'mb-1 grid w-full grid-cols-7',
|
gridWeekDaysRow: 'mb-1 grid w-full grid-cols-7',
|
||||||
gridBody: 'grid',
|
gridBody: 'grid',
|
||||||
headCell: 'rounded-md',
|
headCell: 'rounded-md',
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user