@onereach/ui-components 2.70.3-beta.2213.0 → 2.70.3-beta.2224.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/dist/bundled/v2/{OrCardCollection-89428bbf.js → OrCardCollection-166cfcc6.js} +5 -5
- package/dist/bundled/v2/{OrConfirm-56d01cff.js → OrConfirm-55b89b17.js} +4 -4
- package/dist/bundled/v2/{OrListOfInputs-8f076650.js → OrListOfInputs-ab7f9d97.js} +4 -4
- package/dist/bundled/v2/OrNumberInput-face8ccc.js +227 -0
- package/dist/bundled/v2/OrPassword-a818e7b5.js +227 -0
- package/dist/bundled/v2/{OrSearch-f7cfa52f.js → OrSearch-832d7978.js} +4 -4
- package/dist/bundled/v2/OrSidebar-c95ef614.js +230 -0
- package/dist/bundled/v2/{OrPassword-7da938aa.js → OrTextarea-71ff236d.js} +7 -449
- package/dist/bundled/v2/components/index.d.ts +5 -1
- package/dist/bundled/v2/components/index.js +10 -8
- package/dist/bundled/v2/components/or-card-collection/index.js +4 -4
- package/dist/bundled/v2/components/or-confirm/index.js +2 -2
- package/dist/bundled/v2/components/or-input/index.d.ts +1 -0
- package/dist/bundled/v2/components/or-input/index.js +13 -0
- package/dist/bundled/v2/components/or-list-of-inputs/index.js +2 -2
- package/dist/bundled/v2/components/or-number-input/index.d.ts +1 -0
- package/dist/bundled/v2/components/or-number-input/index.js +14 -0
- package/dist/bundled/v2/components/or-password/index.d.ts +1 -0
- package/dist/bundled/v2/components/{or-inputs → or-password}/index.js +3 -4
- package/dist/bundled/v2/components/or-search/index.d.ts +1 -0
- package/dist/bundled/v2/components/or-search/index.js +25 -0
- package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
- package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
- package/dist/bundled/v2/components/or-sidebar-v3/index.js +1 -13
- package/dist/bundled/v2/components/or-sidebar-v3/styles.d.ts +1 -8
- package/dist/bundled/v2/components/or-textarea/index.d.ts +1 -0
- package/dist/bundled/v2/components/or-textarea/index.js +13 -0
- package/dist/bundled/v2/index.js +10 -8
- package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-d8124dda.js → OrCardCollection.vue_vue_type_script_lang-cd84f344.js} +4 -4
- package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-0f16fc67.js → OrConfirm.vue_vue_type_script_lang-41b4d791.js} +2 -1
- package/dist/bundled/v3/{OrInput-7d4b571a.js → OrInput-704e72ba.js} +5 -193
- package/dist/bundled/v3/OrInput.vue_vue_type_script_lang-409235cc.js +190 -0
- package/dist/bundled/v3/{OrListOfInputs.vue_vue_type_script_lang-62dbf1e7.js → OrListOfInputs.vue_vue_type_script_lang-6c5cf7a5.js} +2 -1
- package/dist/bundled/v3/OrNumberInput.vue_vue_type_script_lang-f061d829.js +113 -0
- package/dist/bundled/v3/OrPassword.vue_vue_type_script_lang-b75f6543.js +99 -0
- package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-16fbccc0.js → OrSearch.vue_vue_type_script_lang-5356fa79.js} +2 -1
- package/dist/bundled/v3/OrSidebar.vue_vue_type_script_lang-ce0b152c.js +181 -0
- package/dist/bundled/v3/OrTextarea.vue_vue_type_script_lang-69ea22e9.js +187 -0
- package/dist/bundled/v3/components/index.d.ts +5 -1
- package/dist/bundled/v3/components/index.js +11 -8
- package/dist/bundled/v3/components/or-card-collection/index.js +5 -4
- package/dist/bundled/v3/components/or-confirm/index.js +3 -2
- package/dist/bundled/v3/components/or-input/index.d.ts +1 -0
- package/dist/bundled/v3/components/or-input/index.js +14 -0
- package/dist/bundled/v3/components/or-list-of-inputs/index.js +3 -2
- package/dist/bundled/v3/components/or-number-input/index.d.ts +1 -0
- package/dist/bundled/v3/components/or-number-input/index.js +16 -0
- package/dist/bundled/v3/components/or-password/index.d.ts +1 -0
- package/dist/bundled/v3/components/or-password/index.js +31 -0
- package/dist/bundled/v3/components/or-search/index.d.ts +1 -0
- package/dist/bundled/v3/components/{or-inputs → or-search}/index.js +4 -5
- package/dist/bundled/v3/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
- package/dist/bundled/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
- package/dist/bundled/v3/components/or-sidebar-v3/index.js +1 -15
- package/dist/bundled/v3/components/or-sidebar-v3/styles.d.ts +1 -8
- package/dist/bundled/v3/components/or-textarea/index.d.ts +1 -0
- package/dist/bundled/v3/components/or-textarea/index.js +14 -0
- package/dist/bundled/v3/index.js +666 -677
- package/dist/esm/v2/{OrCardCollection-f6b07557.js → OrCardCollection-19582949.js} +6 -7
- package/dist/esm/v2/{OrConfirm-d7112dd3.js → OrConfirm-ede619eb.js} +4 -4
- package/dist/esm/v2/{OrSearch.vue_rollup-plugin-vue_script-197d77fc.js → OrInput-6e6cfd11.js} +4 -492
- package/dist/esm/v2/{OrListOfInputs-50aa1ef1.js → OrListOfInputs-4298fa2c.js} +5 -5
- package/dist/esm/v2/OrNumberInput-b20d75d2.js +225 -0
- package/dist/esm/v2/OrPassword-e6d5e968.js +225 -0
- package/dist/esm/v2/{OrSearch-0589d17d.js → OrSearch-b4f4d59b.js} +122 -5
- package/dist/esm/v2/OrSidebar-fabc7bc9.js +228 -0
- package/dist/esm/v2/{OrPassword-1fa97156.js → OrTextarea-91a95068.js} +187 -245
- package/dist/esm/v2/components/index.d.ts +5 -1
- package/dist/esm/v2/components/index.js +10 -8
- package/dist/esm/v2/components/or-card-collection/index.js +3 -4
- package/dist/esm/v2/components/or-confirm/index.js +2 -3
- package/dist/esm/v2/components/or-input/index.d.ts +1 -0
- package/dist/esm/v2/components/or-input/index.js +11 -0
- package/dist/esm/v2/components/or-list-of-inputs/index.js +2 -4
- package/dist/esm/v2/components/or-number-input/index.d.ts +1 -0
- package/dist/esm/v2/components/or-number-input/index.js +12 -0
- package/dist/esm/v2/components/or-password/index.d.ts +1 -0
- package/dist/esm/v2/components/{or-inputs → or-password}/index.js +5 -6
- package/dist/esm/v2/components/or-search/index.d.ts +1 -0
- package/dist/esm/v2/components/or-search/index.js +23 -0
- package/dist/esm/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
- package/dist/esm/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
- package/dist/esm/v2/components/or-sidebar-v3/index.js +1 -13
- package/dist/esm/v2/components/or-sidebar-v3/styles.d.ts +1 -8
- package/dist/esm/v2/components/or-textarea/index.d.ts +1 -0
- package/dist/esm/v2/components/or-textarea/index.js +11 -0
- package/dist/esm/v2/index.js +9 -7
- package/dist/esm/v3/{OrCardCollection-a5e326ef.js → OrCardCollection-1e44c758.js} +2 -2
- package/dist/esm/v3/{OrConfirm-f39bd784.js → OrConfirm-c11ee2ec.js} +1 -1
- package/dist/esm/v3/OrInput-81125804.js +295 -0
- package/dist/esm/v3/{OrListOfInputs-7a67440f.js → OrListOfInputs-508e056f.js} +1 -1
- package/dist/esm/v3/OrNumberInput-b32b5ce3.js +170 -0
- package/dist/esm/v3/OrPassword-b0cbb578.js +162 -0
- package/dist/esm/v3/OrSearch-11fdf667.js +188 -0
- package/dist/esm/v3/OrSidebar-a62972f5.js +206 -0
- package/dist/esm/v3/OrTextarea-1f5c3be1.js +290 -0
- package/dist/esm/v3/components/index.d.ts +5 -1
- package/dist/esm/v3/components/index.js +10 -6
- package/dist/esm/v3/components/or-card-collection/index.js +3 -3
- package/dist/esm/v3/components/or-confirm/index.js +2 -3
- package/dist/esm/v3/components/or-input/index.d.ts +1 -0
- package/dist/esm/v3/components/or-input/index.js +11 -0
- package/dist/esm/v3/components/or-list-of-inputs/index.js +2 -4
- package/dist/esm/v3/components/or-number-input/index.d.ts +1 -0
- package/dist/esm/v3/components/or-number-input/index.js +12 -0
- package/dist/esm/v3/components/or-password/index.d.ts +1 -0
- package/dist/esm/v3/components/{or-inputs → or-password}/index.js +3 -2
- package/dist/esm/v3/components/or-search/index.d.ts +1 -0
- package/dist/esm/v3/components/or-search/index.js +20 -0
- package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
- package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
- package/dist/esm/v3/components/or-sidebar-v3/index.js +1 -12
- package/dist/esm/v3/components/or-sidebar-v3/styles.d.ts +1 -8
- package/dist/esm/v3/components/or-textarea/index.d.ts +1 -0
- package/dist/esm/v3/components/or-textarea/index.js +11 -0
- package/dist/esm/v3/index.js +9 -5
- package/package.json +1 -1
- package/src/components/index.ts +5 -1
- package/src/components/or-card-collection/OrCardCollection.vue +8 -8
- package/src/components/or-confirm/OrConfirm.vue +1 -1
- package/src/components/or-input/index.ts +1 -0
- package/src/components/or-list/OrList.stories.ts +1 -1
- package/src/components/or-list-of-inputs/OrListOfInputs.vue +1 -1
- package/src/components/or-modal/OrModal.stories.ts +1 -1
- package/src/components/{or-inputs → or-number-input}/OrNumberInput.vue +1 -1
- package/src/components/or-number-input/index.ts +1 -0
- package/src/components/{or-inputs → or-password}/OrPassword.vue +1 -1
- package/src/components/or-password/index.ts +1 -0
- package/src/components/{or-inputs → or-search}/OrSearch.vue +1 -1
- package/src/components/or-search/index.ts +1 -0
- package/src/components/or-sidebar-v3/OrSidebar.docs.mdx +0 -6
- package/src/components/or-sidebar-v3/OrSidebar.stories3.ts +10 -230
- package/src/components/or-sidebar-v3/OrSidebar.vue +22 -121
- package/src/components/or-sidebar-v3/styles.ts +9 -161
- package/src/components/{or-inputs → or-textarea}/OrTextarea.vue +225 -6
- package/src/components/or-textarea/index.ts +1 -0
- package/dist/bundled/v2/OrSidebar-774b382d.js +0 -462
- package/dist/bundled/v2/components/or-inputs/index.d.ts +0 -5
- package/dist/bundled/v2/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
- package/dist/bundled/v2/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -53
- package/dist/bundled/v3/OrPassword.vue_vue_type_script_lang-13bc5b00.js +0 -390
- package/dist/bundled/v3/OrSidebar.vue_vue_type_script_lang-8305a28b.js +0 -354
- package/dist/bundled/v3/components/or-inputs/index.d.ts +0 -5
- package/dist/bundled/v3/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
- package/dist/bundled/v3/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -53
- package/dist/esm/v2/OrSidebar-a6ee22d1.js +0 -459
- package/dist/esm/v2/components/or-inputs/index.d.ts +0 -5
- package/dist/esm/v2/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
- package/dist/esm/v2/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -53
- package/dist/esm/v3/OrSearch-7cb2c91c.js +0 -1075
- package/dist/esm/v3/OrSidebar-f2150587.js +0 -394
- package/dist/esm/v3/components/or-inputs/index.d.ts +0 -5
- package/dist/esm/v3/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
- package/dist/esm/v3/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -53
- package/src/components/or-inputs/index.ts +0 -5
- package/src/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.ts +0 -48
- package/src/components/or-sidebar-v3/OrSidebarCollapseButton.vue +0 -74
- /package/dist/bundled/v2/{OrInput-08f2f666.js → OrInput-df1a14fa.js} +0 -0
- /package/dist/bundled/v2/components/{or-inputs → or-input}/OrInput.vue.d.ts +0 -0
- /package/dist/bundled/v2/components/{or-inputs → or-number-input}/OrNumberInput.vue.d.ts +0 -0
- /package/dist/bundled/v2/components/{or-inputs → or-password}/OrPassword.vue.d.ts +0 -0
- /package/dist/bundled/v2/components/{or-inputs → or-search}/OrSearch.vue.d.ts +0 -0
- /package/dist/bundled/v2/components/{or-inputs → or-textarea}/OrTextarea.vue.d.ts +0 -0
- /package/dist/bundled/v3/components/{or-inputs → or-input}/OrInput.vue.d.ts +0 -0
- /package/dist/bundled/v3/components/{or-inputs → or-number-input}/OrNumberInput.vue.d.ts +0 -0
- /package/dist/bundled/v3/components/{or-inputs → or-password}/OrPassword.vue.d.ts +0 -0
- /package/dist/bundled/v3/components/{or-inputs → or-search}/OrSearch.vue.d.ts +0 -0
- /package/dist/bundled/v3/components/{or-inputs → or-textarea}/OrTextarea.vue.d.ts +0 -0
- /package/dist/esm/v2/components/{or-inputs → or-input}/OrInput.vue.d.ts +0 -0
- /package/dist/esm/v2/components/{or-inputs → or-number-input}/OrNumberInput.vue.d.ts +0 -0
- /package/dist/esm/v2/components/{or-inputs → or-password}/OrPassword.vue.d.ts +0 -0
- /package/dist/esm/v2/components/{or-inputs → or-search}/OrSearch.vue.d.ts +0 -0
- /package/dist/esm/v2/components/{or-inputs → or-textarea}/OrTextarea.vue.d.ts +0 -0
- /package/dist/esm/v3/components/{or-inputs → or-input}/OrInput.vue.d.ts +0 -0
- /package/dist/esm/v3/components/{or-inputs → or-number-input}/OrNumberInput.vue.d.ts +0 -0
- /package/dist/esm/v3/components/{or-inputs → or-password}/OrPassword.vue.d.ts +0 -0
- /package/dist/esm/v3/components/{or-inputs → or-search}/OrSearch.vue.d.ts +0 -0
- /package/dist/esm/v3/components/{or-inputs → or-textarea}/OrTextarea.vue.d.ts +0 -0
- /package/src/components/{or-inputs → or-input}/OrInput.stories.ts +0 -0
- /package/src/components/{or-inputs → or-input}/OrInput.vue +0 -0
- /package/src/components/{or-inputs → or-input}/or-textbox-migration.stories.mdx +0 -0
- /package/src/components/{or-inputs → or-input}/styles.scss +0 -0
- /package/src/components/{or-inputs → or-number-input}/OrNumberInput.stories.ts +0 -0
- /package/src/components/{or-inputs → or-password}/OrPassword.stories.ts +0 -0
- /package/src/components/{or-inputs → or-search}/OrSearch.stories.ts +0 -0
- /package/src/components/{or-inputs → or-textarea}/OrTextarea.stories.ts +0 -0
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { useDraggable, useElementBounding } from '@vueuse/core';
|
|
2
|
+
import _ from 'lodash';
|
|
3
|
+
import './index-fa6eb4ca.js';
|
|
4
|
+
import { defineComponent, ref, computed, watch } from '@vue/composition-api/dist/vue-composition-api.mjs';
|
|
5
|
+
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
6
|
+
|
|
7
|
+
var OrSidebarPlacement;
|
|
8
|
+
(function (OrSidebarPlacement) {
|
|
9
|
+
OrSidebarPlacement["left"] = "left";
|
|
10
|
+
OrSidebarPlacement["right"] = "right";
|
|
11
|
+
})(OrSidebarPlacement || (OrSidebarPlacement = {}));
|
|
12
|
+
|
|
13
|
+
const SidebarRoot = [
|
|
14
|
+
// Position
|
|
15
|
+
'relative',
|
|
16
|
+
// Layout
|
|
17
|
+
'flex', 'flex-col', 'shrink-0',
|
|
18
|
+
// Box
|
|
19
|
+
'min-h-0', 'p-0'];
|
|
20
|
+
const SidebarRootSides = {
|
|
21
|
+
[OrSidebarPlacement.left]: [
|
|
22
|
+
// Borders
|
|
23
|
+
'border-r-[1px]', 'border-r-solid', 'border-r-secondary dark:border-r-secondary-dark'],
|
|
24
|
+
[OrSidebarPlacement.right]: [
|
|
25
|
+
// Borders
|
|
26
|
+
'border-l-[1px]', 'border-l-solid', 'border-l-secondary dark:border-l-secondary-dark']
|
|
27
|
+
};
|
|
28
|
+
const SidebarResize = [
|
|
29
|
+
// Position
|
|
30
|
+
'absolute', 'inset-y-none', 'z-[1]',
|
|
31
|
+
// Box
|
|
32
|
+
'w-[12px]', 'h-[100%]',
|
|
33
|
+
// Cursor
|
|
34
|
+
'cursor-ew-resize'];
|
|
35
|
+
const SidebarResizeSides = {
|
|
36
|
+
[OrSidebarPlacement.left]: [
|
|
37
|
+
// Position
|
|
38
|
+
'-right-[1px]',
|
|
39
|
+
// Borders
|
|
40
|
+
'hover:border-r-2', 'hover:border-r-primary hover:dark:border-r-primary-dark',
|
|
41
|
+
// Transition
|
|
42
|
+
'transition-[border-right]'],
|
|
43
|
+
[OrSidebarPlacement.right]: [
|
|
44
|
+
// Position
|
|
45
|
+
'-left-[1px]',
|
|
46
|
+
// Borders
|
|
47
|
+
'hover:border-l-2', 'hover:border-l-primary hover:dark:border-l-primary-dark',
|
|
48
|
+
// Transition
|
|
49
|
+
'transition-[border-left]']
|
|
50
|
+
};
|
|
51
|
+
const SidebarResizingSides = {
|
|
52
|
+
[OrSidebarPlacement.left]: [
|
|
53
|
+
// Borders
|
|
54
|
+
'border-r-2', 'border-r-primary dark:border-r-primary-dark'],
|
|
55
|
+
[OrSidebarPlacement.right]: [
|
|
56
|
+
// Borders
|
|
57
|
+
'border-l-2', 'border-l-primary dark:border-l-primary-dark']
|
|
58
|
+
};
|
|
59
|
+
const SidebarMain = [
|
|
60
|
+
// Layout
|
|
61
|
+
'flex', 'flex-col', 'grow',
|
|
62
|
+
// Box
|
|
63
|
+
'min-h-0'];
|
|
64
|
+
const SidebarHeader = [
|
|
65
|
+
// Sizing
|
|
66
|
+
'p-md'];
|
|
67
|
+
const SidebarContent = [
|
|
68
|
+
// Layout
|
|
69
|
+
'grow', 'overflow-auto',
|
|
70
|
+
// Sizing
|
|
71
|
+
'p-md'];
|
|
72
|
+
const SidebarFooter = [
|
|
73
|
+
// Sizing
|
|
74
|
+
'p-md',
|
|
75
|
+
// Borders
|
|
76
|
+
'border-t-[1px]', 'border-t-solid', 'border-t-secondary dark:border-t-secondary-dark'];
|
|
77
|
+
|
|
78
|
+
var script = defineComponent({
|
|
79
|
+
name: 'OrSidebar',
|
|
80
|
+
props: {
|
|
81
|
+
width: {
|
|
82
|
+
type: Number,
|
|
83
|
+
required: false,
|
|
84
|
+
default: 0,
|
|
85
|
+
validator: value => _.isNumber(value) && value >= 0
|
|
86
|
+
},
|
|
87
|
+
minimumWidth: {
|
|
88
|
+
type: Number,
|
|
89
|
+
required: false,
|
|
90
|
+
default: 350,
|
|
91
|
+
validator: value => _.isNumber(value) && value >= 0
|
|
92
|
+
},
|
|
93
|
+
/**
|
|
94
|
+
* User may put the component on the right or the left side of a container.
|
|
95
|
+
* This property mirrors the resizing behavior (drag direction) and styling (horizontal border) of the sidebar.
|
|
96
|
+
*
|
|
97
|
+
* Note: the property doesn't reposition the component in the parent container.
|
|
98
|
+
* @values left, right
|
|
99
|
+
*/
|
|
100
|
+
side: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: OrSidebarPlacement.right,
|
|
103
|
+
validator: value => _.includes(_.values(OrSidebarPlacement), value)
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
emits: ['change:width'],
|
|
107
|
+
setup(props, {
|
|
108
|
+
emit
|
|
109
|
+
}) {
|
|
110
|
+
// Refs
|
|
111
|
+
const root = ref();
|
|
112
|
+
const resizeBar = ref(null);
|
|
113
|
+
const parentContainer = computed(() => {
|
|
114
|
+
var _a;
|
|
115
|
+
return (_a = root.value) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
116
|
+
});
|
|
117
|
+
// State
|
|
118
|
+
const startPositionX = ref(0);
|
|
119
|
+
const isResizing = ref(false);
|
|
120
|
+
const localWidth = ref(props.width >= props.minimumWidth ? props.width : props.minimumWidth);
|
|
121
|
+
// Styles
|
|
122
|
+
const sidebarStyle = computed(() => ({
|
|
123
|
+
width: localWidth.value + 'px'
|
|
124
|
+
}));
|
|
125
|
+
const rootStyles = computed(() => ['or-sidebar', ...SidebarRoot, ...SidebarRootSides[props.side]]);
|
|
126
|
+
const resizeStyles = computed(() => [...SidebarResize, ...SidebarResizeSides[props.side], ...(isResizing.value ? SidebarResizingSides[props.side] : [])]);
|
|
127
|
+
const mainStyles = computed(() => [...SidebarMain]);
|
|
128
|
+
const headerStyles = computed(() => [...SidebarHeader]);
|
|
129
|
+
const contentStyles = computed(() => [...SidebarContent]);
|
|
130
|
+
const footerStyles = computed(() => [...SidebarFooter]);
|
|
131
|
+
// Effects
|
|
132
|
+
useDraggable(resizeBar, {
|
|
133
|
+
preventDefault: true,
|
|
134
|
+
onStart: (position, event) => {
|
|
135
|
+
document.body.style.cursor = 'ew-resize';
|
|
136
|
+
document.body.style.userSelect = 'none';
|
|
137
|
+
startPositionX.value = event.x;
|
|
138
|
+
isResizing.value = true;
|
|
139
|
+
},
|
|
140
|
+
onMove: position => {
|
|
141
|
+
const delta = (position.x - startPositionX.value) * (props.side === OrSidebarPlacement.left ? -1 : 1);
|
|
142
|
+
const newWidth = localWidth.value - delta;
|
|
143
|
+
localWidth.value = newWidth > maximumWidth.value ? maximumWidth.value : newWidth < props.minimumWidth ? props.minimumWidth : newWidth;
|
|
144
|
+
startPositionX.value = position.x;
|
|
145
|
+
},
|
|
146
|
+
onEnd: () => {
|
|
147
|
+
document.body.style.cursor = '';
|
|
148
|
+
document.body.style.userSelect = '';
|
|
149
|
+
isResizing.value = false;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
const {
|
|
153
|
+
width: maximumWidth
|
|
154
|
+
} = useElementBounding(parentContainer);
|
|
155
|
+
watch(() => props.width, newValue => {
|
|
156
|
+
if (newValue !== localWidth.value) {
|
|
157
|
+
localWidth.value = newValue > maximumWidth.value ? maximumWidth.value : newValue < props.minimumWidth ? props.minimumWidth : newValue;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
watch(() => props.minimumWidth, newMinimum => {
|
|
161
|
+
if (newMinimum > localWidth.value) localWidth.value = newMinimum;
|
|
162
|
+
});
|
|
163
|
+
watch(maximumWidth, newMaximum => {
|
|
164
|
+
if (newMaximum < localWidth.value) localWidth.value = newMaximum;
|
|
165
|
+
});
|
|
166
|
+
watch(localWidth, val => emit('change:width', val));
|
|
167
|
+
return {
|
|
168
|
+
root,
|
|
169
|
+
resizeBar,
|
|
170
|
+
isResizing,
|
|
171
|
+
localWidth,
|
|
172
|
+
sidebarStyle,
|
|
173
|
+
rootStyles,
|
|
174
|
+
resizeStyles,
|
|
175
|
+
mainStyles,
|
|
176
|
+
headerStyles,
|
|
177
|
+
contentStyles,
|
|
178
|
+
footerStyles
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
/* script */
|
|
184
|
+
const __vue_script__ = script;
|
|
185
|
+
|
|
186
|
+
/* template */
|
|
187
|
+
var __vue_render__ = function () {
|
|
188
|
+
var _vm = this;
|
|
189
|
+
var _h = _vm.$createElement;
|
|
190
|
+
var _c = _vm._self._c || _h;
|
|
191
|
+
return _c('aside', {
|
|
192
|
+
ref: "root",
|
|
193
|
+
class: _vm.rootStyles,
|
|
194
|
+
style: _vm.sidebarStyle
|
|
195
|
+
}, [_c('div', {
|
|
196
|
+
ref: "resizeBar",
|
|
197
|
+
class: _vm.resizeStyles
|
|
198
|
+
}), _vm._v(" "), _c('div', {
|
|
199
|
+
class: _vm.mainStyles
|
|
200
|
+
}, [_vm.$slots.header ? _c('div', {
|
|
201
|
+
class: _vm.headerStyles
|
|
202
|
+
}, [_vm._t("header")], 2) : _vm._e(), _vm._v(" "), _c('div', {
|
|
203
|
+
class: _vm.contentStyles
|
|
204
|
+
}, [_vm._t("default")], 2)]), _vm._v(" "), _vm.$slots.footer ? _c('div', {
|
|
205
|
+
class: _vm.footerStyles
|
|
206
|
+
}, [_vm._t("footer")], 2) : _vm._e()]);
|
|
207
|
+
};
|
|
208
|
+
var __vue_staticRenderFns__ = [];
|
|
209
|
+
|
|
210
|
+
/* style */
|
|
211
|
+
const __vue_inject_styles__ = undefined;
|
|
212
|
+
/* scoped */
|
|
213
|
+
const __vue_scope_id__ = undefined;
|
|
214
|
+
/* module identifier */
|
|
215
|
+
const __vue_module_identifier__ = undefined;
|
|
216
|
+
/* functional template */
|
|
217
|
+
const __vue_is_functional_template__ = false;
|
|
218
|
+
/* style inject */
|
|
219
|
+
|
|
220
|
+
/* style inject SSR */
|
|
221
|
+
|
|
222
|
+
/* style inject shadow dom */
|
|
223
|
+
|
|
224
|
+
const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
225
|
+
render: __vue_render__,
|
|
226
|
+
staticRenderFns: __vue_staticRenderFns__
|
|
227
|
+
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
228
|
+
var __vue_component__$1 = __vue_component__;
|
|
229
|
+
|
|
230
|
+
export { OrSidebarPlacement as O, __vue_component__$1 as _ };
|