@ghostvue/themes 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +59 -2
- package/THIRD_PARTY_NOTICES.md +30 -0
- package/dist/base.css +341 -0
- package/dist/calm.css +1899 -0
- package/dist/components.d.ts +148 -0
- package/dist/components.js +143 -0
- package/dist/default.css +11017 -0
- package/dist/define.d.ts +75 -0
- package/dist/define.js +5934 -0
- package/dist/flagship-themes.d.ts +5 -0
- package/dist/flagship-themes.js +3 -0
- package/dist/generated/tokens.d.ts +5275 -0
- package/dist/generated/tokens.js +5272 -0
- package/dist/ghost-accordion-content.d.ts +26 -0
- package/dist/ghost-accordion-content.js +22 -0
- package/dist/ghost-accordion-item.d.ts +24 -0
- package/dist/ghost-accordion-item.js +16 -0
- package/dist/ghost-accordion-trigger.d.ts +17 -0
- package/dist/ghost-accordion-trigger.js +33 -0
- package/dist/ghost-accordion.d.ts +72 -0
- package/dist/ghost-accordion.js +56 -0
- package/dist/ghost-avatar.d.ts +60 -0
- package/dist/ghost-avatar.js +39 -0
- package/dist/ghost-badge.d.ts +46 -0
- package/dist/ghost-badge.js +33 -0
- package/dist/ghost-breadcrumb-ellipsis.d.ts +16 -0
- package/dist/ghost-breadcrumb-ellipsis.js +20 -0
- package/dist/ghost-breadcrumb-item.d.ts +18 -0
- package/dist/ghost-breadcrumb-item.js +20 -0
- package/dist/ghost-breadcrumb-link.d.ts +18 -0
- package/dist/ghost-breadcrumb-link.js +33 -0
- package/dist/ghost-breadcrumb-list.d.ts +18 -0
- package/dist/ghost-breadcrumb-list.js +27 -0
- package/dist/ghost-breadcrumb-page.d.ts +18 -0
- package/dist/ghost-breadcrumb-page.js +20 -0
- package/dist/ghost-breadcrumb-separator.d.ts +18 -0
- package/dist/ghost-breadcrumb-separator.js +20 -0
- package/dist/ghost-breadcrumb.d.ts +34 -0
- package/dist/ghost-breadcrumb.js +27 -0
- package/dist/ghost-button.d.ts +102 -0
- package/dist/ghost-button.js +66 -0
- package/dist/ghost-calendar-cell.d.ts +15 -0
- package/dist/ghost-calendar-cell.js +12 -0
- package/dist/ghost-calendar-grid.d.ts +5 -0
- package/dist/ghost-calendar-grid.js +21 -0
- package/dist/ghost-calendar-header.d.ts +3 -0
- package/dist/ghost-calendar-header.js +9 -0
- package/dist/ghost-calendar-heading.d.ts +3 -0
- package/dist/ghost-calendar-heading.js +9 -0
- package/dist/ghost-calendar-next-button.d.ts +9 -0
- package/dist/ghost-calendar-next-button.js +18 -0
- package/dist/ghost-calendar-prev-button.d.ts +9 -0
- package/dist/ghost-calendar-prev-button.js +18 -0
- package/dist/ghost-calendar.d.ts +119 -0
- package/dist/ghost-calendar.js +101 -0
- package/dist/ghost-card.d.ts +33 -0
- package/dist/ghost-card.js +36 -0
- package/dist/ghost-checkbox.d.ts +76 -0
- package/dist/ghost-checkbox.js +59 -0
- package/dist/ghost-collapsible-content.d.ts +28 -0
- package/dist/ghost-collapsible-content.js +41 -0
- package/dist/ghost-collapsible-trigger.d.ts +28 -0
- package/dist/ghost-collapsible-trigger.js +41 -0
- package/dist/ghost-collapsible.d.ts +44 -0
- package/dist/ghost-collapsible.js +38 -0
- package/dist/ghost-combobox-content.d.ts +82 -0
- package/dist/ghost-combobox-content.js +58 -0
- package/dist/ghost-combobox-input.d.ts +28 -0
- package/dist/ghost-combobox-input.js +36 -0
- package/dist/ghost-combobox-trigger.d.ts +28 -0
- package/dist/ghost-combobox-trigger.js +36 -0
- package/dist/ghost-combobox.d.ts +179 -0
- package/dist/ghost-combobox.js +98 -0
- package/dist/ghost-command-palette-content.d.ts +86 -0
- package/dist/ghost-command-palette-content.js +55 -0
- package/dist/ghost-command-palette-overlay.d.ts +40 -0
- package/dist/ghost-command-palette-overlay.js +40 -0
- package/dist/ghost-command-palette.d.ts +114 -0
- package/dist/ghost-command-palette.js +93 -0
- package/dist/ghost-context-menu-checkbox-item.d.ts +50 -0
- package/dist/ghost-context-menu-checkbox-item.js +57 -0
- package/dist/ghost-context-menu-content.d.ts +85 -0
- package/dist/ghost-context-menu-content.js +75 -0
- package/dist/ghost-context-menu-group.d.ts +19 -0
- package/dist/ghost-context-menu-group.js +23 -0
- package/dist/ghost-context-menu-item.d.ts +32 -0
- package/dist/ghost-context-menu-item.js +43 -0
- package/dist/ghost-context-menu-label.d.ts +19 -0
- package/dist/ghost-context-menu-label.js +23 -0
- package/dist/ghost-context-menu-radio-group.d.ts +50 -0
- package/dist/ghost-context-menu-radio-group.js +46 -0
- package/dist/ghost-context-menu-radio-item.d.ts +40 -0
- package/dist/ghost-context-menu-radio-item.js +53 -0
- package/dist/ghost-context-menu-separator.d.ts +28 -0
- package/dist/ghost-context-menu-separator.js +28 -0
- package/dist/ghost-context-menu-trigger.d.ts +28 -0
- package/dist/ghost-context-menu-trigger.js +41 -0
- package/dist/ghost-context-menu.d.ts +35 -0
- package/dist/ghost-context-menu.js +33 -0
- package/dist/ghost-data-table-preset.d.ts +31 -0
- package/dist/ghost-data-table-preset.js +12 -0
- package/dist/ghost-data-table-table.d.ts +30 -0
- package/dist/ghost-data-table-table.js +9 -0
- package/dist/ghost-data-table.d.ts +94 -0
- package/dist/ghost-data-table.js +105 -0
- package/dist/ghost-date-picker-calendar.d.ts +9 -0
- package/dist/ghost-date-picker-calendar.js +30 -0
- package/dist/ghost-date-picker-content.d.ts +95 -0
- package/dist/ghost-date-picker-content.js +58 -0
- package/dist/ghost-date-picker-input.d.ts +46 -0
- package/dist/ghost-date-picker-input.js +39 -0
- package/dist/ghost-date-picker-trigger.d.ts +6 -0
- package/dist/ghost-date-picker-trigger.js +22 -0
- package/dist/ghost-date-picker.d.ts +245 -0
- package/dist/ghost-date-picker.js +68 -0
- package/dist/ghost-dialog-close.d.ts +28 -0
- package/dist/ghost-dialog-close.js +37 -0
- package/dist/ghost-dialog-content.d.ts +95 -0
- package/dist/ghost-dialog-content.js +78 -0
- package/dist/ghost-dialog-description.d.ts +19 -0
- package/dist/ghost-dialog-description.js +37 -0
- package/dist/ghost-dialog-overlay.d.ts +40 -0
- package/dist/ghost-dialog-overlay.js +46 -0
- package/dist/ghost-dialog-title.d.ts +19 -0
- package/dist/ghost-dialog-title.js +33 -0
- package/dist/ghost-dialog-trigger.d.ts +28 -0
- package/dist/ghost-dialog-trigger.js +37 -0
- package/dist/ghost-dialog.d.ts +44 -0
- package/dist/ghost-dialog.js +38 -0
- package/dist/ghost-drawer-close.d.ts +28 -0
- package/dist/ghost-drawer-close.js +37 -0
- package/dist/ghost-drawer-content.d.ts +87 -0
- package/dist/ghost-drawer-content.js +73 -0
- package/dist/ghost-drawer-description.d.ts +19 -0
- package/dist/ghost-drawer-description.js +36 -0
- package/dist/ghost-drawer-overlay.d.ts +40 -0
- package/dist/ghost-drawer-overlay.js +46 -0
- package/dist/ghost-drawer-title.d.ts +19 -0
- package/dist/ghost-drawer-title.js +32 -0
- package/dist/ghost-drawer-trigger.d.ts +28 -0
- package/dist/ghost-drawer-trigger.js +37 -0
- package/dist/ghost-drawer.d.ts +62 -0
- package/dist/ghost-drawer.js +48 -0
- package/dist/ghost-dropdown-menu-checkbox-item.d.ts +50 -0
- package/dist/ghost-dropdown-menu-checkbox-item.js +57 -0
- package/dist/ghost-dropdown-menu-content.d.ts +85 -0
- package/dist/ghost-dropdown-menu-content.js +75 -0
- package/dist/ghost-dropdown-menu-group.d.ts +19 -0
- package/dist/ghost-dropdown-menu-group.js +23 -0
- package/dist/ghost-dropdown-menu-item.d.ts +32 -0
- package/dist/ghost-dropdown-menu-item.js +47 -0
- package/dist/ghost-dropdown-menu-label.d.ts +19 -0
- package/dist/ghost-dropdown-menu-label.js +23 -0
- package/dist/ghost-dropdown-menu-radio-group.d.ts +50 -0
- package/dist/ghost-dropdown-menu-radio-group.js +46 -0
- package/dist/ghost-dropdown-menu-radio-item.d.ts +40 -0
- package/dist/ghost-dropdown-menu-radio-item.js +53 -0
- package/dist/ghost-dropdown-menu-separator.d.ts +28 -0
- package/dist/ghost-dropdown-menu-separator.js +28 -0
- package/dist/ghost-dropdown-menu-trigger.d.ts +28 -0
- package/dist/ghost-dropdown-menu-trigger.js +41 -0
- package/dist/ghost-dropdown-menu.d.ts +35 -0
- package/dist/ghost-dropdown-menu.js +33 -0
- package/dist/ghost-empty-state.d.ts +31 -0
- package/dist/ghost-empty-state.js +35 -0
- package/dist/ghost-field.d.ts +44 -0
- package/dist/ghost-field.js +44 -0
- package/dist/ghost-file-upload-dropzone.d.ts +9 -0
- package/dist/ghost-file-upload-dropzone.js +23 -0
- package/dist/ghost-file-upload-item-remove.d.ts +10 -0
- package/dist/ghost-file-upload-item-remove.js +30 -0
- package/dist/ghost-file-upload-list.d.ts +10 -0
- package/dist/ghost-file-upload-list.js +24 -0
- package/dist/ghost-file-upload-trigger.d.ts +18 -0
- package/dist/ghost-file-upload-trigger.js +30 -0
- package/dist/ghost-file-upload.d.ts +147 -0
- package/dist/ghost-file-upload.js +98 -0
- package/dist/ghost-hover-card-content.d.ts +85 -0
- package/dist/ghost-hover-card-content.js +75 -0
- package/dist/ghost-hover-card-trigger.d.ts +28 -0
- package/dist/ghost-hover-card-trigger.js +41 -0
- package/dist/ghost-hover-card.d.ts +62 -0
- package/dist/ghost-hover-card.js +48 -0
- package/dist/ghost-inline-alert.d.ts +62 -0
- package/dist/ghost-inline-alert.js +50 -0
- package/dist/ghost-input.d.ts +100 -0
- package/dist/ghost-input.js +60 -0
- package/dist/ghost-interactive-surface.d.ts +31 -0
- package/dist/ghost-interactive-surface.js +36 -0
- package/dist/ghost-kbd.d.ts +42 -0
- package/dist/ghost-kbd.js +32 -0
- package/dist/ghost-link.d.ts +94 -0
- package/dist/ghost-link.js +59 -0
- package/dist/ghost-menubar-checkbox-item.d.ts +50 -0
- package/dist/ghost-menubar-checkbox-item.js +57 -0
- package/dist/ghost-menubar-content.d.ts +85 -0
- package/dist/ghost-menubar-content.js +71 -0
- package/dist/ghost-menubar-group.d.ts +19 -0
- package/dist/ghost-menubar-group.js +19 -0
- package/dist/ghost-menubar-item.d.ts +32 -0
- package/dist/ghost-menubar-item.js +43 -0
- package/dist/ghost-menubar-label.d.ts +19 -0
- package/dist/ghost-menubar-label.js +19 -0
- package/dist/ghost-menubar-menu.d.ts +35 -0
- package/dist/ghost-menubar-menu.js +33 -0
- package/dist/ghost-menubar-radio-group.d.ts +50 -0
- package/dist/ghost-menubar-radio-group.js +46 -0
- package/dist/ghost-menubar-radio-item.d.ts +40 -0
- package/dist/ghost-menubar-radio-item.js +53 -0
- package/dist/ghost-menubar-separator.d.ts +28 -0
- package/dist/ghost-menubar-separator.js +28 -0
- package/dist/ghost-menubar-trigger.d.ts +28 -0
- package/dist/ghost-menubar-trigger.js +37 -0
- package/dist/ghost-menubar.d.ts +28 -0
- package/dist/ghost-menubar.js +33 -0
- package/dist/ghost-number-input.d.ts +153 -0
- package/dist/ghost-number-input.js +87 -0
- package/dist/ghost-pagination.d.ts +151 -0
- package/dist/ghost-pagination.js +71 -0
- package/dist/ghost-popover-close.d.ts +28 -0
- package/dist/ghost-popover-close.js +37 -0
- package/dist/ghost-popover-content.d.ts +86 -0
- package/dist/ghost-popover-content.js +72 -0
- package/dist/ghost-popover-trigger.d.ts +28 -0
- package/dist/ghost-popover-trigger.js +37 -0
- package/dist/ghost-popover.d.ts +35 -0
- package/dist/ghost-popover.js +33 -0
- package/dist/ghost-progress.d.ts +69 -0
- package/dist/ghost-progress.js +37 -0
- package/dist/ghost-radio-group-item.d.ts +37 -0
- package/dist/ghost-radio-group-item.js +33 -0
- package/dist/ghost-radio-group.d.ts +91 -0
- package/dist/ghost-radio-group.js +65 -0
- package/dist/ghost-scroll-area.d.ts +49 -0
- package/dist/ghost-scroll-area.js +32 -0
- package/dist/ghost-scroll-spy-item.d.ts +27 -0
- package/dist/ghost-scroll-spy-item.js +29 -0
- package/dist/ghost-scroll-spy-link.d.ts +44 -0
- package/dist/ghost-scroll-spy-link.js +39 -0
- package/dist/ghost-scroll-spy-list.d.ts +18 -0
- package/dist/ghost-scroll-spy-list.js +27 -0
- package/dist/ghost-scroll-spy.d.ts +121 -0
- package/dist/ghost-scroll-spy.js +83 -0
- package/dist/ghost-segmented-control-item.d.ts +36 -0
- package/dist/ghost-segmented-control-item.js +47 -0
- package/dist/ghost-segmented-control.d.ts +77 -0
- package/dist/ghost-segmented-control.js +73 -0
- package/dist/ghost-select-content.d.ts +82 -0
- package/dist/ghost-select-content.js +58 -0
- package/dist/ghost-select-trigger.d.ts +28 -0
- package/dist/ghost-select-trigger.js +36 -0
- package/dist/ghost-select.d.ts +115 -0
- package/dist/ghost-select.js +74 -0
- package/dist/ghost-separator.d.ts +41 -0
- package/dist/ghost-separator.js +34 -0
- package/dist/ghost-skeleton.d.ts +34 -0
- package/dist/ghost-skeleton.js +31 -0
- package/dist/ghost-slider.d.ts +150 -0
- package/dist/ghost-slider.js +83 -0
- package/dist/ghost-spinner.d.ts +42 -0
- package/dist/ghost-spinner.js +26 -0
- package/dist/ghost-switch.d.ts +102 -0
- package/dist/ghost-switch.js +68 -0
- package/dist/ghost-table.d.ts +30 -0
- package/dist/ghost-table.js +36 -0
- package/dist/ghost-tabs-content.d.ts +27 -0
- package/dist/ghost-tabs-content.js +38 -0
- package/dist/ghost-tabs-list.d.ts +19 -0
- package/dist/ghost-tabs-list.js +33 -0
- package/dist/ghost-tabs-trigger.d.ts +36 -0
- package/dist/ghost-tabs-trigger.js +43 -0
- package/dist/ghost-tabs.d.ts +59 -0
- package/dist/ghost-tabs.js +45 -0
- package/dist/ghost-textarea.d.ts +109 -0
- package/dist/ghost-textarea.js +66 -0
- package/dist/ghost-toast-viewport.d.ts +43 -0
- package/dist/ghost-toast-viewport.js +74 -0
- package/dist/ghost-toast.d.ts +54 -0
- package/dist/ghost-toast.js +48 -0
- package/dist/ghost-toggle-group-item.d.ts +36 -0
- package/dist/ghost-toggle-group-item.js +43 -0
- package/dist/ghost-toggle-group.d.ts +77 -0
- package/dist/ghost-toggle-group.js +69 -0
- package/dist/ghost-toolbar.d.ts +6 -0
- package/dist/ghost-toolbar.js +24 -0
- package/dist/ghost-tooltip-content.d.ts +86 -0
- package/dist/ghost-tooltip-content.js +72 -0
- package/dist/ghost-tooltip-trigger.d.ts +28 -0
- package/dist/ghost-tooltip-trigger.js +37 -0
- package/dist/ghost-tooltip.d.ts +62 -0
- package/dist/ghost-tooltip.js +50 -0
- package/dist/ghost-tree-group.d.ts +32 -0
- package/dist/ghost-tree-group.js +39 -0
- package/dist/ghost-tree-item.d.ts +45 -0
- package/dist/ghost-tree-item.js +42 -0
- package/dist/ghost-tree-trigger.d.ts +40 -0
- package/dist/ghost-tree-trigger.js +43 -0
- package/dist/ghost-tree.d.ts +122 -0
- package/dist/ghost-tree.js +98 -0
- package/dist/index.d.ts +148 -0
- package/dist/index.js +144 -0
- package/dist/manifest.json +6375 -0
- package/dist/mono.css +1864 -0
- package/dist/recipes/accordion.css +42 -0
- package/dist/recipes/avatar.css +87 -0
- package/dist/recipes/badge.css +170 -0
- package/dist/recipes/breadcrumb.css +149 -0
- package/dist/recipes/button.css +632 -0
- package/dist/recipes/calendar.css +292 -0
- package/dist/recipes/card.css +54 -0
- package/dist/recipes/checkbox.css +262 -0
- package/dist/recipes/collapsible.css +304 -0
- package/dist/recipes/combobox.css +276 -0
- package/dist/recipes/command-palette.css +244 -0
- package/dist/recipes/context-menu.css +227 -0
- package/dist/recipes/data-table.css +455 -0
- package/dist/recipes/date-picker.css +292 -0
- package/dist/recipes/dialog.css +141 -0
- package/dist/recipes/drawer.css +338 -0
- package/dist/recipes/dropdown-menu.css +232 -0
- package/dist/recipes/empty-state.css +66 -0
- package/dist/recipes/field.css +63 -0
- package/dist/recipes/file-upload.css +260 -0
- package/dist/recipes/hover-card.css +64 -0
- package/dist/recipes/inline-alert.css +172 -0
- package/dist/recipes/input.css +176 -0
- package/dist/recipes/kbd.css +113 -0
- package/dist/recipes/link.css +158 -0
- package/dist/recipes/menubar.css +242 -0
- package/dist/recipes/number-input.css +222 -0
- package/dist/recipes/pagination.css +143 -0
- package/dist/recipes/popover.css +83 -0
- package/dist/recipes/progress.css +119 -0
- package/dist/recipes/radio-group.css +200 -0
- package/dist/recipes/scroll-area.css +31 -0
- package/dist/recipes/scroll-spy.css +72 -0
- package/dist/recipes/segmented-control.css +178 -0
- package/dist/recipes/select.css +299 -0
- package/dist/recipes/separator.css +41 -0
- package/dist/recipes/skeleton.css +132 -0
- package/dist/recipes/slider.css +239 -0
- package/dist/recipes/spinner.css +93 -0
- package/dist/recipes/switch.css +314 -0
- package/dist/recipes/table.css +120 -0
- package/dist/recipes/tabs.css +139 -0
- package/dist/recipes/textarea.css +148 -0
- package/dist/recipes/toast.css +321 -0
- package/dist/recipes/toggle-group.css +92 -0
- package/dist/recipes/toolbar.css +25 -0
- package/dist/recipes/tooltip.css +48 -0
- package/dist/recipes/tree.css +231 -0
- package/dist/start-theme-transition.d.ts +9 -0
- package/dist/start-theme-transition.js +27 -0
- package/dist/tokens/primitives.json +612 -0
- package/dist/tokens/seeds.json +23 -0
- package/dist/tokens/semantic.compact.json +175 -0
- package/dist/tokens/semantic.dark.json +583 -0
- package/dist/tokens/semantic.json +1651 -0
- package/dist/tokens/semantic.spacious.json +175 -0
- package/dist/tokens.css +1864 -0
- package/dist/tokens.json +6137 -0
- package/dist/vibrant.css +1864 -0
- package/package.json +75 -4
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type GhostMenubarRadioGroupElement } from '@ghostvue/vue';
|
|
3
|
+
/** Themed {@link GhostMenubarRadioGroup} wrapper. */
|
|
4
|
+
export declare const GhostMenubarRadioGroup: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
as: {
|
|
6
|
+
type: PropType<GhostMenubarRadioGroupElement>;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
modelValue: {
|
|
10
|
+
type: PropType<string | undefined>;
|
|
11
|
+
default: undefined;
|
|
12
|
+
};
|
|
13
|
+
defaultValue: {
|
|
14
|
+
type: PropType<string | undefined>;
|
|
15
|
+
default: undefined;
|
|
16
|
+
};
|
|
17
|
+
disabled: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
21
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
24
|
+
'update:modelValue': (value: string) => boolean;
|
|
25
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
26
|
+
as: {
|
|
27
|
+
type: PropType<GhostMenubarRadioGroupElement>;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
modelValue: {
|
|
31
|
+
type: PropType<string | undefined>;
|
|
32
|
+
default: undefined;
|
|
33
|
+
};
|
|
34
|
+
defaultValue: {
|
|
35
|
+
type: PropType<string | undefined>;
|
|
36
|
+
default: undefined;
|
|
37
|
+
};
|
|
38
|
+
disabled: {
|
|
39
|
+
type: BooleanConstructor;
|
|
40
|
+
default: boolean;
|
|
41
|
+
};
|
|
42
|
+
}>> & Readonly<{
|
|
43
|
+
"onUpdate:modelValue"?: (value: string) => any;
|
|
44
|
+
}>, {
|
|
45
|
+
as: GhostMenubarRadioGroupElement;
|
|
46
|
+
disabled: boolean;
|
|
47
|
+
modelValue: string | undefined;
|
|
48
|
+
defaultValue: string | undefined;
|
|
49
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
50
|
+
export type { GhostMenubarRadioGroupElement };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineComponent, h } from 'vue';
|
|
2
|
+
import { GhostMenubarRadioGroup as GhostUnstyledMenubarRadioGroup, } from '@ghostvue/vue';
|
|
3
|
+
/** Themed {@link GhostMenubarRadioGroup} wrapper. */
|
|
4
|
+
export const GhostMenubarRadioGroup = defineComponent({
|
|
5
|
+
name: 'GhostMenubarRadioGroup',
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
props: {
|
|
8
|
+
as: {
|
|
9
|
+
type: [
|
|
10
|
+
String,
|
|
11
|
+
Object,
|
|
12
|
+
Function,
|
|
13
|
+
],
|
|
14
|
+
default: 'div',
|
|
15
|
+
},
|
|
16
|
+
modelValue: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: undefined,
|
|
19
|
+
},
|
|
20
|
+
defaultValue: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: undefined,
|
|
23
|
+
},
|
|
24
|
+
disabled: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
emits: {
|
|
30
|
+
'update:modelValue': (value) => typeof value === 'string',
|
|
31
|
+
},
|
|
32
|
+
setup(props, { attrs, slots, emit }) {
|
|
33
|
+
return () => h(GhostUnstyledMenubarRadioGroup, {
|
|
34
|
+
...attrs,
|
|
35
|
+
as: props.as,
|
|
36
|
+
...(props.modelValue !== undefined
|
|
37
|
+
? { modelValue: props.modelValue }
|
|
38
|
+
: {}),
|
|
39
|
+
defaultValue: props.defaultValue,
|
|
40
|
+
disabled: props.disabled,
|
|
41
|
+
'onUpdate:modelValue': (value) => {
|
|
42
|
+
emit('update:modelValue', value);
|
|
43
|
+
},
|
|
44
|
+
}, slots);
|
|
45
|
+
},
|
|
46
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type GhostMenubarRadioItemElement, type GhostMenubarRadioItemExposed } from '@ghostvue/vue';
|
|
3
|
+
/** Themed {@link GhostMenubarRadioItem} wrapper. */
|
|
4
|
+
export declare const GhostMenubarRadioItem: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
as: {
|
|
6
|
+
type: PropType<GhostMenubarRadioItemElement>;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
value: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
disabled: {
|
|
14
|
+
type: BooleanConstructor;
|
|
15
|
+
default: boolean;
|
|
16
|
+
};
|
|
17
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
select: (value: string, event: Event) => boolean;
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
+
as: {
|
|
23
|
+
type: PropType<GhostMenubarRadioItemElement>;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
value: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
disabled: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
34
|
+
}>> & Readonly<{
|
|
35
|
+
onSelect?: (value: string, event: Event) => any;
|
|
36
|
+
}>, {
|
|
37
|
+
as: GhostMenubarRadioItemElement;
|
|
38
|
+
disabled: boolean;
|
|
39
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
40
|
+
export type { GhostMenubarRadioItemElement, GhostMenubarRadioItemExposed };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineComponent, h, ref } from 'vue';
|
|
2
|
+
import { GhostMenubarRadioItem as GhostUnstyledMenubarRadioItem, } from '@ghostvue/vue';
|
|
3
|
+
/** Themed {@link GhostMenubarRadioItem} wrapper. */
|
|
4
|
+
export const GhostMenubarRadioItem = defineComponent({
|
|
5
|
+
name: 'GhostMenubarRadioItem',
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
props: {
|
|
8
|
+
as: {
|
|
9
|
+
type: [
|
|
10
|
+
String,
|
|
11
|
+
Object,
|
|
12
|
+
Function,
|
|
13
|
+
],
|
|
14
|
+
default: 'div',
|
|
15
|
+
},
|
|
16
|
+
value: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
disabled: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
emits: {
|
|
26
|
+
select: (value, event) => typeof value === 'string' && event instanceof Event,
|
|
27
|
+
},
|
|
28
|
+
setup(props, { attrs, slots, emit, expose }) {
|
|
29
|
+
const inner = ref(null);
|
|
30
|
+
expose({
|
|
31
|
+
get element() {
|
|
32
|
+
return inner.value?.element ?? null;
|
|
33
|
+
},
|
|
34
|
+
focus(options) {
|
|
35
|
+
inner.value?.focus(options);
|
|
36
|
+
},
|
|
37
|
+
blur() {
|
|
38
|
+
inner.value?.blur();
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
const UnstyledRadioItem = GhostUnstyledMenubarRadioItem;
|
|
42
|
+
return () => h(UnstyledRadioItem, {
|
|
43
|
+
...attrs,
|
|
44
|
+
ref: inner,
|
|
45
|
+
as: props.as,
|
|
46
|
+
value: props.value,
|
|
47
|
+
disabled: props.disabled,
|
|
48
|
+
onSelect: (value, event) => {
|
|
49
|
+
emit('select', value, event);
|
|
50
|
+
},
|
|
51
|
+
}, slots);
|
|
52
|
+
},
|
|
53
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type GhostMenubarSeparatorElement } from '@ghostvue/vue';
|
|
3
|
+
/** Themed {@link GhostMenubarSeparator} wrapper. */
|
|
4
|
+
export declare const GhostMenubarSeparator: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
as: {
|
|
6
|
+
type: PropType<GhostMenubarSeparatorElement>;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
decorative: {
|
|
10
|
+
type: BooleanConstructor;
|
|
11
|
+
default: boolean;
|
|
12
|
+
};
|
|
13
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
|
+
as: {
|
|
17
|
+
type: PropType<GhostMenubarSeparatorElement>;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
decorative: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
}>> & Readonly<{}>, {
|
|
25
|
+
as: GhostMenubarSeparatorElement;
|
|
26
|
+
decorative: boolean;
|
|
27
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
28
|
+
export type { GhostMenubarSeparatorElement };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineComponent, h } from 'vue';
|
|
2
|
+
import { GhostMenubarSeparator as GhostUnstyledMenubarSeparator, } from '@ghostvue/vue';
|
|
3
|
+
/** Themed {@link GhostMenubarSeparator} wrapper. */
|
|
4
|
+
export const GhostMenubarSeparator = defineComponent({
|
|
5
|
+
name: 'GhostMenubarSeparator',
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
props: {
|
|
8
|
+
as: {
|
|
9
|
+
type: [
|
|
10
|
+
String,
|
|
11
|
+
Object,
|
|
12
|
+
Function,
|
|
13
|
+
],
|
|
14
|
+
default: 'div',
|
|
15
|
+
},
|
|
16
|
+
decorative: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
setup(props, { attrs }) {
|
|
22
|
+
return () => h(GhostUnstyledMenubarSeparator, {
|
|
23
|
+
...attrs,
|
|
24
|
+
as: props.as,
|
|
25
|
+
decorative: props.decorative,
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type GhostMenubarTriggerElement, type GhostMenubarTriggerExposed } from '@ghostvue/vue';
|
|
3
|
+
/** Themed {@link GhostMenubarTrigger} wrapper. */
|
|
4
|
+
export declare const GhostMenubarTrigger: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
as: {
|
|
6
|
+
type: PropType<GhostMenubarTriggerElement>;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
disabled: {
|
|
10
|
+
type: BooleanConstructor;
|
|
11
|
+
default: boolean;
|
|
12
|
+
};
|
|
13
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
|
+
as: {
|
|
17
|
+
type: PropType<GhostMenubarTriggerElement>;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
disabled: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
}>> & Readonly<{}>, {
|
|
25
|
+
as: GhostMenubarTriggerElement;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
28
|
+
export type { GhostMenubarTriggerElement, GhostMenubarTriggerExposed };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineComponent, h, ref } from 'vue';
|
|
2
|
+
import { GhostMenubarTrigger as GhostUnstyledMenubarTrigger, } from '@ghostvue/vue';
|
|
3
|
+
/** Themed {@link GhostMenubarTrigger} wrapper. */
|
|
4
|
+
export const GhostMenubarTrigger = defineComponent({
|
|
5
|
+
name: 'GhostMenubarTrigger',
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
props: {
|
|
8
|
+
as: {
|
|
9
|
+
type: [String, Object, Function],
|
|
10
|
+
default: 'button',
|
|
11
|
+
},
|
|
12
|
+
disabled: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: false,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
setup(props, { attrs, slots, expose }) {
|
|
18
|
+
const inner = ref(null);
|
|
19
|
+
expose({
|
|
20
|
+
get element() {
|
|
21
|
+
return inner.value?.element ?? null;
|
|
22
|
+
},
|
|
23
|
+
focus(options) {
|
|
24
|
+
inner.value?.focus(options);
|
|
25
|
+
},
|
|
26
|
+
blur() {
|
|
27
|
+
inner.value?.blur();
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
return () => h(GhostUnstyledMenubarTrigger, {
|
|
31
|
+
...attrs,
|
|
32
|
+
ref: inner,
|
|
33
|
+
as: props.as,
|
|
34
|
+
disabled: props.disabled,
|
|
35
|
+
}, slots);
|
|
36
|
+
},
|
|
37
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type GhostMenubarExposed, type GhostMenubarProps } from '@ghostvue/vue';
|
|
3
|
+
/** Themed {@link GhostMenubar} root wrapper. */
|
|
4
|
+
export declare const GhostMenubar: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
as: {
|
|
6
|
+
type: PropType<NonNullable<GhostMenubarProps["as"]>>;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
dir: {
|
|
10
|
+
type: PropType<GhostMenubarProps["dir"]>;
|
|
11
|
+
default: undefined;
|
|
12
|
+
};
|
|
13
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
|
+
as: {
|
|
17
|
+
type: PropType<NonNullable<GhostMenubarProps["as"]>>;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
dir: {
|
|
21
|
+
type: PropType<GhostMenubarProps["dir"]>;
|
|
22
|
+
default: undefined;
|
|
23
|
+
};
|
|
24
|
+
}>> & Readonly<{}>, {
|
|
25
|
+
as: NonNullable<import("@ghostvue/vue").GhostMenubarElement | undefined>;
|
|
26
|
+
dir: "ltr" | "rtl" | undefined;
|
|
27
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
28
|
+
export type { GhostMenubarExposed, GhostMenubarProps };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineComponent, h, ref } from 'vue';
|
|
2
|
+
import { GhostMenubar as GhostUnstyledMenubar, } from '@ghostvue/vue';
|
|
3
|
+
/** Themed {@link GhostMenubar} root wrapper. */
|
|
4
|
+
export const GhostMenubar = defineComponent({
|
|
5
|
+
name: 'GhostMenubar',
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
props: {
|
|
8
|
+
as: {
|
|
9
|
+
type: [String, Object, Function],
|
|
10
|
+
default: 'div',
|
|
11
|
+
},
|
|
12
|
+
dir: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: undefined,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
setup(props, { attrs, slots, expose }) {
|
|
18
|
+
const inner = ref(null);
|
|
19
|
+
expose({
|
|
20
|
+
get element() {
|
|
21
|
+
return inner.value?.element ?? null;
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
return () => h('span', { class: 'ghost-themed-scope' }, [
|
|
25
|
+
h(GhostUnstyledMenubar, {
|
|
26
|
+
...attrs,
|
|
27
|
+
ref: inner,
|
|
28
|
+
as: props.as,
|
|
29
|
+
dir: props.dir,
|
|
30
|
+
}, slots),
|
|
31
|
+
]);
|
|
32
|
+
},
|
|
33
|
+
});
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type GhostNumberInputExposed, type GhostNumberInputFormatOptions } from '@ghostvue/vue';
|
|
3
|
+
import type { GhostInputSize } from './ghost-input.js';
|
|
4
|
+
/**
|
|
5
|
+
* Themed numeric spinbutton: visual `data-*` on the root, behavior on the
|
|
6
|
+
* unstyled primitive.
|
|
7
|
+
*/
|
|
8
|
+
export declare const GhostNumberInput: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
9
|
+
modelValue: {
|
|
10
|
+
type: PropType<number | null | undefined>;
|
|
11
|
+
default: undefined;
|
|
12
|
+
};
|
|
13
|
+
defaultValue: {
|
|
14
|
+
type: PropType<number | null>;
|
|
15
|
+
default: null;
|
|
16
|
+
};
|
|
17
|
+
min: {
|
|
18
|
+
type: NumberConstructor;
|
|
19
|
+
default: undefined;
|
|
20
|
+
};
|
|
21
|
+
max: {
|
|
22
|
+
type: NumberConstructor;
|
|
23
|
+
default: undefined;
|
|
24
|
+
};
|
|
25
|
+
step: {
|
|
26
|
+
type: NumberConstructor;
|
|
27
|
+
default: number;
|
|
28
|
+
};
|
|
29
|
+
locale: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
default: undefined;
|
|
32
|
+
};
|
|
33
|
+
formatOptions: {
|
|
34
|
+
type: PropType<GhostNumberInputFormatOptions>;
|
|
35
|
+
default: undefined;
|
|
36
|
+
};
|
|
37
|
+
disabled: {
|
|
38
|
+
type: BooleanConstructor;
|
|
39
|
+
default: boolean;
|
|
40
|
+
};
|
|
41
|
+
readonly: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
default: boolean;
|
|
44
|
+
};
|
|
45
|
+
invalid: {
|
|
46
|
+
type: BooleanConstructor;
|
|
47
|
+
default: boolean;
|
|
48
|
+
};
|
|
49
|
+
required: {
|
|
50
|
+
type: BooleanConstructor;
|
|
51
|
+
default: boolean;
|
|
52
|
+
};
|
|
53
|
+
decrementLabel: {
|
|
54
|
+
type: StringConstructor;
|
|
55
|
+
default: string;
|
|
56
|
+
};
|
|
57
|
+
incrementLabel: {
|
|
58
|
+
type: StringConstructor;
|
|
59
|
+
default: string;
|
|
60
|
+
};
|
|
61
|
+
size: {
|
|
62
|
+
type: PropType<GhostInputSize>;
|
|
63
|
+
default: string;
|
|
64
|
+
};
|
|
65
|
+
block: {
|
|
66
|
+
type: BooleanConstructor;
|
|
67
|
+
default: boolean;
|
|
68
|
+
};
|
|
69
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
70
|
+
[key: string]: any;
|
|
71
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
72
|
+
'update:modelValue': (value: number | null) => boolean;
|
|
73
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
74
|
+
modelValue: {
|
|
75
|
+
type: PropType<number | null | undefined>;
|
|
76
|
+
default: undefined;
|
|
77
|
+
};
|
|
78
|
+
defaultValue: {
|
|
79
|
+
type: PropType<number | null>;
|
|
80
|
+
default: null;
|
|
81
|
+
};
|
|
82
|
+
min: {
|
|
83
|
+
type: NumberConstructor;
|
|
84
|
+
default: undefined;
|
|
85
|
+
};
|
|
86
|
+
max: {
|
|
87
|
+
type: NumberConstructor;
|
|
88
|
+
default: undefined;
|
|
89
|
+
};
|
|
90
|
+
step: {
|
|
91
|
+
type: NumberConstructor;
|
|
92
|
+
default: number;
|
|
93
|
+
};
|
|
94
|
+
locale: {
|
|
95
|
+
type: StringConstructor;
|
|
96
|
+
default: undefined;
|
|
97
|
+
};
|
|
98
|
+
formatOptions: {
|
|
99
|
+
type: PropType<GhostNumberInputFormatOptions>;
|
|
100
|
+
default: undefined;
|
|
101
|
+
};
|
|
102
|
+
disabled: {
|
|
103
|
+
type: BooleanConstructor;
|
|
104
|
+
default: boolean;
|
|
105
|
+
};
|
|
106
|
+
readonly: {
|
|
107
|
+
type: BooleanConstructor;
|
|
108
|
+
default: boolean;
|
|
109
|
+
};
|
|
110
|
+
invalid: {
|
|
111
|
+
type: BooleanConstructor;
|
|
112
|
+
default: boolean;
|
|
113
|
+
};
|
|
114
|
+
required: {
|
|
115
|
+
type: BooleanConstructor;
|
|
116
|
+
default: boolean;
|
|
117
|
+
};
|
|
118
|
+
decrementLabel: {
|
|
119
|
+
type: StringConstructor;
|
|
120
|
+
default: string;
|
|
121
|
+
};
|
|
122
|
+
incrementLabel: {
|
|
123
|
+
type: StringConstructor;
|
|
124
|
+
default: string;
|
|
125
|
+
};
|
|
126
|
+
size: {
|
|
127
|
+
type: PropType<GhostInputSize>;
|
|
128
|
+
default: string;
|
|
129
|
+
};
|
|
130
|
+
block: {
|
|
131
|
+
type: BooleanConstructor;
|
|
132
|
+
default: boolean;
|
|
133
|
+
};
|
|
134
|
+
}>> & Readonly<{
|
|
135
|
+
"onUpdate:modelValue"?: (value: number | null) => any;
|
|
136
|
+
}>, {
|
|
137
|
+
invalid: boolean;
|
|
138
|
+
size: GhostInputSize;
|
|
139
|
+
required: boolean;
|
|
140
|
+
disabled: boolean;
|
|
141
|
+
modelValue: number | null | undefined;
|
|
142
|
+
defaultValue: number | null;
|
|
143
|
+
block: boolean;
|
|
144
|
+
locale: string;
|
|
145
|
+
readonly: boolean;
|
|
146
|
+
min: number;
|
|
147
|
+
max: number;
|
|
148
|
+
step: number;
|
|
149
|
+
formatOptions: Intl.NumberFormatOptions;
|
|
150
|
+
decrementLabel: string;
|
|
151
|
+
incrementLabel: string;
|
|
152
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
153
|
+
export type { GhostNumberInputExposed, GhostNumberInputFormatOptions };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { defineComponent, h, ref } from 'vue';
|
|
2
|
+
import { GhostNumberInput as GhostUnstyledNumberInput, } from '@ghostvue/vue';
|
|
3
|
+
/**
|
|
4
|
+
* Themed numeric spinbutton: visual `data-*` on the root, behavior on the
|
|
5
|
+
* unstyled primitive.
|
|
6
|
+
*/
|
|
7
|
+
export const GhostNumberInput = defineComponent({
|
|
8
|
+
name: 'GhostNumberInput',
|
|
9
|
+
inheritAttrs: false,
|
|
10
|
+
props: {
|
|
11
|
+
modelValue: {
|
|
12
|
+
type: Number,
|
|
13
|
+
default: undefined,
|
|
14
|
+
},
|
|
15
|
+
defaultValue: {
|
|
16
|
+
type: Number,
|
|
17
|
+
default: null,
|
|
18
|
+
},
|
|
19
|
+
min: { type: Number, default: undefined },
|
|
20
|
+
max: { type: Number, default: undefined },
|
|
21
|
+
step: { type: Number, default: 1 },
|
|
22
|
+
locale: { type: String, default: undefined },
|
|
23
|
+
formatOptions: {
|
|
24
|
+
type: Object,
|
|
25
|
+
default: undefined,
|
|
26
|
+
},
|
|
27
|
+
disabled: { type: Boolean, default: false },
|
|
28
|
+
readonly: { type: Boolean, default: false },
|
|
29
|
+
invalid: { type: Boolean, default: false },
|
|
30
|
+
required: { type: Boolean, default: false },
|
|
31
|
+
decrementLabel: { type: String, default: 'Decrease' },
|
|
32
|
+
incrementLabel: { type: String, default: 'Increase' },
|
|
33
|
+
size: { type: String, default: 'md' },
|
|
34
|
+
block: { type: Boolean, default: false },
|
|
35
|
+
},
|
|
36
|
+
emits: {
|
|
37
|
+
'update:modelValue': (value) => value === null || typeof value === 'number',
|
|
38
|
+
},
|
|
39
|
+
setup(props, { attrs, emit, expose }) {
|
|
40
|
+
const inner = ref(null);
|
|
41
|
+
expose({
|
|
42
|
+
get element() {
|
|
43
|
+
return inner.value?.element ?? null;
|
|
44
|
+
},
|
|
45
|
+
focus(options) {
|
|
46
|
+
inner.value?.focus(options);
|
|
47
|
+
},
|
|
48
|
+
blur() {
|
|
49
|
+
inner.value?.blur();
|
|
50
|
+
},
|
|
51
|
+
increment() {
|
|
52
|
+
inner.value?.increment();
|
|
53
|
+
},
|
|
54
|
+
decrement() {
|
|
55
|
+
inner.value?.decrement();
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
return () => h('span', { class: 'ghost-themed-scope' }, [
|
|
59
|
+
h(GhostUnstyledNumberInput, {
|
|
60
|
+
...attrs,
|
|
61
|
+
ref: inner,
|
|
62
|
+
...(props.modelValue !== undefined
|
|
63
|
+
? { modelValue: props.modelValue }
|
|
64
|
+
: {}),
|
|
65
|
+
defaultValue: props.defaultValue,
|
|
66
|
+
...(props.min === undefined ? {} : { min: props.min }),
|
|
67
|
+
...(props.max === undefined ? {} : { max: props.max }),
|
|
68
|
+
step: props.step,
|
|
69
|
+
...(props.locale === undefined ? {} : { locale: props.locale }),
|
|
70
|
+
...(props.formatOptions === undefined
|
|
71
|
+
? {}
|
|
72
|
+
: { formatOptions: props.formatOptions }),
|
|
73
|
+
disabled: props.disabled,
|
|
74
|
+
readonly: props.readonly,
|
|
75
|
+
invalid: props.invalid,
|
|
76
|
+
required: props.required,
|
|
77
|
+
decrementLabel: props.decrementLabel,
|
|
78
|
+
incrementLabel: props.incrementLabel,
|
|
79
|
+
'onUpdate:modelValue': (value) => {
|
|
80
|
+
emit('update:modelValue', value);
|
|
81
|
+
},
|
|
82
|
+
'data-size': props.size === 'md' ? undefined : props.size,
|
|
83
|
+
'data-block': props.block ? '' : undefined,
|
|
84
|
+
}),
|
|
85
|
+
]);
|
|
86
|
+
},
|
|
87
|
+
});
|