@onereach/ui-components 2.72.1 → 2.72.2-beta.2260.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/{OrSidebar-c95ef614.js → OrSidebar-64cc9127.js} +92 -86
- package/dist/bundled/v2/OrSidebarCollapseButton-fcc085c7.js +235 -0
- package/dist/bundled/v2/components/index.js +2 -1
- package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +36 -1
- package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +49 -4
- package/dist/bundled/v2/components/or-sidebar-v3/index.js +13 -1
- package/dist/bundled/v2/components/or-sidebar-v3/partials/OrSidebarCollapseButton.stories3.d.ts +12 -0
- package/dist/bundled/v2/components/or-sidebar-v3/partials/OrSidebarCollapseButton.vue.d.ts +53 -0
- package/dist/bundled/v2/components/or-sidebar-v3/partials/index.d.ts +1 -0
- package/dist/bundled/v2/components/or-sidebar-v3/partials/index.js +18 -0
- package/dist/bundled/v2/components/or-sidebar-v3/styles.d.ts +9 -1
- package/dist/bundled/v2/index.js +3 -2
- package/dist/bundled/v3/{OrSidebar.vue_vue_type_script_lang-ce0b152c.js → OrSidebar.vue_vue_type_script_lang-a150808b.js} +75 -80
- package/dist/bundled/v3/OrSidebarCollapseButton.vue_vue_type_script_lang-d3e3cd4f.js +185 -0
- package/dist/bundled/v3/components/index.js +2 -1
- package/dist/bundled/v3/components/or-sidebar-v3/OrSidebar.stories3.d.ts +36 -1
- package/dist/bundled/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +49 -4
- package/dist/bundled/v3/components/or-sidebar-v3/index.js +16 -2
- package/dist/bundled/v3/components/or-sidebar-v3/partials/OrSidebarCollapseButton.stories3.d.ts +12 -0
- package/dist/bundled/v3/components/or-sidebar-v3/partials/OrSidebarCollapseButton.vue.d.ts +53 -0
- package/dist/bundled/v3/components/or-sidebar-v3/partials/index.d.ts +1 -0
- package/dist/bundled/v3/components/or-sidebar-v3/partials/index.js +17 -0
- package/dist/bundled/v3/components/or-sidebar-v3/styles.d.ts +9 -1
- package/dist/bundled/v3/index.js +26 -9
- package/dist/esm/v2/{OrSidebar-fabc7bc9.js → OrSidebar-a10424d2.js} +92 -86
- package/dist/esm/v2/OrSidebarCollapseButton-3b461dfe.js +233 -0
- package/dist/esm/v2/components/index.js +2 -1
- package/dist/esm/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +36 -1
- package/dist/esm/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +49 -4
- package/dist/esm/v2/components/or-sidebar-v3/index.js +13 -1
- package/dist/esm/v2/components/or-sidebar-v3/partials/OrSidebarCollapseButton.stories3.d.ts +12 -0
- package/dist/esm/v2/components/or-sidebar-v3/partials/OrSidebarCollapseButton.vue.d.ts +53 -0
- package/dist/esm/v2/components/or-sidebar-v3/partials/index.d.ts +1 -0
- package/dist/esm/v2/components/or-sidebar-v3/partials/index.js +16 -0
- package/dist/esm/v2/components/or-sidebar-v3/styles.d.ts +9 -1
- package/dist/esm/v2/index.js +2 -1
- package/dist/esm/v3/{OrSidebar-a62972f5.js → OrSidebar-3be35e8d.js} +81 -89
- package/dist/esm/v3/OrSidebarCollapseButton-30d0033b.js +204 -0
- package/dist/esm/v3/components/index.js +2 -1
- package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.stories3.d.ts +36 -1
- package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +49 -4
- package/dist/esm/v3/components/or-sidebar-v3/index.js +12 -1
- package/dist/esm/v3/components/or-sidebar-v3/partials/OrSidebarCollapseButton.stories3.d.ts +12 -0
- package/dist/esm/v3/components/or-sidebar-v3/partials/OrSidebarCollapseButton.vue.d.ts +53 -0
- package/dist/esm/v3/components/or-sidebar-v3/partials/index.d.ts +1 -0
- package/dist/esm/v3/components/or-sidebar-v3/partials/index.js +15 -0
- package/dist/esm/v3/components/or-sidebar-v3/styles.d.ts +9 -1
- package/dist/esm/v3/index.js +2 -1
- package/package.json +2 -3
- package/src/components/or-sidebar-v3/OrSidebar.docs.mdx +6 -0
- package/src/components/or-sidebar-v3/OrSidebar.stories3.ts +253 -12
- package/src/components/or-sidebar-v3/OrSidebar.vue +130 -23
- package/src/components/or-sidebar-v3/partials/OrSidebarCollapseButton.stories3.ts +48 -0
- package/src/components/or-sidebar-v3/partials/OrSidebarCollapseButton.vue +74 -0
- package/src/components/or-sidebar-v3/partials/index.ts +1 -0
- package/src/components/or-sidebar-v3/styles.ts +164 -9
|
@@ -1,93 +1,29 @@
|
|
|
1
1
|
import { useDraggable, useElementBounding } from '@vueuse/core';
|
|
2
2
|
import _ from 'lodash';
|
|
3
3
|
import './index-fa6eb4ca.js';
|
|
4
|
-
import {
|
|
4
|
+
import { a as OrSidebarCollapseButton, O as OrSidebarPlacement, S as SidebarRoot, b as SidebarBar, c as SidebarSides, d as SidebarToolbar, C as CollapsibleSidebarToolbar, e as SidebarToolbarSides, f as SidebarResize, g as SidebarResizeSides, h as SidebarResizingSides, i as SidebarCollapseButton, j as SidebarCollapseButtonSides, k as SidebarMain, l as SidebarHeader, m as SidebarContent, n as SidebarFooter } from './OrSidebarCollapseButton-fcc085c7.js';
|
|
5
|
+
import { defineComponent, ref, computed, useSlots, watch } from '@vue/composition-api/dist/vue-composition-api.mjs';
|
|
5
6
|
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
6
7
|
|
|
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
8
|
var script = defineComponent({
|
|
79
9
|
name: 'OrSidebar',
|
|
10
|
+
components: {
|
|
11
|
+
OrSidebarCollapseButton
|
|
12
|
+
},
|
|
80
13
|
props: {
|
|
81
14
|
width: {
|
|
82
15
|
type: Number,
|
|
83
|
-
|
|
84
|
-
default: 0,
|
|
16
|
+
default: 320,
|
|
85
17
|
validator: value => _.isNumber(value) && value >= 0
|
|
86
18
|
},
|
|
87
19
|
minimumWidth: {
|
|
88
20
|
type: Number,
|
|
89
|
-
|
|
90
|
-
|
|
21
|
+
default: 256,
|
|
22
|
+
validator: value => _.isNumber(value) && value >= 0
|
|
23
|
+
},
|
|
24
|
+
maximumWidth: {
|
|
25
|
+
type: Number,
|
|
26
|
+
default: 384,
|
|
91
27
|
validator: value => _.isNumber(value) && value >= 0
|
|
92
28
|
},
|
|
93
29
|
/**
|
|
@@ -101,9 +37,18 @@ var script = defineComponent({
|
|
|
101
37
|
type: String,
|
|
102
38
|
default: OrSidebarPlacement.right,
|
|
103
39
|
validator: value => _.includes(_.values(OrSidebarPlacement), value)
|
|
40
|
+
},
|
|
41
|
+
draggable: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: true
|
|
44
|
+
},
|
|
45
|
+
collapsible: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false
|
|
104
48
|
}
|
|
105
49
|
},
|
|
106
|
-
emits: ['change:width'],
|
|
50
|
+
emits: ['change:width', 'open', 'close'],
|
|
51
|
+
expose: ['root', 'open', 'close'],
|
|
107
52
|
setup(props, {
|
|
108
53
|
emit
|
|
109
54
|
}) {
|
|
@@ -114,16 +59,26 @@ var script = defineComponent({
|
|
|
114
59
|
var _a;
|
|
115
60
|
return (_a = root.value) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
116
61
|
});
|
|
62
|
+
// Slots
|
|
63
|
+
const {
|
|
64
|
+
toolbar: toolbarSlot
|
|
65
|
+
} = useSlots();
|
|
117
66
|
// State
|
|
118
67
|
const startPositionX = ref(0);
|
|
119
68
|
const isResizing = ref(false);
|
|
69
|
+
const isCollapsed = ref(false);
|
|
70
|
+
const maximumWidth = ref(props.maximumWidth || 384);
|
|
120
71
|
const localWidth = ref(props.width >= props.minimumWidth ? props.width : props.minimumWidth);
|
|
72
|
+
const isShowingToolbar = computed(() => !!toolbarSlot);
|
|
121
73
|
// Styles
|
|
122
74
|
const sidebarStyle = computed(() => ({
|
|
123
|
-
width: localWidth.value + 'px'
|
|
75
|
+
width: (isCollapsed.value ? 16 : localWidth.value) + 'px'
|
|
124
76
|
}));
|
|
125
|
-
const rootStyles = computed(() => ['or-sidebar', ...SidebarRoot
|
|
77
|
+
const rootStyles = computed(() => ['or-sidebar', ...SidebarRoot]);
|
|
78
|
+
const sidebarStyles = computed(() => [...SidebarBar, ...SidebarSides[props.side]]);
|
|
79
|
+
const toolbarStyles = computed(() => [...SidebarToolbar, ...(props.collapsible ? CollapsibleSidebarToolbar : []), ...SidebarToolbarSides[props.side]]);
|
|
126
80
|
const resizeStyles = computed(() => [...SidebarResize, ...SidebarResizeSides[props.side], ...(isResizing.value ? SidebarResizingSides[props.side] : [])]);
|
|
81
|
+
const collapsibleButtonStyles = computed(() => [...SidebarCollapseButton, ...SidebarCollapseButtonSides[props.side]]);
|
|
127
82
|
const mainStyles = computed(() => [...SidebarMain]);
|
|
128
83
|
const headerStyles = computed(() => [...SidebarHeader]);
|
|
129
84
|
const contentStyles = computed(() => [...SidebarContent]);
|
|
@@ -149,8 +104,15 @@ var script = defineComponent({
|
|
|
149
104
|
isResizing.value = false;
|
|
150
105
|
}
|
|
151
106
|
});
|
|
107
|
+
// Methods
|
|
108
|
+
function open() {
|
|
109
|
+
isCollapsed.value = false;
|
|
110
|
+
}
|
|
111
|
+
function close() {
|
|
112
|
+
isCollapsed.value = true;
|
|
113
|
+
}
|
|
152
114
|
const {
|
|
153
|
-
width:
|
|
115
|
+
width: containerWidth
|
|
154
116
|
} = useElementBounding(parentContainer);
|
|
155
117
|
watch(() => props.width, newValue => {
|
|
156
118
|
if (newValue !== localWidth.value) {
|
|
@@ -160,22 +122,36 @@ var script = defineComponent({
|
|
|
160
122
|
watch(() => props.minimumWidth, newMinimum => {
|
|
161
123
|
if (newMinimum > localWidth.value) localWidth.value = newMinimum;
|
|
162
124
|
});
|
|
125
|
+
watch(() => props.maximumWidth, newMaximum => {
|
|
126
|
+
if (newMaximum < maximumWidth.value) maximumWidth.value = newMaximum;
|
|
127
|
+
});
|
|
128
|
+
watch(containerWidth, newMaximum => {
|
|
129
|
+
if (newMaximum < maximumWidth.value) maximumWidth.value = newMaximum;
|
|
130
|
+
});
|
|
163
131
|
watch(maximumWidth, newMaximum => {
|
|
164
132
|
if (newMaximum < localWidth.value) localWidth.value = newMaximum;
|
|
165
133
|
});
|
|
166
134
|
watch(localWidth, val => emit('change:width', val));
|
|
135
|
+
watch(isCollapsed, val => emit(val ? 'close' : 'open'));
|
|
167
136
|
return {
|
|
168
137
|
root,
|
|
169
138
|
resizeBar,
|
|
170
139
|
isResizing,
|
|
140
|
+
isCollapsed,
|
|
171
141
|
localWidth,
|
|
142
|
+
isShowingToolbar,
|
|
172
143
|
sidebarStyle,
|
|
173
144
|
rootStyles,
|
|
145
|
+
sidebarStyles,
|
|
146
|
+
toolbarStyles,
|
|
174
147
|
resizeStyles,
|
|
148
|
+
collapsibleButtonStyles,
|
|
175
149
|
mainStyles,
|
|
176
150
|
headerStyles,
|
|
177
151
|
contentStyles,
|
|
178
|
-
footerStyles
|
|
152
|
+
footerStyles,
|
|
153
|
+
open,
|
|
154
|
+
close
|
|
179
155
|
};
|
|
180
156
|
}
|
|
181
157
|
});
|
|
@@ -190,20 +166,50 @@ var __vue_render__ = function () {
|
|
|
190
166
|
var _c = _vm._self._c || _h;
|
|
191
167
|
return _c('aside', {
|
|
192
168
|
ref: "root",
|
|
193
|
-
class: _vm.rootStyles
|
|
169
|
+
class: _vm.rootStyles
|
|
170
|
+
}, [_vm.side === 'right' && _vm.isShowingToolbar ? _c('div', {
|
|
171
|
+
class: _vm.toolbarStyles
|
|
172
|
+
}, [_vm._t("toolbar")], 2) : _vm._e(), _vm._v(" "), _c('div', {
|
|
173
|
+
class: _vm.sidebarStyles,
|
|
194
174
|
style: _vm.sidebarStyle
|
|
195
|
-
}, [_c('div', {
|
|
175
|
+
}, [_vm.draggable && !_vm.isCollapsed ? _c('div', {
|
|
196
176
|
ref: "resizeBar",
|
|
197
177
|
class: _vm.resizeStyles
|
|
198
|
-
}), _vm._v(" "), _c('
|
|
178
|
+
}) : _vm._e(), _vm._v(" "), _vm.collapsible ? _c('or-sidebar-collapse-button', {
|
|
179
|
+
class: _vm.collapsibleButtonStyles,
|
|
180
|
+
attrs: {
|
|
181
|
+
"side": _vm.side
|
|
182
|
+
},
|
|
183
|
+
model: {
|
|
184
|
+
value: _vm.isCollapsed,
|
|
185
|
+
callback: function ($$v) {
|
|
186
|
+
_vm.isCollapsed = $$v;
|
|
187
|
+
},
|
|
188
|
+
expression: "isCollapsed"
|
|
189
|
+
}
|
|
190
|
+
}) : _vm._e(), _vm._v(" "), _c('div', {
|
|
191
|
+
directives: [{
|
|
192
|
+
name: "show",
|
|
193
|
+
rawName: "v-show",
|
|
194
|
+
value: !_vm.isCollapsed,
|
|
195
|
+
expression: "!isCollapsed"
|
|
196
|
+
}],
|
|
199
197
|
class: _vm.mainStyles
|
|
200
198
|
}, [_vm.$slots.header ? _c('div', {
|
|
201
199
|
class: _vm.headerStyles
|
|
202
200
|
}, [_vm._t("header")], 2) : _vm._e(), _vm._v(" "), _c('div', {
|
|
203
201
|
class: _vm.contentStyles
|
|
204
202
|
}, [_vm._t("default")], 2)]), _vm._v(" "), _vm.$slots.footer ? _c('div', {
|
|
203
|
+
directives: [{
|
|
204
|
+
name: "show",
|
|
205
|
+
rawName: "v-show",
|
|
206
|
+
value: !_vm.isCollapsed,
|
|
207
|
+
expression: "!isCollapsed"
|
|
208
|
+
}],
|
|
205
209
|
class: _vm.footerStyles
|
|
206
|
-
}, [_vm._t("footer")], 2) : _vm._e()])
|
|
210
|
+
}, [_vm._t("footer")], 2) : _vm._e()], 1), _vm._v(" "), _vm.side === 'left' && _vm.isShowingToolbar ? _c('div', {
|
|
211
|
+
class: _vm.toolbarStyles
|
|
212
|
+
}, [_vm._t("toolbar")], 2) : _vm._e()]);
|
|
207
213
|
};
|
|
208
214
|
var __vue_staticRenderFns__ = [];
|
|
209
215
|
|
|
@@ -227,4 +233,4 @@ const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
|
227
233
|
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
228
234
|
var __vue_component__$1 = __vue_component__;
|
|
229
235
|
|
|
230
|
-
export {
|
|
236
|
+
export { __vue_component__$1 as _ };
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
import './index-fa6eb4ca.js';
|
|
3
|
+
import { O as OrIconButton } from './OrIconButton-837d57f8.js';
|
|
4
|
+
import { defineComponent, ref, computed } 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-row', 'shrink-0',
|
|
18
|
+
// Box
|
|
19
|
+
'min-w-0', 'h-auto', 'p-0',
|
|
20
|
+
// Theme
|
|
21
|
+
'bg-background', 'dark:bg-background-dark'];
|
|
22
|
+
const SidebarBar = [
|
|
23
|
+
// Position
|
|
24
|
+
'relative',
|
|
25
|
+
// Layout
|
|
26
|
+
'flex', 'flex-col', 'shrink-0', 'grow',
|
|
27
|
+
// Box
|
|
28
|
+
'min-h-0', 'p-0',
|
|
29
|
+
// Theme
|
|
30
|
+
'text-on-background', 'dark:text-on-background-dark',
|
|
31
|
+
// Transition
|
|
32
|
+
'transition-[width]'];
|
|
33
|
+
const SidebarToolbar = [
|
|
34
|
+
// Position
|
|
35
|
+
'relative',
|
|
36
|
+
// Layout
|
|
37
|
+
'flex', 'flex-col', 'shrink-0', 'grow', 'overflow-auto', 'items-center',
|
|
38
|
+
// Sizing
|
|
39
|
+
'gap-md',
|
|
40
|
+
// Box
|
|
41
|
+
'min-h-0', 'min-w-xl', 'p-[6px]', 'py-md+',
|
|
42
|
+
// Theme
|
|
43
|
+
'text-outline', 'dark:text-outline-dark'];
|
|
44
|
+
const CollapsibleSidebarToolbar = ['pt-[56px]'];
|
|
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 = 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__ = script;
|
|
188
|
+
|
|
189
|
+
/* template */
|
|
190
|
+
var __vue_render__ = 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__ = [];
|
|
214
|
+
|
|
215
|
+
/* style */
|
|
216
|
+
const __vue_inject_styles__ = undefined;
|
|
217
|
+
/* scoped */
|
|
218
|
+
const __vue_scope_id__ = undefined;
|
|
219
|
+
/* module identifier */
|
|
220
|
+
const __vue_module_identifier__ = undefined;
|
|
221
|
+
/* functional template */
|
|
222
|
+
const __vue_is_functional_template__ = false;
|
|
223
|
+
/* style inject */
|
|
224
|
+
|
|
225
|
+
/* style inject SSR */
|
|
226
|
+
|
|
227
|
+
/* style inject shadow dom */
|
|
228
|
+
|
|
229
|
+
const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
230
|
+
render: __vue_render__,
|
|
231
|
+
staticRenderFns: __vue_staticRenderFns__
|
|
232
|
+
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
233
|
+
var OrSidebarCollapseButton = __vue_component__;
|
|
234
|
+
|
|
235
|
+
export { CollapsibleSidebarToolbar as C, OrSidebarPlacement as O, SidebarRoot as S, OrSidebarCollapseButton as a, SidebarBar as b, SidebarSides as c, SidebarToolbar as d, SidebarToolbarSides as e, SidebarResize as f, SidebarResizeSides as g, SidebarResizingSides as h, SidebarCollapseButton as i, SidebarCollapseButtonSides as j, SidebarMain as k, SidebarHeader as l, SidebarContent as m, SidebarFooter as n };
|
|
@@ -71,7 +71,8 @@ export { _ as OrSegmentedControlV3, S as SegmentedControlSize } from '../OrSegme
|
|
|
71
71
|
export { _ as OrSelect } from '../OrSelect-a23d4210.js';
|
|
72
72
|
export { _ as OrSelectV3 } from '../OrSelect-2ececfc1.js';
|
|
73
73
|
export { _ as OrSidebar, O as OrSidebarSide } from '../OrSidebar-e2b2c9ec.js';
|
|
74
|
-
export {
|
|
74
|
+
export { _ as OrSidebarV3 } from '../OrSidebar-64cc9127.js';
|
|
75
|
+
export { O as OrSidebarPlacement } from '../OrSidebarCollapseButton-fcc085c7.js';
|
|
75
76
|
export { _ as OrSkeletonCircle, a as OrSkeletonRect, b as OrSkeletonText, O as OrSkeletonTextSizes } from '../OrSkeletonText-242d22f3.js';
|
|
76
77
|
export { _ as OrSkeletonCircleV3, a as OrSkeletonRectV3, b as OrSkeletonTextV3 } from '../OrSkeletonText-9a2f39dc.js';
|
|
77
78
|
export { _ as OrSlider } from '../OrSlider-59d05856.js';
|
|
@@ -10,7 +10,17 @@ export declare const Default: StoryFn<import("vue").ComponentOptions<import("vue
|
|
|
10
10
|
} | string[], {} & {}, {
|
|
11
11
|
[x: number]: string;
|
|
12
12
|
} | {}, true>)>;
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const WithCustomWidthConstraints: 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, {
|
|
14
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
15
|
+
} | string[], {} & {}, {
|
|
16
|
+
[x: number]: string;
|
|
17
|
+
} | {}, true>)>;
|
|
18
|
+
export declare const NotDraggable: 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, {
|
|
19
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
20
|
+
} | string[], {} & {}, {
|
|
21
|
+
[x: number]: string;
|
|
22
|
+
} | {}, true>)>;
|
|
23
|
+
export declare const Collapsible: 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, {
|
|
14
24
|
[x: string]: ((...args: any[]) => any) | null;
|
|
15
25
|
} | string[], {} & {}, {
|
|
16
26
|
[x: number]: string;
|
|
@@ -30,8 +40,33 @@ export declare const WithFooter: StoryFn<import("vue").ComponentOptions<import("
|
|
|
30
40
|
} | string[], {} & {}, {
|
|
31
41
|
[x: number]: string;
|
|
32
42
|
} | {}, true>)>;
|
|
43
|
+
export declare const WithToolbar: 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, {
|
|
44
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
45
|
+
} | string[], {} & {}, {
|
|
46
|
+
[x: number]: string;
|
|
47
|
+
} | {}, true>)>;
|
|
48
|
+
export declare const CollapsibleWithToolbar: 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, {
|
|
49
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
50
|
+
} | string[], {} & {}, {
|
|
51
|
+
[x: number]: string;
|
|
52
|
+
} | {}, true>)>;
|
|
53
|
+
export declare const WithTabs: 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, {
|
|
54
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
55
|
+
} | string[], {} & {}, {
|
|
56
|
+
[x: number]: string;
|
|
57
|
+
} | {}, true>)>;
|
|
33
58
|
export declare const LeftSidebar: 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, {
|
|
34
59
|
[x: string]: ((...args: any[]) => any) | null;
|
|
35
60
|
} | string[], {} & {}, {
|
|
36
61
|
[x: number]: string;
|
|
37
62
|
} | {}, true>)>;
|
|
63
|
+
export declare const WithLeftToolbar: 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, {
|
|
64
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
65
|
+
} | string[], {} & {}, {
|
|
66
|
+
[x: number]: string;
|
|
67
|
+
} | {}, true>)>;
|
|
68
|
+
export declare const CollapsibleWithWithLeftToolbar: 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, {
|
|
69
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
70
|
+
} | string[], {} & {}, {
|
|
71
|
+
[x: number]: string;
|
|
72
|
+
} | {}, true>)>;
|