@onereach/ui-components 2.70.3-beta.2213.0 → 2.71.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/{OrConfirm-23c3ce56.js → OrConfirm-057e997e.js} +12 -5
- package/dist/bundled/v2/OrSidebar-c95ef614.js +230 -0
- package/dist/bundled/v2/components/index.js +2 -2
- package/dist/bundled/v2/components/or-confirm-v3/index.js +3 -3
- 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/index.js +3 -3
- package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-05b21989.js → OrConfirm.vue_vue_type_script_lang-9d9a3917.js} +12 -5
- package/dist/bundled/v3/OrSidebar.vue_vue_type_script_lang-ce0b152c.js +181 -0
- package/dist/bundled/v3/components/index.js +2 -2
- package/dist/bundled/v3/components/or-confirm-v3/index.js +2 -2
- 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/index.js +11 -27
- package/dist/esm/v2/{OrConfirm-e2ab9b4c.js → OrConfirm-047d4086.js} +13 -6
- package/dist/esm/v2/OrSidebar-fabc7bc9.js +228 -0
- package/dist/esm/v2/components/index.js +2 -2
- package/dist/esm/v2/components/or-confirm-v3/index.js +7 -7
- 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/index.js +2 -2
- package/dist/esm/v3/{OrConfirm-1bcd39b1.js → OrConfirm-fee3c859.js} +13 -6
- package/dist/esm/v3/OrSidebar-a62972f5.js +206 -0
- package/dist/esm/v3/components/index.js +2 -2
- package/dist/esm/v3/components/or-confirm-v3/index.js +6 -6
- 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/index.js +2 -2
- package/package.json +3 -2
- package/src/components/or-confirm-v3/OrConfirm.vue +11 -10
- package/src/components/or-confirm-v3/styles.ts +13 -3
- 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/dist/bundled/v2/OrSidebar-774b382d.js +0 -462
- 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/OrSidebar.vue_vue_type_script_lang-8305a28b.js +0 -354
- 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-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/OrSidebar-f2150587.js +0 -394
- 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-sidebar-v3/OrSidebarCollapseButton.stories3.ts +0 -48
- package/src/components/or-sidebar-v3/OrSidebarCollapseButton.vue +0 -74
|
@@ -1,462 +0,0 @@
|
|
|
1
|
-
import { useDraggable, useElementBounding } from '@vueuse/core';
|
|
2
|
-
import _ from 'lodash';
|
|
3
|
-
import './index-fa6eb4ca.js';
|
|
4
|
-
import { O as OrIconButton } from './OrIconButton-a2ba92df.js';
|
|
5
|
-
import { defineComponent, ref, computed, useSlots, watch } from '@vue/composition-api/dist/vue-composition-api.mjs';
|
|
6
|
-
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
7
|
-
|
|
8
|
-
var OrSidebarPlacement;
|
|
9
|
-
(function (OrSidebarPlacement) {
|
|
10
|
-
OrSidebarPlacement["left"] = "left";
|
|
11
|
-
OrSidebarPlacement["right"] = "right";
|
|
12
|
-
})(OrSidebarPlacement || (OrSidebarPlacement = {}));
|
|
13
|
-
|
|
14
|
-
const SidebarRoot = [
|
|
15
|
-
// Position
|
|
16
|
-
'relative',
|
|
17
|
-
// Layout
|
|
18
|
-
'flex', 'flex-row', 'shrink-0',
|
|
19
|
-
// Box
|
|
20
|
-
'min-w-0', 'h-auto', 'p-0',
|
|
21
|
-
// Theme
|
|
22
|
-
'bg-background', 'dark:bg-background-dark'];
|
|
23
|
-
const SidebarBar = [
|
|
24
|
-
// Position
|
|
25
|
-
'relative',
|
|
26
|
-
// Layout
|
|
27
|
-
'flex', 'flex-col', 'shrink-0', 'grow',
|
|
28
|
-
// Box
|
|
29
|
-
'min-h-0', 'p-0',
|
|
30
|
-
// Theme
|
|
31
|
-
'text-on-background', 'dark:text-on-background-dark',
|
|
32
|
-
// Transition
|
|
33
|
-
'transition-[width]'];
|
|
34
|
-
const SidebarToolbar = [
|
|
35
|
-
// Position
|
|
36
|
-
'relative',
|
|
37
|
-
// Layout
|
|
38
|
-
'flex', 'flex-col', 'shrink-0', 'grow', 'overflow-auto', 'items-center',
|
|
39
|
-
// Sizing
|
|
40
|
-
'gap-md',
|
|
41
|
-
// Box
|
|
42
|
-
'min-h-0', 'min-w-xl', 'p-[6px]', 'pt-[56px]', 'pb-md+',
|
|
43
|
-
// Theme
|
|
44
|
-
'text-outline', 'dark:text-outline-dark'];
|
|
45
|
-
const SidebarSides = {
|
|
46
|
-
[OrSidebarPlacement.left]: [
|
|
47
|
-
// Borders
|
|
48
|
-
'border-r-[1px]', 'border-r-solid', 'border-r-outline-variant dark:border-r-outline-variant-dark'],
|
|
49
|
-
[OrSidebarPlacement.right]: [
|
|
50
|
-
// Borders
|
|
51
|
-
'border-l-[1px]', 'border-l-solid', 'border-l-outline-variant dark:border-l-outline-variant-dark']
|
|
52
|
-
};
|
|
53
|
-
const SidebarToolbarSides = {
|
|
54
|
-
[OrSidebarPlacement.left]: [
|
|
55
|
-
// Borders
|
|
56
|
-
'border-r-[1px]', 'border-r-solid', 'border-r-outline-variant dark:border-r-outline-variant-dark'],
|
|
57
|
-
[OrSidebarPlacement.right]: [
|
|
58
|
-
// Borders
|
|
59
|
-
'border-l-[1px]', 'border-l-solid', 'border-l-outline-variant dark:border-l-outline-variant-dark']
|
|
60
|
-
};
|
|
61
|
-
const SidebarResize = [
|
|
62
|
-
// Position
|
|
63
|
-
'absolute', 'inset-y-none', 'z-[1]',
|
|
64
|
-
// Box
|
|
65
|
-
'w-sm+', 'h-[100%]',
|
|
66
|
-
// Cursor
|
|
67
|
-
'cursor-ew-resize'];
|
|
68
|
-
const SidebarResizeSides = {
|
|
69
|
-
[OrSidebarPlacement.left]: [
|
|
70
|
-
// Position
|
|
71
|
-
'-right-[1px]',
|
|
72
|
-
// Borders
|
|
73
|
-
'hover:border-r-2', 'hover:border-r-primary-hover hover:dark:border-r-primary-hover-dark',
|
|
74
|
-
// Transition
|
|
75
|
-
'transition-[border-right]'],
|
|
76
|
-
[OrSidebarPlacement.right]: [
|
|
77
|
-
// Position
|
|
78
|
-
'-left-[1px]',
|
|
79
|
-
// Borders
|
|
80
|
-
'hover:border-l-2', 'hover:border-l-primary-hover hover:dark:border-l-primary-hover-dark',
|
|
81
|
-
// Transition
|
|
82
|
-
'transition-[border-left]']
|
|
83
|
-
};
|
|
84
|
-
const SidebarCollapseButton = [
|
|
85
|
-
// Position
|
|
86
|
-
'absolute', 'top-md', 'inset-y-none', 'z-[1]'];
|
|
87
|
-
const SidebarCollapseButtonSides = {
|
|
88
|
-
[OrSidebarPlacement.left]: [
|
|
89
|
-
// Position
|
|
90
|
-
'-right-[12px]'],
|
|
91
|
-
[OrSidebarPlacement.right]: [
|
|
92
|
-
// Position
|
|
93
|
-
'-left-[12px]']
|
|
94
|
-
};
|
|
95
|
-
const SidebarResizingSides = {
|
|
96
|
-
[OrSidebarPlacement.left]: [
|
|
97
|
-
// Borders
|
|
98
|
-
'border-r-2', 'border-r-primary-hover dark:border-r-primary-hover-dark'],
|
|
99
|
-
[OrSidebarPlacement.right]: [
|
|
100
|
-
// Borders
|
|
101
|
-
'border-l-2', 'border-l-primary-hover dark:border-l-primary-hover-dark']
|
|
102
|
-
};
|
|
103
|
-
const SidebarMain = [
|
|
104
|
-
// Layout
|
|
105
|
-
'flex', 'flex-col', 'grow', 'overflow-x-hidden',
|
|
106
|
-
// Box
|
|
107
|
-
'min-h-0'];
|
|
108
|
-
const SidebarHeader = [
|
|
109
|
-
// Layout
|
|
110
|
-
'shrink-0', 'overflow-hidden',
|
|
111
|
-
// Sizing
|
|
112
|
-
'p-md',
|
|
113
|
-
// Typography
|
|
114
|
-
'typography-headline-2', 'whitespace-nowrap', 'text-ellipsis'];
|
|
115
|
-
const SidebarContent = [
|
|
116
|
-
// Layout
|
|
117
|
-
'grow', 'overflow-auto',
|
|
118
|
-
// Sizing
|
|
119
|
-
'p-md'];
|
|
120
|
-
const SidebarFooter = [
|
|
121
|
-
// Layout
|
|
122
|
-
'shrink-0', 'overflow-x-hidden',
|
|
123
|
-
// Sizing
|
|
124
|
-
'p-md',
|
|
125
|
-
// Borders
|
|
126
|
-
'border-t-[1px]', 'border-t-solid', 'border-t-outline-variant dark:border-t-outline-variant-dark'];
|
|
127
|
-
const CollapseButtonContainer = [
|
|
128
|
-
// Box
|
|
129
|
-
'w-[24px]', 'h-[24px]', 'rounded-full',
|
|
130
|
-
// Theme
|
|
131
|
-
'text-primary dark:text-primary-dark', 'bg-background dark:bg-background-dark'];
|
|
132
|
-
const CollapseButton = [
|
|
133
|
-
// Box
|
|
134
|
-
'w-[24px]', 'h-[24px]',
|
|
135
|
-
// Typography
|
|
136
|
-
'!text-[16px]',
|
|
137
|
-
// Borders
|
|
138
|
-
'!border-[1px]', '!border-solid',
|
|
139
|
-
// Theme
|
|
140
|
-
'!text-primary dark:!text-primary-dark', '!bg-background dark:!bg-background-dark', '!border-outline-variant dark:!border-outline-variant-dark', '!outline-none',
|
|
141
|
-
// Theme (hover)
|
|
142
|
-
'hover:!text-primary hover:dark:!text-primary-dark', 'hover:!bg-primary-opacity-0-08 dark:hover:!bg-primary-opacity-0-08-dark', 'hover:!border-outline dark:hover:!border-outline-dark',
|
|
143
|
-
// Theme (active)
|
|
144
|
-
'active:!text-primary active:dark:!text-primary-dark', 'active:!bg-primary-opacity-0-12 dark:active:!bg-primary-opacity-0-12-dark', 'active:!border-primary dark:active:!border-primary-dark',
|
|
145
|
-
// Theme (focus)
|
|
146
|
-
'focus:!text-primary focus:dark:!text-primary-dark', 'focus:!bg-primary-opacity-0-12 dark:focus:!bg-primary-opacity-0-12-dark', 'focus:!border-outline dark:focus:!border-outline-dark',
|
|
147
|
-
// Theme (disabled)
|
|
148
|
-
'disabled:!text-on-disabled disabled:dark:!text-on-disabled-dark', 'disabled:!bg-background disabled:dark:!bg-background-dark', 'disabled:!border-outline-variant disabled:dark:!border-outline-variant-dark'];
|
|
149
|
-
|
|
150
|
-
var script$1 = defineComponent({
|
|
151
|
-
name: 'OrSidebarCollapseButton',
|
|
152
|
-
components: {
|
|
153
|
-
OrIconButton
|
|
154
|
-
},
|
|
155
|
-
props: {
|
|
156
|
-
/**
|
|
157
|
-
* Must be `true` if sidebar is collapsed.
|
|
158
|
-
*/
|
|
159
|
-
modelValue: {
|
|
160
|
-
type: Boolean,
|
|
161
|
-
default: false
|
|
162
|
-
},
|
|
163
|
-
side: {
|
|
164
|
-
type: String,
|
|
165
|
-
default: OrSidebarPlacement.right,
|
|
166
|
-
validator: value => _.includes(_.values(OrSidebarPlacement), value)
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
emits: ['update:modelValue'],
|
|
170
|
-
expose: ['root'],
|
|
171
|
-
setup(props) {
|
|
172
|
-
// Refs
|
|
173
|
-
const root = ref();
|
|
174
|
-
const rootStyles = computed(() => ['or-sidebar-collapse-button', ...CollapseButtonContainer]);
|
|
175
|
-
const buttonStyles = computed(() => [...CollapseButton]);
|
|
176
|
-
const icon = computed(() => props.side === OrSidebarPlacement.left !== props.modelValue ? 'keyboard_arrow_left' : 'keyboard_arrow_right');
|
|
177
|
-
return {
|
|
178
|
-
root,
|
|
179
|
-
rootStyles,
|
|
180
|
-
buttonStyles,
|
|
181
|
-
icon
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
/* script */
|
|
187
|
-
const __vue_script__$1 = script$1;
|
|
188
|
-
|
|
189
|
-
/* template */
|
|
190
|
-
var __vue_render__$1 = function () {
|
|
191
|
-
var _vm = this;
|
|
192
|
-
var _h = _vm.$createElement;
|
|
193
|
-
var _c = _vm._self._c || _h;
|
|
194
|
-
return _c('div', {
|
|
195
|
-
ref: "root",
|
|
196
|
-
class: _vm.rootStyles
|
|
197
|
-
}, [_c('or-icon-button', {
|
|
198
|
-
class: _vm.buttonStyles,
|
|
199
|
-
attrs: {
|
|
200
|
-
"icon": {
|
|
201
|
-
icon: _vm.icon,
|
|
202
|
-
size: 'inherit'
|
|
203
|
-
},
|
|
204
|
-
"color": "inherit"
|
|
205
|
-
},
|
|
206
|
-
on: {
|
|
207
|
-
"click": function ($event) {
|
|
208
|
-
return _vm.$emit('update:modelValue', !_vm.modelValue);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
})], 1);
|
|
212
|
-
};
|
|
213
|
-
var __vue_staticRenderFns__$1 = [];
|
|
214
|
-
|
|
215
|
-
/* style */
|
|
216
|
-
const __vue_inject_styles__$1 = undefined;
|
|
217
|
-
/* scoped */
|
|
218
|
-
const __vue_scope_id__$1 = undefined;
|
|
219
|
-
/* module identifier */
|
|
220
|
-
const __vue_module_identifier__$1 = undefined;
|
|
221
|
-
/* functional template */
|
|
222
|
-
const __vue_is_functional_template__$1 = false;
|
|
223
|
-
/* style inject */
|
|
224
|
-
|
|
225
|
-
/* style inject SSR */
|
|
226
|
-
|
|
227
|
-
/* style inject shadow dom */
|
|
228
|
-
|
|
229
|
-
const __vue_component__$2 = /*#__PURE__*/normalizeComponent({
|
|
230
|
-
render: __vue_render__$1,
|
|
231
|
-
staticRenderFns: __vue_staticRenderFns__$1
|
|
232
|
-
}, __vue_inject_styles__$1, __vue_script__$1, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, false, undefined, undefined, undefined);
|
|
233
|
-
var OrSidebarCollapseButton = __vue_component__$2;
|
|
234
|
-
|
|
235
|
-
var script = defineComponent({
|
|
236
|
-
name: 'OrSidebar',
|
|
237
|
-
components: {
|
|
238
|
-
OrSidebarCollapseButton
|
|
239
|
-
},
|
|
240
|
-
props: {
|
|
241
|
-
width: {
|
|
242
|
-
type: Number,
|
|
243
|
-
default: 320,
|
|
244
|
-
validator: value => _.isNumber(value) && value >= 0
|
|
245
|
-
},
|
|
246
|
-
minimumWidth: {
|
|
247
|
-
type: Number,
|
|
248
|
-
default: 256,
|
|
249
|
-
validator: value => _.isNumber(value) && value >= 0
|
|
250
|
-
},
|
|
251
|
-
maximumWidth: {
|
|
252
|
-
type: Number,
|
|
253
|
-
default: 384,
|
|
254
|
-
validator: value => _.isNumber(value) && value >= 0
|
|
255
|
-
},
|
|
256
|
-
/**
|
|
257
|
-
* User may put the component on the right or the left side of a container.
|
|
258
|
-
* This property mirrors the resizing behavior (drag direction) and styling (horizontal border) of the sidebar.
|
|
259
|
-
*
|
|
260
|
-
* Note: the property doesn't reposition the component in the parent container.
|
|
261
|
-
* @values left, right
|
|
262
|
-
*/
|
|
263
|
-
side: {
|
|
264
|
-
type: String,
|
|
265
|
-
default: OrSidebarPlacement.right,
|
|
266
|
-
validator: value => _.includes(_.values(OrSidebarPlacement), value)
|
|
267
|
-
},
|
|
268
|
-
draggable: {
|
|
269
|
-
type: Boolean,
|
|
270
|
-
default: true
|
|
271
|
-
},
|
|
272
|
-
collapsible: {
|
|
273
|
-
type: Boolean,
|
|
274
|
-
default: false
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
emits: ['change:width'],
|
|
278
|
-
expose: ['root', 'open', 'close'],
|
|
279
|
-
setup(props, {
|
|
280
|
-
emit
|
|
281
|
-
}) {
|
|
282
|
-
// Refs
|
|
283
|
-
const root = ref();
|
|
284
|
-
const resizeBar = ref(null);
|
|
285
|
-
const parentContainer = computed(() => {
|
|
286
|
-
var _a;
|
|
287
|
-
return (_a = root.value) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
288
|
-
});
|
|
289
|
-
// Slots
|
|
290
|
-
const {
|
|
291
|
-
toolbar: toolbarSlot
|
|
292
|
-
} = useSlots();
|
|
293
|
-
// State
|
|
294
|
-
const startPositionX = ref(0);
|
|
295
|
-
const isResizing = ref(false);
|
|
296
|
-
const isCollapsed = ref(false);
|
|
297
|
-
const maximumWidth = ref(props.maximumWidth || 384);
|
|
298
|
-
const localWidth = ref(props.width >= props.minimumWidth ? props.width : props.minimumWidth);
|
|
299
|
-
const isShowingToolbar = computed(() => !!toolbarSlot);
|
|
300
|
-
// Styles
|
|
301
|
-
const sidebarStyle = computed(() => ({
|
|
302
|
-
width: (isCollapsed.value ? 16 : localWidth.value) + 'px'
|
|
303
|
-
}));
|
|
304
|
-
const rootStyles = computed(() => ['or-sidebar', ...SidebarRoot]);
|
|
305
|
-
const sidebarStyles = computed(() => [...SidebarBar, ...SidebarSides[props.side]]);
|
|
306
|
-
const toolbarStyles = computed(() => [...SidebarToolbar, ...SidebarToolbarSides[props.side]]);
|
|
307
|
-
const resizeStyles = computed(() => [...SidebarResize, ...SidebarResizeSides[props.side], ...(isResizing.value ? SidebarResizingSides[props.side] : [])]);
|
|
308
|
-
const collapsibleButtonStyles = computed(() => [...SidebarCollapseButton, ...SidebarCollapseButtonSides[props.side]]);
|
|
309
|
-
const mainStyles = computed(() => [...SidebarMain]);
|
|
310
|
-
const headerStyles = computed(() => [...SidebarHeader]);
|
|
311
|
-
const contentStyles = computed(() => [...SidebarContent]);
|
|
312
|
-
const footerStyles = computed(() => [...SidebarFooter]);
|
|
313
|
-
// Effects
|
|
314
|
-
useDraggable(resizeBar, {
|
|
315
|
-
preventDefault: true,
|
|
316
|
-
onStart: (position, event) => {
|
|
317
|
-
document.body.style.cursor = 'ew-resize';
|
|
318
|
-
document.body.style.userSelect = 'none';
|
|
319
|
-
startPositionX.value = event.x;
|
|
320
|
-
isResizing.value = true;
|
|
321
|
-
},
|
|
322
|
-
onMove: position => {
|
|
323
|
-
const delta = (position.x - startPositionX.value) * (props.side === OrSidebarPlacement.left ? -1 : 1);
|
|
324
|
-
const newWidth = localWidth.value - delta;
|
|
325
|
-
localWidth.value = newWidth > maximumWidth.value ? maximumWidth.value : newWidth < props.minimumWidth ? props.minimumWidth : newWidth;
|
|
326
|
-
startPositionX.value = position.x;
|
|
327
|
-
},
|
|
328
|
-
onEnd: () => {
|
|
329
|
-
document.body.style.cursor = '';
|
|
330
|
-
document.body.style.userSelect = '';
|
|
331
|
-
isResizing.value = false;
|
|
332
|
-
}
|
|
333
|
-
});
|
|
334
|
-
// Methods
|
|
335
|
-
function open() {
|
|
336
|
-
isCollapsed.value = false;
|
|
337
|
-
}
|
|
338
|
-
function close() {
|
|
339
|
-
isCollapsed.value = true;
|
|
340
|
-
}
|
|
341
|
-
const {
|
|
342
|
-
width: containerWidth
|
|
343
|
-
} = useElementBounding(parentContainer);
|
|
344
|
-
watch(() => props.width, newValue => {
|
|
345
|
-
if (newValue !== localWidth.value) {
|
|
346
|
-
localWidth.value = newValue > maximumWidth.value ? maximumWidth.value : newValue < props.minimumWidth ? props.minimumWidth : newValue;
|
|
347
|
-
}
|
|
348
|
-
});
|
|
349
|
-
watch(() => props.minimumWidth, newMinimum => {
|
|
350
|
-
if (newMinimum > localWidth.value) localWidth.value = newMinimum;
|
|
351
|
-
});
|
|
352
|
-
watch(() => props.maximumWidth, newMaximum => {
|
|
353
|
-
if (newMaximum < maximumWidth.value) maximumWidth.value = newMaximum;
|
|
354
|
-
});
|
|
355
|
-
watch(containerWidth, newMaximum => {
|
|
356
|
-
if (newMaximum < maximumWidth.value) maximumWidth.value = newMaximum;
|
|
357
|
-
});
|
|
358
|
-
watch(maximumWidth, newMaximum => {
|
|
359
|
-
if (newMaximum < localWidth.value) localWidth.value = newMaximum;
|
|
360
|
-
});
|
|
361
|
-
watch(localWidth, val => emit('change:width', val));
|
|
362
|
-
return {
|
|
363
|
-
root,
|
|
364
|
-
resizeBar,
|
|
365
|
-
isResizing,
|
|
366
|
-
isCollapsed,
|
|
367
|
-
localWidth,
|
|
368
|
-
isShowingToolbar,
|
|
369
|
-
sidebarStyle,
|
|
370
|
-
rootStyles,
|
|
371
|
-
sidebarStyles,
|
|
372
|
-
toolbarStyles,
|
|
373
|
-
resizeStyles,
|
|
374
|
-
collapsibleButtonStyles,
|
|
375
|
-
mainStyles,
|
|
376
|
-
headerStyles,
|
|
377
|
-
contentStyles,
|
|
378
|
-
footerStyles,
|
|
379
|
-
open,
|
|
380
|
-
close
|
|
381
|
-
};
|
|
382
|
-
}
|
|
383
|
-
});
|
|
384
|
-
|
|
385
|
-
/* script */
|
|
386
|
-
const __vue_script__ = script;
|
|
387
|
-
|
|
388
|
-
/* template */
|
|
389
|
-
var __vue_render__ = function () {
|
|
390
|
-
var _vm = this;
|
|
391
|
-
var _h = _vm.$createElement;
|
|
392
|
-
var _c = _vm._self._c || _h;
|
|
393
|
-
return _c('aside', {
|
|
394
|
-
ref: "root",
|
|
395
|
-
class: _vm.rootStyles
|
|
396
|
-
}, [_vm.side === 'right' && _vm.isShowingToolbar ? _c('div', {
|
|
397
|
-
class: _vm.toolbarStyles
|
|
398
|
-
}, [_vm._t("toolbar")], 2) : _vm._e(), _vm._v(" "), _c('div', {
|
|
399
|
-
class: _vm.sidebarStyles,
|
|
400
|
-
style: _vm.sidebarStyle
|
|
401
|
-
}, [_vm.draggable && !_vm.isCollapsed ? _c('div', {
|
|
402
|
-
ref: "resizeBar",
|
|
403
|
-
class: _vm.resizeStyles
|
|
404
|
-
}) : _vm._e(), _vm._v(" "), _vm.collapsible ? _c('or-sidebar-collapse-button', {
|
|
405
|
-
class: _vm.collapsibleButtonStyles,
|
|
406
|
-
attrs: {
|
|
407
|
-
"side": _vm.side
|
|
408
|
-
},
|
|
409
|
-
model: {
|
|
410
|
-
value: _vm.isCollapsed,
|
|
411
|
-
callback: function ($$v) {
|
|
412
|
-
_vm.isCollapsed = $$v;
|
|
413
|
-
},
|
|
414
|
-
expression: "isCollapsed"
|
|
415
|
-
}
|
|
416
|
-
}) : _vm._e(), _vm._v(" "), _c('div', {
|
|
417
|
-
directives: [{
|
|
418
|
-
name: "show",
|
|
419
|
-
rawName: "v-show",
|
|
420
|
-
value: !_vm.isCollapsed,
|
|
421
|
-
expression: "!isCollapsed"
|
|
422
|
-
}],
|
|
423
|
-
class: _vm.mainStyles
|
|
424
|
-
}, [_vm.$slots.header ? _c('div', {
|
|
425
|
-
class: _vm.headerStyles
|
|
426
|
-
}, [_vm._t("header")], 2) : _vm._e(), _vm._v(" "), _c('div', {
|
|
427
|
-
class: _vm.contentStyles
|
|
428
|
-
}, [_vm._t("default")], 2)]), _vm._v(" "), _vm.$slots.footer ? _c('div', {
|
|
429
|
-
directives: [{
|
|
430
|
-
name: "show",
|
|
431
|
-
rawName: "v-show",
|
|
432
|
-
value: !_vm.isCollapsed,
|
|
433
|
-
expression: "!isCollapsed"
|
|
434
|
-
}],
|
|
435
|
-
class: _vm.footerStyles
|
|
436
|
-
}, [_vm._t("footer")], 2) : _vm._e()], 1), _vm._v(" "), _vm.side === 'left' && _vm.isShowingToolbar ? _c('div', {
|
|
437
|
-
class: _vm.toolbarStyles
|
|
438
|
-
}, [_vm._t("toolbar")], 2) : _vm._e()]);
|
|
439
|
-
};
|
|
440
|
-
var __vue_staticRenderFns__ = [];
|
|
441
|
-
|
|
442
|
-
/* style */
|
|
443
|
-
const __vue_inject_styles__ = undefined;
|
|
444
|
-
/* scoped */
|
|
445
|
-
const __vue_scope_id__ = undefined;
|
|
446
|
-
/* module identifier */
|
|
447
|
-
const __vue_module_identifier__ = undefined;
|
|
448
|
-
/* functional template */
|
|
449
|
-
const __vue_is_functional_template__ = false;
|
|
450
|
-
/* style inject */
|
|
451
|
-
|
|
452
|
-
/* style inject SSR */
|
|
453
|
-
|
|
454
|
-
/* style inject shadow dom */
|
|
455
|
-
|
|
456
|
-
const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
457
|
-
render: __vue_render__,
|
|
458
|
-
staticRenderFns: __vue_staticRenderFns__
|
|
459
|
-
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
460
|
-
var __vue_component__$1 = __vue_component__;
|
|
461
|
-
|
|
462
|
-
export { OrSidebarPlacement as O, __vue_component__$1 as _ };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryFn } from '@storybook/vue3';
|
|
2
|
-
declare const _default: Meta<import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<unknown>, import("@vue/composition-api").MethodOptions, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>, import("@vue/composition-api").ExtractPropTypes<import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
|
|
3
|
-
[x: string]: ((...args: any[]) => any) | null;
|
|
4
|
-
} | string[], {} & {}, {
|
|
5
|
-
[x: number]: string;
|
|
6
|
-
} | {}, true>)>;
|
|
7
|
-
export default _default;
|
|
8
|
-
export declare const Default: StoryFn<import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<unknown>, import("@vue/composition-api").MethodOptions, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>, import("@vue/composition-api").ExtractPropTypes<import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
|
|
9
|
-
[x: string]: ((...args: any[]) => any) | null;
|
|
10
|
-
} | string[], {} & {}, {
|
|
11
|
-
[x: number]: string;
|
|
12
|
-
} | {}, true>)>;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { PropType } from 'vue-demi';
|
|
2
|
-
import { OrSidebarPlacement } from './props';
|
|
3
|
-
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
4
|
-
root: import("@vue/composition-api").Ref<HTMLDivElement | undefined>;
|
|
5
|
-
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
6
|
-
buttonStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
7
|
-
icon: import("@vue/composition-api").ComputedRef<"keyboard_arrow_left" | "keyboard_arrow_right">;
|
|
8
|
-
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
9
|
-
/**
|
|
10
|
-
* Must be `true` if sidebar is collapsed.
|
|
11
|
-
*/
|
|
12
|
-
modelValue: {
|
|
13
|
-
type: BooleanConstructor;
|
|
14
|
-
default: boolean;
|
|
15
|
-
};
|
|
16
|
-
side: {
|
|
17
|
-
type: PropType<OrSidebarPlacement>;
|
|
18
|
-
default: OrSidebarPlacement;
|
|
19
|
-
validator: (value?: any) => boolean;
|
|
20
|
-
};
|
|
21
|
-
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
22
|
-
/**
|
|
23
|
-
* Must be `true` if sidebar is collapsed.
|
|
24
|
-
*/
|
|
25
|
-
modelValue: {
|
|
26
|
-
type: BooleanConstructor;
|
|
27
|
-
default: boolean;
|
|
28
|
-
};
|
|
29
|
-
side: {
|
|
30
|
-
type: PropType<OrSidebarPlacement>;
|
|
31
|
-
default: OrSidebarPlacement;
|
|
32
|
-
validator: (value?: any) => boolean;
|
|
33
|
-
};
|
|
34
|
-
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
35
|
-
modelValue: boolean;
|
|
36
|
-
side: OrSidebarPlacement;
|
|
37
|
-
} & {} & {
|
|
38
|
-
[x: string & `on${string}`]: ((...args: any[]) => any) | undefined;
|
|
39
|
-
}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
40
|
-
root: import("@vue/composition-api").Ref<HTMLDivElement | undefined>;
|
|
41
|
-
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
42
|
-
buttonStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
43
|
-
icon: import("@vue/composition-api").ComputedRef<"keyboard_arrow_left" | "keyboard_arrow_right">;
|
|
44
|
-
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
|
|
45
|
-
modelValue: boolean;
|
|
46
|
-
side: OrSidebarPlacement;
|
|
47
|
-
} & {} & {
|
|
48
|
-
[x: string & `on${string}`]: ((...args: any[]) => any) | undefined;
|
|
49
|
-
}, {
|
|
50
|
-
modelValue: boolean;
|
|
51
|
-
side: OrSidebarPlacement;
|
|
52
|
-
}, true>);
|
|
53
|
-
export default _default;
|