@application-kit/ui 0.0.0-stage → 0.0.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 +21 -0
- package/README.md +41 -2
- package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
- package/dist/accent-color.d.ts +2 -0
- package/dist/accent-color.js +15 -0
- package/dist/components/avatar/Avatar.js +5 -0
- package/dist/components/avatar/Avatar.vue.d.ts +24 -0
- package/dist/components/avatar/Avatar.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/components/button/Button.js +5 -0
- package/dist/components/button/Button.vue.d.ts +130 -0
- package/dist/components/button/Button.vue_vue_type_script_setup_true_lang.js +104 -0
- package/dist/components/button/severity-to-vendor.d.ts +4 -0
- package/dist/components/button/severity-to-vendor.js +11 -0
- package/dist/components/card/Card.js +5 -0
- package/dist/components/card/Card.vue.d.ts +17 -0
- package/dist/components/card/Card.vue_vue_type_script_setup_true_lang.js +34 -0
- package/dist/components/confirm/ConfirmHost.js +5 -0
- package/dist/components/confirm/ConfirmHost.vue.d.ts +3 -0
- package/dist/components/confirm/ConfirmHost.vue_vue_type_script_setup_true_lang.js +13 -0
- package/dist/components/confirm/install-confirmation-service.d.ts +2 -0
- package/dist/components/confirm/install-confirmation-service.js +16 -0
- package/dist/components/date-range-filter/DateRangeFilter.js +7 -0
- package/dist/components/date-range-filter/DateRangeFilter.vue.d.ts +13 -0
- package/dist/components/date-range-filter/DateRangeFilter.vue_vue_type_script_setup_true_lang.js +121 -0
- package/dist/components/dialog/Dialog.js +5 -0
- package/dist/components/dialog/Dialog.vue.d.ts +56 -0
- package/dist/components/dialog/Dialog.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/components/drawer/Drawer.js +5 -0
- package/dist/components/drawer/Drawer.vue.d.ts +24 -0
- package/dist/components/drawer/Drawer.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/components/error-page/Error.js +7 -0
- package/dist/components/error-page/Error.vue.d.ts +62 -0
- package/dist/components/error-page/Error.vue_vue_type_script_setup_true_lang.js +93 -0
- package/dist/components/error-page/GradientBackground.js +7 -0
- package/dist/components/error-page/GradientBackground.vue.d.ts +17 -0
- package/dist/components/error-page/GradientBackground.vue_vue_type_script_setup_true_lang.js +54 -0
- package/dist/components/form/Checkbox.js +5 -0
- package/dist/components/form/Checkbox.vue.d.ts +16 -0
- package/dist/components/form/Checkbox.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/components/form/DateField.js +5 -0
- package/dist/components/form/DateField.vue.d.ts +24 -0
- package/dist/components/form/DateField.vue_vue_type_script_setup_true_lang.js +52 -0
- package/dist/components/form/DateRangeField.js +5 -0
- package/dist/components/form/DateRangeField.vue.d.ts +32 -0
- package/dist/components/form/DateRangeField.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/form/InputNumber.js +5 -0
- package/dist/components/form/InputNumber.vue.d.ts +17 -0
- package/dist/components/form/InputNumber.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/components/form/InputOtp.js +5 -0
- package/dist/components/form/InputOtp.vue.d.ts +20 -0
- package/dist/components/form/InputOtp.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/components/form/InputText.js +5 -0
- package/dist/components/form/InputText.vue.d.ts +17 -0
- package/dist/components/form/InputText.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/components/form/MultiSelect.js +5 -0
- package/dist/components/form/MultiSelect.vue.d.ts +34 -0
- package/dist/components/form/MultiSelect.vue_vue_type_script_setup_true_lang.js +47 -0
- package/dist/components/form/RadioButton.js +5 -0
- package/dist/components/form/RadioButton.vue.d.ts +27 -0
- package/dist/components/form/RadioButton.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/components/form/Select.js +5 -0
- package/dist/components/form/Select.vue.d.ts +41 -0
- package/dist/components/form/Select.vue_vue_type_script_setup_true_lang.js +78 -0
- package/dist/components/form/SelectButton.js +5 -0
- package/dist/components/form/SelectButton.vue.d.ts +27 -0
- package/dist/components/form/SelectButton.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/components/form/Textarea.js +5 -0
- package/dist/components/form/Textarea.vue.d.ts +16 -0
- package/dist/components/form/Textarea.vue_vue_type_script_setup_true_lang.js +34 -0
- package/dist/components/form/ToggleSwitch.js +5 -0
- package/dist/components/form/ToggleSwitch.vue.d.ts +14 -0
- package/dist/components/form/ToggleSwitch.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/components/form/date-format.d.ts +1 -0
- package/dist/components/form/date-format.js +14 -0
- package/dist/components/form/select-button-option.interface.d.ts +4 -0
- package/dist/components/icon/Icon.js +7 -0
- package/dist/components/icon/Icon.vue.d.ts +23 -0
- package/dist/components/icon/Icon.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/components/icon-cell/IconCell.js +7 -0
- package/dist/components/icon-cell/IconCell.vue.d.ts +7 -0
- package/dist/components/icon-cell/IconCell.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/layouts/EmptyLayout.js +16 -0
- package/dist/components/layouts/EmptyLayout.vue.d.ts +15 -0
- package/dist/components/message/Message.js +5 -0
- package/dist/components/message/Message.vue.d.ts +72 -0
- package/dist/components/message/Message.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/components/message/severity-to-vendor.d.ts +4 -0
- package/dist/components/message/severity-to-vendor.js +11 -0
- package/dist/components/overlay-badge/OverlayBadge.js +5 -0
- package/dist/components/overlay-badge/OverlayBadge.vue.d.ts +16 -0
- package/dist/components/overlay-badge/OverlayBadge.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/components/skeleton/Skeleton.js +5 -0
- package/dist/components/skeleton/Skeleton.vue.d.ts +7 -0
- package/dist/components/skeleton/Skeleton.vue_vue_type_script_setup_true_lang.js +20 -0
- package/dist/components/table/DataTable.js +7 -0
- package/dist/components/table/DataTable.vue.d.ts +61 -0
- package/dist/components/table/DataTable.vue_vue_type_script_setup_true_lang.js +303 -0
- package/dist/components/table/InfiniteDataTable.js +7 -0
- package/dist/components/table/InfiniteDataTable.vue.d.ts +32 -0
- package/dist/components/table/InfiniteDataTable.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/components/table/SelectColumnFilter.js +5 -0
- package/dist/components/table/SelectColumnFilter.vue.d.ts +29 -0
- package/dist/components/table/SelectColumnFilter.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/components/table/StaticTable.js +5 -0
- package/dist/components/table/StaticTable.vue.d.ts +39 -0
- package/dist/components/table/StaticTable.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/table/TextColumn.js +5 -0
- package/dist/components/table/TextColumn.vue.d.ts +13 -0
- package/dist/components/table/TextColumn.vue_vue_type_script_setup_true_lang.js +16 -0
- package/dist/components/table/collect-column-filters.d.ts +4 -0
- package/dist/components/table/collect-column-filters.js +11 -0
- package/dist/components/table/column-filters-interface.d.ts +10 -0
- package/dist/components/table/column-schema-interface.d.ts +20 -0
- package/dist/components/table/get-filters.d.ts +3 -0
- package/dist/components/table/get-filters.js +73 -0
- package/dist/components/table/select-column-filter-option.interface.d.ts +8 -0
- package/dist/components/table/static-table-column.d.ts +1 -0
- package/dist/components/tabs/Tabs.js +5 -0
- package/dist/components/tabs/Tabs.vue.d.ts +35 -0
- package/dist/components/tabs/Tabs.vue_vue_type_script_setup_true_lang.js +54 -0
- package/dist/components/tabs/tab-item.interface.d.ts +7 -0
- package/dist/components/tag/Tag.js +5 -0
- package/dist/components/tag/Tag.vue.d.ts +44 -0
- package/dist/components/tag/Tag.vue_vue_type_script_setup_true_lang.js +47 -0
- package/dist/components/tag/severity-to-vendor.d.ts +4 -0
- package/dist/components/tag/severity-to-vendor.js +11 -0
- package/dist/components/time-lag/TimeLag.js +7 -0
- package/dist/components/time-lag/TimeLag.vue.d.ts +29 -0
- package/dist/components/time-lag/TimeLag.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/components/timestamp/Timestamp.js +5 -0
- package/dist/components/timestamp/Timestamp.vue.d.ts +13 -0
- package/dist/components/timestamp/Timestamp.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/components/toast/ToastHost.js +6 -0
- package/dist/components/toast/ToastHost.vue.d.ts +3 -0
- package/dist/components/toast/ToastHost.vue_vue_type_script_setup_true_lang.js +13 -0
- package/dist/components/toast/install-toast-service.d.ts +2 -0
- package/dist/components/toast/install-toast-service.js +15 -0
- package/dist/components/toast/severity-to-vendor.d.ts +4 -0
- package/dist/components/toast/severity-to-vendor.js +11 -0
- package/dist/components/tooltip/Tooltip.js +7 -0
- package/dist/components/tooltip/Tooltip.vue.d.ts +51 -0
- package/dist/components/tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +47 -0
- package/dist/components/tooltip/dismiss-tooltips.d.ts +2 -0
- package/dist/components/tooltip/dismiss-tooltips.js +13 -0
- package/dist/components/tooltip/install-tooltip-directive.d.ts +6 -0
- package/dist/components/tooltip/install-tooltip-directive.js +80 -0
- package/dist/components/tooltip/tooltip-options.interface.d.ts +10 -0
- package/dist/components/truncated-code/TruncatedCode.js +5 -0
- package/dist/components/truncated-code/TruncatedCode.vue.d.ts +9 -0
- package/dist/components/truncated-code/TruncatedCode.vue_vue_type_script_setup_true_lang.js +23 -0
- package/dist/components/ui-icon/UiIcon.js +5 -0
- package/dist/components/ui-icon/UiIcon.vue.d.ts +13 -0
- package/dist/components/ui-icon/UiIcon.vue_vue_type_script_setup_true_lang.js +22 -0
- package/dist/composables/use-app-toast.d.ts +12 -0
- package/dist/composables/use-app-toast.js +50 -0
- package/dist/composables/use-confirm.d.ts +12 -0
- package/dist/composables/use-confirm.js +49 -0
- package/dist/composables/use-copy-to-clipboard.d.ts +2 -0
- package/dist/composables/use-copy-to-clipboard.js +23 -0
- package/dist/icons/ui-icon-registry.d.ts +6 -0
- package/dist/icons/ui-icon-registry.js +4 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.js +56 -0
- package/dist/layout/layout.d.ts +37 -0
- package/dist/layout/layout.js +60 -0
- package/dist/messages/ui-messages.d.ts +23 -0
- package/dist/plugin/ui-injection.d.ts +11 -0
- package/dist/plugin/ui-injection.js +18 -0
- package/dist/plugin/ui-vendor-plugin.d.ts +22 -0
- package/dist/plugin/ui-vendor-plugin.js +57 -0
- package/dist/severity.d.ts +1 -0
- package/dist/store/listing/cursor-listing.d.ts +25 -0
- package/dist/store/listing/cursor-listing.js +97 -0
- package/dist/store/listing/infinite-listing-store.d.ts +21 -0
- package/dist/store/listing/infinite-listing-store.interface.d.ts +13 -0
- package/dist/store/listing/infinite-listing-store.js +68 -0
- package/dist/store/listing/listing-store.d.ts +7 -0
- package/dist/store/listing/listing-store.interface.d.ts +21 -0
- package/dist/store/listing/listing-store.js +114 -0
- package/dist/style.css +158 -0
- package/dist/styles/_tokens.scss +96 -0
- package/dist/styles/_variables.scss +8 -0
- package/dist/testing/browser-api-stubs.d.ts +1 -0
- package/dist/testing/browser-api-stubs.js +38 -0
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.js +6 -0
- package/dist/testing/set-viewport-width.d.ts +1 -0
- package/dist/testing/set-viewport-width.js +18 -0
- package/dist/testing/submit-form.d.ts +1 -0
- package/dist/testing/submit-form.js +25 -0
- package/dist/testing/ui-messages.fixture.d.ts +2 -0
- package/dist/testing/ui-messages.fixture.js +26 -0
- package/dist/testing/vendor-plugins.d.ts +2 -0
- package/dist/testing/vendor-plugins.js +22 -0
- package/dist/utils/datetime.d.ts +10 -0
- package/dist/utils/datetime.js +53 -0
- package/dist/utils/truncate-string.d.ts +2 -0
- package/dist/utils/truncate-string.js +10 -0
- package/package.json +93 -3
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createElementBlock, defineComponent, openBlock, renderSlot, unref, withDirectives } from "vue";
|
|
2
|
+
import VendorTooltip from "openvue/tooltip";
|
|
3
|
+
//#region src/components/tooltip/Tooltip.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var Tooltip_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
5
|
+
__name: "Tooltip",
|
|
6
|
+
props: {
|
|
7
|
+
autoHide: {
|
|
8
|
+
default: false,
|
|
9
|
+
type: Boolean
|
|
10
|
+
},
|
|
11
|
+
position: {
|
|
12
|
+
default: "top",
|
|
13
|
+
type: String
|
|
14
|
+
},
|
|
15
|
+
showDelay: {
|
|
16
|
+
default: 0,
|
|
17
|
+
type: Number
|
|
18
|
+
},
|
|
19
|
+
value: {
|
|
20
|
+
required: true,
|
|
21
|
+
type: String
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
setup(__props) {
|
|
25
|
+
const vTooltip = VendorTooltip;
|
|
26
|
+
const { autoHide, position, showDelay, value } = __props;
|
|
27
|
+
const tooltipPosition = { position };
|
|
28
|
+
return (_ctx, _cache) => {
|
|
29
|
+
return withDirectives((openBlock(), createElementBlock("span", null, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])), [[
|
|
30
|
+
unref(vTooltip),
|
|
31
|
+
{
|
|
32
|
+
"escape": true,
|
|
33
|
+
autoHide: unref(autoHide),
|
|
34
|
+
showDelay: unref(showDelay),
|
|
35
|
+
value: unref(value),
|
|
36
|
+
"pt": { "text": {
|
|
37
|
+
"class": ["tooltip__text"],
|
|
38
|
+
[_ctx.$options["__scopeId"]]: ""
|
|
39
|
+
} }
|
|
40
|
+
},
|
|
41
|
+
tooltipPosition
|
|
42
|
+
]]);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
//#endregion
|
|
47
|
+
export { Tooltip_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/components/tooltip/dismiss-tooltips.ts
|
|
2
|
+
var TOOLTIP_ROOT_SELECTOR = ".p-tooltip";
|
|
3
|
+
/**
|
|
4
|
+
* Removes the tooltips left on screen by elements that are no longer in the markup.
|
|
5
|
+
* @example
|
|
6
|
+
* dismissTooltips() // after the menu switched to a compact mode
|
|
7
|
+
*/
|
|
8
|
+
var dismissTooltips = () => {
|
|
9
|
+
const tooltips = globalThis.document.querySelectorAll(TOOLTIP_ROOT_SELECTOR);
|
|
10
|
+
for (const tooltip of tooltips) tooltip.remove();
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { TOOLTIP_ROOT_SELECTOR, dismissTooltips };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DirectiveBinding, ObjectDirective, App as VueApp } from 'vue';
|
|
2
|
+
import type { TooltipBindingValue } from './tooltip-options.interface';
|
|
3
|
+
export declare const toVendorTooltipBinding: (binding: DirectiveBinding<TooltipBindingValue>) => DirectiveBinding;
|
|
4
|
+
export type TooltipDirective = Required<Pick<ObjectDirective<HTMLElement, TooltipBindingValue>, 'beforeMount' | 'beforeUnmount' | 'beforeUpdate' | 'created' | 'mounted' | 'unmounted' | 'updated'>>;
|
|
5
|
+
export declare const createTooltipDirective: (vendor: ObjectDirective) => TooltipDirective;
|
|
6
|
+
export declare const installTooltipDirective: (app: VueApp) => void;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import VendorTooltip from "openvue/tooltip";
|
|
2
|
+
//#region src/components/tooltip/install-tooltip-directive.ts
|
|
3
|
+
/**
|
|
4
|
+
* Имя собственной директивы: в шаблонах — `v-ui-tooltip`. Вендорское имя `tooltip` наружу не
|
|
5
|
+
* торчит намеренно — смена вендора не должна переписывать call-site'ы (story 3-7).
|
|
6
|
+
*/
|
|
7
|
+
var TOOLTIP_DIRECTIVE_NAME = "uiTooltip";
|
|
8
|
+
var DEFAULT_POSITION = "top";
|
|
9
|
+
/**
|
|
10
|
+
* Translates the own tooltip options into the vendor dictionary — the only place that knows it.
|
|
11
|
+
* The position goes into `arg` (the vendor folds it into its own modifiers), the trigger into
|
|
12
|
+
* `modifiers`, the text and the delays into the value. `escape: true` is set here and not by a
|
|
13
|
+
* call-site: a tooltip shows user data (a menu label, a profile name), and HTML inside it would
|
|
14
|
+
* be rendered as markup.
|
|
15
|
+
* @param binding - Directive binding carrying the own options.
|
|
16
|
+
* @returns Binding in the shape the vendor directive expects.
|
|
17
|
+
* @example
|
|
18
|
+
* toVendorTooltipBinding(binding) // { arg: { position: 'top' }, value: { escape: true, … } }
|
|
19
|
+
*/
|
|
20
|
+
var toVendorTooltipBinding = (binding) => {
|
|
21
|
+
const options = typeof binding.value === "string" || binding.value === null ? { value: binding.value } : binding.value;
|
|
22
|
+
return {
|
|
23
|
+
...binding,
|
|
24
|
+
arg: { position: options.position ?? DEFAULT_POSITION },
|
|
25
|
+
modifiers: options.trigger === "focus" ? { focus: true } : {},
|
|
26
|
+
value: {
|
|
27
|
+
escape: true,
|
|
28
|
+
...options.hideDelay !== void 0 && { hideDelay: options.hideDelay },
|
|
29
|
+
...options.showDelay !== void 0 && { showDelay: options.showDelay },
|
|
30
|
+
value: options.value
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Builds the own directive that delegates every hook to the given vendor directive.
|
|
36
|
+
* @param vendor - Vendor tooltip directive to delegate to.
|
|
37
|
+
* @returns Own directive with the own options contract.
|
|
38
|
+
* @example
|
|
39
|
+
* createTooltipDirective(VendorTooltip)
|
|
40
|
+
*/
|
|
41
|
+
var createTooltipDirective = (vendor) => ({
|
|
42
|
+
beforeMount: (element, binding, vnode, previousVnode) => {
|
|
43
|
+
vendor.beforeMount?.(element, toVendorTooltipBinding(binding), vnode, previousVnode);
|
|
44
|
+
},
|
|
45
|
+
beforeUnmount: (element, binding, vnode, previousVnode) => {
|
|
46
|
+
vendor.beforeUnmount?.(element, toVendorTooltipBinding(binding), vnode, previousVnode);
|
|
47
|
+
},
|
|
48
|
+
beforeUpdate: (element, binding, vnode, previousVnode) => {
|
|
49
|
+
vendor.beforeUpdate?.(element, toVendorTooltipBinding(binding), vnode, previousVnode);
|
|
50
|
+
},
|
|
51
|
+
created: (element, binding, vnode, previousVnode) => {
|
|
52
|
+
vendor.created?.(element, toVendorTooltipBinding(binding), vnode, previousVnode);
|
|
53
|
+
},
|
|
54
|
+
mounted: (element, binding, vnode, previousVnode) => {
|
|
55
|
+
vendor.mounted?.(element, toVendorTooltipBinding(binding), vnode, previousVnode);
|
|
56
|
+
},
|
|
57
|
+
unmounted: (element, binding, vnode, previousVnode) => {
|
|
58
|
+
vendor.unmounted?.(element, toVendorTooltipBinding(binding), vnode, previousVnode);
|
|
59
|
+
},
|
|
60
|
+
updated: (element, binding, vnode, previousVnode) => {
|
|
61
|
+
vendor.updated?.(element, toVendorTooltipBinding(binding), vnode, previousVnode);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
var uiTooltipDirective = createTooltipDirective(VendorTooltip);
|
|
65
|
+
/**
|
|
66
|
+
* Runtime dependency of the `v-ui-tooltip` call-sites: the vendor directive is wrapped and
|
|
67
|
+
* registered here, inside the shared layer, instead of the app-level plugin — otherwise
|
|
68
|
+
* `openvue/tooltip` leaks into `src/modules`.
|
|
69
|
+
* The directive stays alongside the `Tooltip.vue` component on purpose: the component wraps its
|
|
70
|
+
* content into an extra `span`, which is not an option for elements that are themselves flex or
|
|
71
|
+
* grid items (menu rows, profile button), so both forms of the same facade are kept.
|
|
72
|
+
* @param app - Vue.js app (module VendorPlugin or the test harness).
|
|
73
|
+
* @example
|
|
74
|
+
* installTooltipDirective(vue)
|
|
75
|
+
*/
|
|
76
|
+
var installTooltipDirective = (app) => {
|
|
77
|
+
app.directive(TOOLTIP_DIRECTIVE_NAME, uiTooltipDirective);
|
|
78
|
+
};
|
|
79
|
+
//#endregion
|
|
80
|
+
export { createTooltipDirective, installTooltipDirective, toVendorTooltipBinding };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type TooltipBindingValue = null | string | TooltipOptionsInterface;
|
|
2
|
+
export interface TooltipOptionsInterface {
|
|
3
|
+
hideDelay?: number;
|
|
4
|
+
position?: TooltipPosition;
|
|
5
|
+
showDelay?: number;
|
|
6
|
+
trigger?: TooltipTrigger;
|
|
7
|
+
value: null | string;
|
|
8
|
+
}
|
|
9
|
+
export type TooltipPosition = 'bottom' | 'left' | 'right' | 'top';
|
|
10
|
+
export type TooltipTrigger = 'focus' | 'hover';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import TruncatedCode_vue_vue_type_script_setup_true_lang_default from "./TruncatedCode.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region src/components/truncated-code/TruncatedCode.vue
|
|
3
|
+
var TruncatedCode_default = TruncatedCode_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { TruncatedCode_default as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
length?: number;
|
|
3
|
+
value: string;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("*.vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
6
|
+
length: number;
|
|
7
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Tooltip_default from "../tooltip/Tooltip.js";
|
|
2
|
+
import { truncateStringInTheMiddle } from "../../utils/truncate-string.js";
|
|
3
|
+
import { computed, createBlock, createElementVNode, defineComponent, openBlock, toDisplayString, withCtx } from "vue";
|
|
4
|
+
//#region src/components/truncated-code/TruncatedCode.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var TruncatedCode_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
|
+
__name: "TruncatedCode",
|
|
7
|
+
props: {
|
|
8
|
+
length: { default: 24 },
|
|
9
|
+
value: {}
|
|
10
|
+
},
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const properties = __props;
|
|
13
|
+
const short = computed(() => truncateStringInTheMiddle(properties.value, properties.length));
|
|
14
|
+
return (_ctx, _cache) => {
|
|
15
|
+
return openBlock(), createBlock(Tooltip_default, { value: __props.value }, {
|
|
16
|
+
default: withCtx(() => [createElementVNode("code", null, toDisplayString(short.value), 1)]),
|
|
17
|
+
_: 1
|
|
18
|
+
}, 8, ["value"]);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
export { TruncatedCode_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import UiIcon_vue_vue_type_script_setup_true_lang_default from "./UiIcon.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region src/components/ui-icon/UiIcon.vue
|
|
3
|
+
var UiIcon_default = UiIcon_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { UiIcon_default as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
name: {
|
|
3
|
+
required: true;
|
|
4
|
+
type: import("vue").PropType<"times">;
|
|
5
|
+
};
|
|
6
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
+
name: {
|
|
8
|
+
required: true;
|
|
9
|
+
type: import("vue").PropType<"times">;
|
|
10
|
+
};
|
|
11
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ICON_PROP_TYPE } from "../../icons/ui-icon-registry.js";
|
|
2
|
+
import { useUiIconClass } from "../../plugin/ui-injection.js";
|
|
3
|
+
import { createElementBlock, defineComponent, normalizeClass, openBlock, unref } from "vue";
|
|
4
|
+
//#region src/components/ui-icon/UiIcon.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var UiIcon_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
|
+
__name: "UiIcon",
|
|
7
|
+
props: { name: {
|
|
8
|
+
required: true,
|
|
9
|
+
type: ICON_PROP_TYPE
|
|
10
|
+
} },
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const iconClass = useUiIconClass();
|
|
13
|
+
return (_ctx, _cache) => {
|
|
14
|
+
return openBlock(), createElementBlock("i", {
|
|
15
|
+
class: normalizeClass(unref(iconClass)(__props.name)),
|
|
16
|
+
"aria-hidden": "true"
|
|
17
|
+
}, null, 2);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
//#endregion
|
|
22
|
+
export { UiIcon_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Severity } from '../severity';
|
|
2
|
+
export interface AppToastInterface {
|
|
3
|
+
error(summary: string, detail?: string, options?: AppToastOptionsInterface): void;
|
|
4
|
+
info(summary: string, detail?: string, options?: AppToastOptionsInterface): void;
|
|
5
|
+
notify(severity: Severity, summary: string, detail?: string, options?: AppToastOptionsInterface): void;
|
|
6
|
+
success(summary: string, detail?: string, options?: AppToastOptionsInterface): void;
|
|
7
|
+
warn(summary: string, detail?: string, options?: AppToastOptionsInterface): void;
|
|
8
|
+
}
|
|
9
|
+
export interface AppToastOptionsInterface {
|
|
10
|
+
life?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const useAppToast: () => AppToastInterface;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { SEVERITY_TO_VENDOR } from "../components/toast/severity-to-vendor.js";
|
|
2
|
+
import { useToast } from "openvue/usetoast";
|
|
3
|
+
//#region src/composables/use-app-toast.ts
|
|
4
|
+
var DEFAULT_TOAST_LIFE_MS = 3e3;
|
|
5
|
+
var ALERT_TOAST_LIFE_MS = 5e3;
|
|
6
|
+
var TOAST_LIFE_BY_SEVERITY = {
|
|
7
|
+
contrast: DEFAULT_TOAST_LIFE_MS,
|
|
8
|
+
danger: ALERT_TOAST_LIFE_MS,
|
|
9
|
+
info: DEFAULT_TOAST_LIFE_MS,
|
|
10
|
+
secondary: DEFAULT_TOAST_LIFE_MS,
|
|
11
|
+
success: DEFAULT_TOAST_LIFE_MS,
|
|
12
|
+
warn: ALERT_TOAST_LIFE_MS
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Toast facade: the domain calls `success/error/info/warn` with the shared `Severity`,
|
|
16
|
+
* while the vendor's imperative `toast.add({ severity, summary, detail, life })` stays inside.
|
|
17
|
+
* Must be called in setup context (resolves the vendor `useToast()` internally).
|
|
18
|
+
* @returns Domain toast contract of the shared layer.
|
|
19
|
+
* @example
|
|
20
|
+
* const toast = useAppToast()
|
|
21
|
+
* toast.error('Action failed', message)
|
|
22
|
+
*/
|
|
23
|
+
var useAppToast = () => {
|
|
24
|
+
const toast = useToast();
|
|
25
|
+
const notify = (severity, summary, detail, options) => {
|
|
26
|
+
toast.add({
|
|
27
|
+
detail,
|
|
28
|
+
life: options?.life ?? TOAST_LIFE_BY_SEVERITY[severity],
|
|
29
|
+
severity: SEVERITY_TO_VENDOR[severity],
|
|
30
|
+
summary
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
error: (summary, detail, options) => {
|
|
35
|
+
notify("danger", summary, detail, options);
|
|
36
|
+
},
|
|
37
|
+
info: (summary, detail, options) => {
|
|
38
|
+
notify("info", summary, detail, options);
|
|
39
|
+
},
|
|
40
|
+
notify,
|
|
41
|
+
success: (summary, detail, options) => {
|
|
42
|
+
notify("success", summary, detail, options);
|
|
43
|
+
},
|
|
44
|
+
warn: (summary, detail, options) => {
|
|
45
|
+
notify("warn", summary, detail, options);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
export { useAppToast };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IconName } from '../icons/ui-icon-registry';
|
|
2
|
+
import type { Severity } from '../severity';
|
|
3
|
+
export interface ConfirmOptionsInterface {
|
|
4
|
+
acceptLabel?: string;
|
|
5
|
+
acceptSeverity?: Severity;
|
|
6
|
+
header: string;
|
|
7
|
+
icon?: IconName | undefined;
|
|
8
|
+
message: string;
|
|
9
|
+
rejectLabel?: string;
|
|
10
|
+
}
|
|
11
|
+
export type ConfirmType = (options: ConfirmOptionsInterface) => Promise<boolean>;
|
|
12
|
+
export declare const useConfirm: () => ConfirmType;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useUiIconClass } from "../plugin/ui-injection.js";
|
|
2
|
+
import { SEVERITY_TO_VENDOR } from "../components/button/severity-to-vendor.js";
|
|
3
|
+
import { useConfirm } from "openvue/useconfirm";
|
|
4
|
+
//#region src/composables/use-confirm.ts
|
|
5
|
+
var DEFAULT_ACCEPT_LABEL = "Confirm";
|
|
6
|
+
var DEFAULT_REJECT_LABEL = "Cancel";
|
|
7
|
+
var REJECT_PROPS = {
|
|
8
|
+
severity: "secondary",
|
|
9
|
+
text: true
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Imperative confirmation of a critical action with a Promise contract instead of vendor callbacks.
|
|
13
|
+
* The dialog itself is rendered by `<ConfirmHost />`, mounted next to the card's own operations.
|
|
14
|
+
* Must be called in setup context (resolves the vendor confirmation service internally).
|
|
15
|
+
* @returns Ask function: `true` when confirmed, `false` when rejected or dismissed.
|
|
16
|
+
* @example
|
|
17
|
+
* const confirm = useConfirm()
|
|
18
|
+
* if (await confirm({ header: 'Deactivate user?', message: 'Active sessions will be revoked.' })) { … }
|
|
19
|
+
*/
|
|
20
|
+
var useConfirm$1 = () => {
|
|
21
|
+
const vendorConfirm = useConfirm();
|
|
22
|
+
const iconClass = useUiIconClass();
|
|
23
|
+
return async (options) => new Promise((resolve) => {
|
|
24
|
+
vendorConfirm.require({
|
|
25
|
+
accept: () => {
|
|
26
|
+
resolve(true);
|
|
27
|
+
},
|
|
28
|
+
acceptProps: {
|
|
29
|
+
label: options.acceptLabel ?? DEFAULT_ACCEPT_LABEL,
|
|
30
|
+
severity: options.acceptSeverity === void 0 ? void 0 : SEVERITY_TO_VENDOR[options.acceptSeverity]
|
|
31
|
+
},
|
|
32
|
+
header: options.header,
|
|
33
|
+
icon: options.icon === void 0 ? void 0 : iconClass(options.icon),
|
|
34
|
+
message: options.message,
|
|
35
|
+
onHide: () => {
|
|
36
|
+
resolve(false);
|
|
37
|
+
},
|
|
38
|
+
reject: () => {
|
|
39
|
+
resolve(false);
|
|
40
|
+
},
|
|
41
|
+
rejectProps: {
|
|
42
|
+
...REJECT_PROPS,
|
|
43
|
+
label: options.rejectLabel ?? DEFAULT_REJECT_LABEL
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
49
|
+
export { useConfirm$1 as useConfirm };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useAppToast } from "./use-app-toast.js";
|
|
2
|
+
//#region src/composables/use-copy-to-clipboard.ts
|
|
3
|
+
var COPIED_TOAST_LIFE_MS = 2e3;
|
|
4
|
+
/**
|
|
5
|
+
* Shared copy-to-clipboard action with the "Copied" toast confirmation — the guard+write+toast
|
|
6
|
+
* shape shared by every copy button in the UI.
|
|
7
|
+
* Must be called in setup context (resolves `useAppToast()` internally).
|
|
8
|
+
* @returns Copy action: writes the value to the clipboard and confirms with an info toast.
|
|
9
|
+
* @example
|
|
10
|
+
* const copy = useCopyToClipboard()
|
|
11
|
+
* await copy(props.value, 'Value copied to clipboard')
|
|
12
|
+
*/
|
|
13
|
+
var useCopyToClipboard = () => {
|
|
14
|
+
const toast = useAppToast();
|
|
15
|
+
return async (value, detail) => {
|
|
16
|
+
const host = globalThis.navigator;
|
|
17
|
+
if (host.clipboard === void 0) return;
|
|
18
|
+
await host.clipboard.writeText(value);
|
|
19
|
+
toast.info("Copied", detail, { life: COPIED_TOAST_LIFE_MS });
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { useCopyToClipboard };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export { default as Avatar } from './components/avatar/Avatar.vue';
|
|
2
|
+
export { default as Button } from './components/button/Button.vue';
|
|
3
|
+
export { default as Card } from './components/card/Card.vue';
|
|
4
|
+
export { default as ConfirmHost } from './components/confirm/ConfirmHost.vue';
|
|
5
|
+
export { default as DateRangeFilter } from './components/date-range-filter/DateRangeFilter.vue';
|
|
6
|
+
export { default as Dialog } from './components/dialog/Dialog.vue';
|
|
7
|
+
export { default as Drawer } from './components/drawer/Drawer.vue';
|
|
8
|
+
export { default as ErrorPage } from './components/error-page/Error.vue';
|
|
9
|
+
export { default as GradientBackground } from './components/error-page/GradientBackground.vue';
|
|
10
|
+
export { default as Checkbox } from './components/form/Checkbox.vue';
|
|
11
|
+
export { default as DateField } from './components/form/DateField.vue';
|
|
12
|
+
export { default as DateRangeField } from './components/form/DateRangeField.vue';
|
|
13
|
+
export { default as InputNumber } from './components/form/InputNumber.vue';
|
|
14
|
+
export { default as InputOtp } from './components/form/InputOtp.vue';
|
|
15
|
+
export { default as InputText } from './components/form/InputText.vue';
|
|
16
|
+
export { default as MultiSelect } from './components/form/MultiSelect.vue';
|
|
17
|
+
export { default as RadioButton } from './components/form/RadioButton.vue';
|
|
18
|
+
export { default as Select } from './components/form/Select.vue';
|
|
19
|
+
export { default as SelectButton } from './components/form/SelectButton.vue';
|
|
20
|
+
export { default as Textarea } from './components/form/Textarea.vue';
|
|
21
|
+
export { default as ToggleSwitch } from './components/form/ToggleSwitch.vue';
|
|
22
|
+
export { default as Icon } from './components/icon/Icon.vue';
|
|
23
|
+
export { default as IconCell } from './components/icon-cell/IconCell.vue';
|
|
24
|
+
export { default as EmptyLayout } from './components/layouts/EmptyLayout.vue';
|
|
25
|
+
export { default as Message } from './components/message/Message.vue';
|
|
26
|
+
export { default as OverlayBadge } from './components/overlay-badge/OverlayBadge.vue';
|
|
27
|
+
export { default as Skeleton } from './components/skeleton/Skeleton.vue';
|
|
28
|
+
export { default as DataTable } from './components/table/DataTable.vue';
|
|
29
|
+
export { default as InfiniteDataTable } from './components/table/InfiniteDataTable.vue';
|
|
30
|
+
export { default as SelectColumnFilter } from './components/table/SelectColumnFilter.vue';
|
|
31
|
+
export { default as StaticTable } from './components/table/StaticTable.vue';
|
|
32
|
+
export { default as TextColumn } from './components/table/TextColumn.vue';
|
|
33
|
+
export { default as Tabs } from './components/tabs/Tabs.vue';
|
|
34
|
+
export { default as Tag } from './components/tag/Tag.vue';
|
|
35
|
+
export { default as TimeLag } from './components/time-lag/TimeLag.vue';
|
|
36
|
+
export { default as Timestamp } from './components/timestamp/Timestamp.vue';
|
|
37
|
+
export { default as ToastHost } from './components/toast/ToastHost.vue';
|
|
38
|
+
export { default as Tooltip } from './components/tooltip/Tooltip.vue';
|
|
39
|
+
export { default as TruncatedCode } from './components/truncated-code/TruncatedCode.vue';
|
|
40
|
+
export { default as UiIcon } from './components/ui-icon/UiIcon.vue';
|
|
41
|
+
export * from './components/confirm/install-confirmation-service';
|
|
42
|
+
export * from './components/form/select-button-option.interface';
|
|
43
|
+
export * from './components/table/column-filters-interface';
|
|
44
|
+
export * from './components/table/column-schema-interface';
|
|
45
|
+
export * from './components/table/select-column-filter-option.interface';
|
|
46
|
+
export * from './components/table/static-table-column';
|
|
47
|
+
export * from './components/tabs/tab-item.interface';
|
|
48
|
+
export * from './components/toast/install-toast-service';
|
|
49
|
+
export * from './components/tooltip/dismiss-tooltips';
|
|
50
|
+
export * from './components/tooltip/install-tooltip-directive';
|
|
51
|
+
export * from './components/tooltip/tooltip-options.interface';
|
|
52
|
+
export * from './composables/use-app-toast';
|
|
53
|
+
export * from './composables/use-confirm';
|
|
54
|
+
export * from './composables/use-copy-to-clipboard';
|
|
55
|
+
export * from './layout/layout';
|
|
56
|
+
export * from './plugin/ui-injection';
|
|
57
|
+
export * from './plugin/ui-vendor-plugin';
|
|
58
|
+
export * from './store/listing/cursor-listing';
|
|
59
|
+
export * from './store/listing/infinite-listing-store.interface';
|
|
60
|
+
export * from './store/listing/infinite-listing-store';
|
|
61
|
+
export * from './store/listing/listing-store.interface';
|
|
62
|
+
export * from './store/listing/listing-store';
|
|
63
|
+
export * from './icons/ui-icon-registry';
|
|
64
|
+
export * from './messages/ui-messages';
|
|
65
|
+
export * from './severity';
|
|
66
|
+
export * from './accent-color';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ICON_PROP_TYPE } from "./icons/ui-icon-registry.js";
|
|
2
|
+
import { UI_DESCRIBE_REQUEST_ERROR, UI_ICON_CLASS, UI_MESSAGES, useUiDescribeRequestError, useUiIconClass, useUiMessages } from "./plugin/ui-injection.js";
|
|
3
|
+
import Avatar_default from "./components/avatar/Avatar.js";
|
|
4
|
+
import Button_default from "./components/button/Button.js";
|
|
5
|
+
import Card_default from "./components/card/Card.js";
|
|
6
|
+
import ConfirmHost_default from "./components/confirm/ConfirmHost.js";
|
|
7
|
+
import DateRangeField_default from "./components/form/DateRangeField.js";
|
|
8
|
+
import DateRangeFilter_default from "./components/date-range-filter/DateRangeFilter.js";
|
|
9
|
+
import Dialog_default from "./components/dialog/Dialog.js";
|
|
10
|
+
import Drawer_default from "./components/drawer/Drawer.js";
|
|
11
|
+
import { useAppToast } from "./composables/use-app-toast.js";
|
|
12
|
+
import { useCopyToClipboard } from "./composables/use-copy-to-clipboard.js";
|
|
13
|
+
import GradientBackground_default from "./components/error-page/GradientBackground.js";
|
|
14
|
+
import Error_default from "./components/error-page/Error.js";
|
|
15
|
+
import Checkbox_default from "./components/form/Checkbox.js";
|
|
16
|
+
import DateField_default from "./components/form/DateField.js";
|
|
17
|
+
import InputNumber_default from "./components/form/InputNumber.js";
|
|
18
|
+
import InputOtp_default from "./components/form/InputOtp.js";
|
|
19
|
+
import InputText_default from "./components/form/InputText.js";
|
|
20
|
+
import MultiSelect_default from "./components/form/MultiSelect.js";
|
|
21
|
+
import RadioButton_default from "./components/form/RadioButton.js";
|
|
22
|
+
import Select_default from "./components/form/Select.js";
|
|
23
|
+
import SelectButton_default from "./components/form/SelectButton.js";
|
|
24
|
+
import Textarea_default from "./components/form/Textarea.js";
|
|
25
|
+
import ToggleSwitch_default from "./components/form/ToggleSwitch.js";
|
|
26
|
+
import Icon_default from "./components/icon/Icon.js";
|
|
27
|
+
import Tooltip_default from "./components/tooltip/Tooltip.js";
|
|
28
|
+
import IconCell_default from "./components/icon-cell/IconCell.js";
|
|
29
|
+
import EmptyLayout_default from "./components/layouts/EmptyLayout.js";
|
|
30
|
+
import Message_default from "./components/message/Message.js";
|
|
31
|
+
import OverlayBadge_default from "./components/overlay-badge/OverlayBadge.js";
|
|
32
|
+
import Skeleton_default from "./components/skeleton/Skeleton.js";
|
|
33
|
+
import { DEFAULT_LISTING_LIMIT, createCursorListing } from "./store/listing/cursor-listing.js";
|
|
34
|
+
import DataTable_default from "./components/table/DataTable.js";
|
|
35
|
+
import InfiniteDataTable_default from "./components/table/InfiniteDataTable.js";
|
|
36
|
+
import Tag_default from "./components/tag/Tag.js";
|
|
37
|
+
import SelectColumnFilter_default from "./components/table/SelectColumnFilter.js";
|
|
38
|
+
import StaticTable_default from "./components/table/StaticTable.js";
|
|
39
|
+
import TextColumn_default from "./components/table/TextColumn.js";
|
|
40
|
+
import Tabs_default from "./components/tabs/Tabs.js";
|
|
41
|
+
import TimeLag_default from "./components/time-lag/TimeLag.js";
|
|
42
|
+
import Timestamp_default from "./components/timestamp/Timestamp.js";
|
|
43
|
+
import ToastHost_default from "./components/toast/ToastHost.js";
|
|
44
|
+
import TruncatedCode_default from "./components/truncated-code/TruncatedCode.js";
|
|
45
|
+
import UiIcon_default from "./components/ui-icon/UiIcon.js";
|
|
46
|
+
import { installConfirmationService } from "./components/confirm/install-confirmation-service.js";
|
|
47
|
+
import { installToastService } from "./components/toast/install-toast-service.js";
|
|
48
|
+
import { TOOLTIP_ROOT_SELECTOR, dismissTooltips } from "./components/tooltip/dismiss-tooltips.js";
|
|
49
|
+
import { createTooltipDirective, installTooltipDirective, toVendorTooltipBinding } from "./components/tooltip/install-tooltip-directive.js";
|
|
50
|
+
import { useConfirm } from "./composables/use-confirm.js";
|
|
51
|
+
import { MENU_MODES, MENU_PROFILE_POSITIONS, MOBILE_MAX_WIDTH_PX, useLayout } from "./layout/layout.js";
|
|
52
|
+
import { UiVendorPlugin } from "./plugin/ui-vendor-plugin.js";
|
|
53
|
+
import { createInfiniteListing } from "./store/listing/infinite-listing-store.js";
|
|
54
|
+
import { useListingStore } from "./store/listing/listing-store.js";
|
|
55
|
+
import { ACCENT_COLORS } from "./accent-color.js";
|
|
56
|
+
export { ACCENT_COLORS, Avatar_default as Avatar, Button_default as Button, Card_default as Card, Checkbox_default as Checkbox, ConfirmHost_default as ConfirmHost, DEFAULT_LISTING_LIMIT, DataTable_default as DataTable, DateField_default as DateField, DateRangeField_default as DateRangeField, DateRangeFilter_default as DateRangeFilter, Dialog_default as Dialog, Drawer_default as Drawer, EmptyLayout_default as EmptyLayout, Error_default as ErrorPage, GradientBackground_default as GradientBackground, ICON_PROP_TYPE, Icon_default as Icon, IconCell_default as IconCell, InfiniteDataTable_default as InfiniteDataTable, InputNumber_default as InputNumber, InputOtp_default as InputOtp, InputText_default as InputText, MENU_MODES, MENU_PROFILE_POSITIONS, MOBILE_MAX_WIDTH_PX, Message_default as Message, MultiSelect_default as MultiSelect, OverlayBadge_default as OverlayBadge, RadioButton_default as RadioButton, Select_default as Select, SelectButton_default as SelectButton, SelectColumnFilter_default as SelectColumnFilter, Skeleton_default as Skeleton, StaticTable_default as StaticTable, TOOLTIP_ROOT_SELECTOR, Tabs_default as Tabs, Tag_default as Tag, TextColumn_default as TextColumn, Textarea_default as Textarea, TimeLag_default as TimeLag, Timestamp_default as Timestamp, ToastHost_default as ToastHost, ToggleSwitch_default as ToggleSwitch, Tooltip_default as Tooltip, TruncatedCode_default as TruncatedCode, UI_DESCRIBE_REQUEST_ERROR, UI_ICON_CLASS, UI_MESSAGES, UiIcon_default as UiIcon, UiVendorPlugin, createCursorListing, createInfiniteListing, createTooltipDirective, dismissTooltips, installConfirmationService, installToastService, installTooltipDirective, toVendorTooltipBinding, useAppToast, useConfirm, useCopyToClipboard, useLayout, useListingStore, useUiDescribeRequestError, useUiIconClass, useUiMessages };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const MOBILE_MAX_WIDTH_PX = 991;
|
|
2
|
+
export type ComponentTheme = 'blue' | 'green' | 'white' | 'yellow';
|
|
3
|
+
export interface LayoutConfigInterface {
|
|
4
|
+
layoutTheme: ComponentTheme;
|
|
5
|
+
menuMode: MenuMode;
|
|
6
|
+
menuProfilePosition: MenuProfilePosition;
|
|
7
|
+
scale: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const MENU_MODES: readonly ["static", "overlay", "slim", "slim-plus", "reveal", "drawer", "horizontal"];
|
|
10
|
+
export type MenuMode = (typeof MENU_MODES)[number];
|
|
11
|
+
export declare const MENU_PROFILE_POSITIONS: readonly ["start", "end"];
|
|
12
|
+
type MenuProfilePosition = (typeof MENU_PROFILE_POSITIONS)[number];
|
|
13
|
+
export declare const useLayout: () => {
|
|
14
|
+
isDesktop: import("vue").Ref<boolean, boolean>;
|
|
15
|
+
isSlim: import("vue").ComputedRef<boolean>;
|
|
16
|
+
isSlimPlus: import("vue").ComputedRef<boolean>;
|
|
17
|
+
layoutConfig: import("vue").ToRefs<{
|
|
18
|
+
layoutTheme: ComponentTheme;
|
|
19
|
+
menuMode: MenuMode;
|
|
20
|
+
menuProfilePosition: MenuProfilePosition;
|
|
21
|
+
scale: number;
|
|
22
|
+
}>;
|
|
23
|
+
layoutState: import("vue").ToRefs<{
|
|
24
|
+
activeMenuItem: string;
|
|
25
|
+
anchored: boolean;
|
|
26
|
+
configSidebarVisible: boolean;
|
|
27
|
+
menuHoverActive: boolean;
|
|
28
|
+
menuProfileActive: boolean;
|
|
29
|
+
overlayMenuActive: boolean;
|
|
30
|
+
overlaySubmenuActive: boolean;
|
|
31
|
+
sidebarActive: boolean;
|
|
32
|
+
staticMenuDesktopInactive: boolean;
|
|
33
|
+
staticMenuMobileActive: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
onMenuToggle: () => void;
|
|
36
|
+
};
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { computed, reactive, ref, toRefs } from "vue";
|
|
2
|
+
//#region src/layout/layout.ts
|
|
3
|
+
var MOBILE_MAX_WIDTH_PX = 991;
|
|
4
|
+
var MENU_MODES = [
|
|
5
|
+
"static",
|
|
6
|
+
"overlay",
|
|
7
|
+
"slim",
|
|
8
|
+
"slim-plus",
|
|
9
|
+
"reveal",
|
|
10
|
+
"drawer",
|
|
11
|
+
"horizontal"
|
|
12
|
+
];
|
|
13
|
+
var MENU_PROFILE_POSITIONS = ["start", "end"];
|
|
14
|
+
var layoutConfig = reactive({
|
|
15
|
+
layoutTheme: "blue",
|
|
16
|
+
menuMode: "static",
|
|
17
|
+
menuProfilePosition: "start",
|
|
18
|
+
scale: 14
|
|
19
|
+
});
|
|
20
|
+
var layoutState = reactive({
|
|
21
|
+
activeMenuItem: "",
|
|
22
|
+
anchored: false,
|
|
23
|
+
configSidebarVisible: false,
|
|
24
|
+
menuHoverActive: false,
|
|
25
|
+
menuProfileActive: false,
|
|
26
|
+
overlayMenuActive: false,
|
|
27
|
+
overlaySubmenuActive: false,
|
|
28
|
+
sidebarActive: false,
|
|
29
|
+
staticMenuDesktopInactive: false,
|
|
30
|
+
staticMenuMobileActive: false
|
|
31
|
+
});
|
|
32
|
+
var isDesktopWidth = () => globalThis.window.innerWidth > 991;
|
|
33
|
+
var isDesktop = ref(true);
|
|
34
|
+
var resizeWatch = {};
|
|
35
|
+
var observeWindowWidth = () => {
|
|
36
|
+
if (resizeWatch.isObserved || false) return;
|
|
37
|
+
resizeWatch.isObserved = true;
|
|
38
|
+
isDesktop.value = isDesktopWidth();
|
|
39
|
+
globalThis.window.addEventListener("resize", () => {
|
|
40
|
+
isDesktop.value = isDesktopWidth();
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
var useLayout = () => {
|
|
44
|
+
observeWindowWidth();
|
|
45
|
+
const onMenuToggle = () => {
|
|
46
|
+
if (layoutConfig.menuMode === "overlay") layoutState.overlayMenuActive = !layoutState.overlayMenuActive;
|
|
47
|
+
if (isDesktopWidth()) layoutState.staticMenuDesktopInactive = !layoutState.staticMenuDesktopInactive;
|
|
48
|
+
else layoutState.staticMenuMobileActive = !layoutState.staticMenuMobileActive;
|
|
49
|
+
};
|
|
50
|
+
return {
|
|
51
|
+
isDesktop,
|
|
52
|
+
isSlim: computed(() => layoutConfig.menuMode === "slim"),
|
|
53
|
+
isSlimPlus: computed(() => layoutConfig.menuMode === "slim-plus"),
|
|
54
|
+
layoutConfig: toRefs(layoutConfig),
|
|
55
|
+
layoutState: toRefs(layoutState),
|
|
56
|
+
onMenuToggle
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
//#endregion
|
|
60
|
+
export { MENU_MODES, MENU_PROFILE_POSITIONS, MOBILE_MAX_WIDTH_PX, useLayout };
|