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