@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,92 +1,28 @@
|
|
|
1
1
|
import { useDraggable, useElementBounding } from '@vueuse/core';
|
|
2
2
|
import _ from 'lodash';
|
|
3
|
-
import { defineComponent, ref, computed, watch } from 'vue-demi';
|
|
3
|
+
import { defineComponent, ref, computed, useSlots, watch } from 'vue-demi';
|
|
4
|
+
import { _ as __vue_component__$1, O as OrSidebarPlacement, S as SidebarRoot, a as SidebarBar, b as SidebarSides, c as SidebarToolbar, C as CollapsibleSidebarToolbar, d as SidebarToolbarSides, e as SidebarResize, f as SidebarResizeSides, g as SidebarResizingSides, h as SidebarCollapseButton, i as SidebarCollapseButtonSides, j as SidebarMain, k as SidebarHeader, l as SidebarContent, m as SidebarFooter } from './OrSidebarCollapseButton-3b461dfe.js';
|
|
4
5
|
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
5
6
|
|
|
6
|
-
var OrSidebarPlacement;
|
|
7
|
-
(function (OrSidebarPlacement) {
|
|
8
|
-
OrSidebarPlacement["left"] = "left";
|
|
9
|
-
OrSidebarPlacement["right"] = "right";
|
|
10
|
-
})(OrSidebarPlacement || (OrSidebarPlacement = {}));
|
|
11
|
-
|
|
12
|
-
const SidebarRoot = [
|
|
13
|
-
// Position
|
|
14
|
-
'relative',
|
|
15
|
-
// Layout
|
|
16
|
-
'flex', 'flex-col', 'shrink-0',
|
|
17
|
-
// Box
|
|
18
|
-
'min-h-0', 'p-0'];
|
|
19
|
-
const SidebarRootSides = {
|
|
20
|
-
[OrSidebarPlacement.left]: [
|
|
21
|
-
// Borders
|
|
22
|
-
'border-r-[1px]', 'border-r-solid', 'border-r-secondary dark:border-r-secondary-dark'],
|
|
23
|
-
[OrSidebarPlacement.right]: [
|
|
24
|
-
// Borders
|
|
25
|
-
'border-l-[1px]', 'border-l-solid', 'border-l-secondary dark:border-l-secondary-dark']
|
|
26
|
-
};
|
|
27
|
-
const SidebarResize = [
|
|
28
|
-
// Position
|
|
29
|
-
'absolute', 'inset-y-none', 'z-[1]',
|
|
30
|
-
// Box
|
|
31
|
-
'w-[12px]', 'h-[100%]',
|
|
32
|
-
// Cursor
|
|
33
|
-
'cursor-ew-resize'];
|
|
34
|
-
const SidebarResizeSides = {
|
|
35
|
-
[OrSidebarPlacement.left]: [
|
|
36
|
-
// Position
|
|
37
|
-
'-right-[1px]',
|
|
38
|
-
// Borders
|
|
39
|
-
'hover:border-r-2', 'hover:border-r-primary hover:dark:border-r-primary-dark',
|
|
40
|
-
// Transition
|
|
41
|
-
'transition-[border-right]'],
|
|
42
|
-
[OrSidebarPlacement.right]: [
|
|
43
|
-
// Position
|
|
44
|
-
'-left-[1px]',
|
|
45
|
-
// Borders
|
|
46
|
-
'hover:border-l-2', 'hover:border-l-primary hover:dark:border-l-primary-dark',
|
|
47
|
-
// Transition
|
|
48
|
-
'transition-[border-left]']
|
|
49
|
-
};
|
|
50
|
-
const SidebarResizingSides = {
|
|
51
|
-
[OrSidebarPlacement.left]: [
|
|
52
|
-
// Borders
|
|
53
|
-
'border-r-2', 'border-r-primary dark:border-r-primary-dark'],
|
|
54
|
-
[OrSidebarPlacement.right]: [
|
|
55
|
-
// Borders
|
|
56
|
-
'border-l-2', 'border-l-primary dark:border-l-primary-dark']
|
|
57
|
-
};
|
|
58
|
-
const SidebarMain = [
|
|
59
|
-
// Layout
|
|
60
|
-
'flex', 'flex-col', 'grow',
|
|
61
|
-
// Box
|
|
62
|
-
'min-h-0'];
|
|
63
|
-
const SidebarHeader = [
|
|
64
|
-
// Sizing
|
|
65
|
-
'p-md'];
|
|
66
|
-
const SidebarContent = [
|
|
67
|
-
// Layout
|
|
68
|
-
'grow', 'overflow-auto',
|
|
69
|
-
// Sizing
|
|
70
|
-
'p-md'];
|
|
71
|
-
const SidebarFooter = [
|
|
72
|
-
// Sizing
|
|
73
|
-
'p-md',
|
|
74
|
-
// Borders
|
|
75
|
-
'border-t-[1px]', 'border-t-solid', 'border-t-secondary dark:border-t-secondary-dark'];
|
|
76
|
-
|
|
77
7
|
var script = defineComponent({
|
|
78
8
|
name: 'OrSidebar',
|
|
9
|
+
components: {
|
|
10
|
+
OrSidebarCollapseButton: __vue_component__$1
|
|
11
|
+
},
|
|
79
12
|
props: {
|
|
80
13
|
width: {
|
|
81
14
|
type: Number,
|
|
82
|
-
|
|
83
|
-
default: 0,
|
|
15
|
+
default: 320,
|
|
84
16
|
validator: value => _.isNumber(value) && value >= 0
|
|
85
17
|
},
|
|
86
18
|
minimumWidth: {
|
|
87
19
|
type: Number,
|
|
88
|
-
|
|
89
|
-
|
|
20
|
+
default: 256,
|
|
21
|
+
validator: value => _.isNumber(value) && value >= 0
|
|
22
|
+
},
|
|
23
|
+
maximumWidth: {
|
|
24
|
+
type: Number,
|
|
25
|
+
default: 384,
|
|
90
26
|
validator: value => _.isNumber(value) && value >= 0
|
|
91
27
|
},
|
|
92
28
|
/**
|
|
@@ -100,9 +36,18 @@ var script = defineComponent({
|
|
|
100
36
|
type: String,
|
|
101
37
|
default: OrSidebarPlacement.right,
|
|
102
38
|
validator: value => _.includes(_.values(OrSidebarPlacement), value)
|
|
39
|
+
},
|
|
40
|
+
draggable: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: true
|
|
43
|
+
},
|
|
44
|
+
collapsible: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
103
47
|
}
|
|
104
48
|
},
|
|
105
|
-
emits: ['change:width'],
|
|
49
|
+
emits: ['change:width', 'open', 'close'],
|
|
50
|
+
expose: ['root', 'open', 'close'],
|
|
106
51
|
setup(props, {
|
|
107
52
|
emit
|
|
108
53
|
}) {
|
|
@@ -113,16 +58,26 @@ var script = defineComponent({
|
|
|
113
58
|
var _a;
|
|
114
59
|
return (_a = root.value) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
115
60
|
});
|
|
61
|
+
// Slots
|
|
62
|
+
const {
|
|
63
|
+
toolbar: toolbarSlot
|
|
64
|
+
} = useSlots();
|
|
116
65
|
// State
|
|
117
66
|
const startPositionX = ref(0);
|
|
118
67
|
const isResizing = ref(false);
|
|
68
|
+
const isCollapsed = ref(false);
|
|
69
|
+
const maximumWidth = ref(props.maximumWidth || 384);
|
|
119
70
|
const localWidth = ref(props.width >= props.minimumWidth ? props.width : props.minimumWidth);
|
|
71
|
+
const isShowingToolbar = computed(() => !!toolbarSlot);
|
|
120
72
|
// Styles
|
|
121
73
|
const sidebarStyle = computed(() => ({
|
|
122
|
-
width: localWidth.value + 'px'
|
|
74
|
+
width: (isCollapsed.value ? 16 : localWidth.value) + 'px'
|
|
123
75
|
}));
|
|
124
|
-
const rootStyles = computed(() => ['or-sidebar', ...SidebarRoot
|
|
76
|
+
const rootStyles = computed(() => ['or-sidebar', ...SidebarRoot]);
|
|
77
|
+
const sidebarStyles = computed(() => [...SidebarBar, ...SidebarSides[props.side]]);
|
|
78
|
+
const toolbarStyles = computed(() => [...SidebarToolbar, ...(props.collapsible ? CollapsibleSidebarToolbar : []), ...SidebarToolbarSides[props.side]]);
|
|
125
79
|
const resizeStyles = computed(() => [...SidebarResize, ...SidebarResizeSides[props.side], ...(isResizing.value ? SidebarResizingSides[props.side] : [])]);
|
|
80
|
+
const collapsibleButtonStyles = computed(() => [...SidebarCollapseButton, ...SidebarCollapseButtonSides[props.side]]);
|
|
126
81
|
const mainStyles = computed(() => [...SidebarMain]);
|
|
127
82
|
const headerStyles = computed(() => [...SidebarHeader]);
|
|
128
83
|
const contentStyles = computed(() => [...SidebarContent]);
|
|
@@ -148,8 +103,15 @@ var script = defineComponent({
|
|
|
148
103
|
isResizing.value = false;
|
|
149
104
|
}
|
|
150
105
|
});
|
|
106
|
+
// Methods
|
|
107
|
+
function open() {
|
|
108
|
+
isCollapsed.value = false;
|
|
109
|
+
}
|
|
110
|
+
function close() {
|
|
111
|
+
isCollapsed.value = true;
|
|
112
|
+
}
|
|
151
113
|
const {
|
|
152
|
-
width:
|
|
114
|
+
width: containerWidth
|
|
153
115
|
} = useElementBounding(parentContainer);
|
|
154
116
|
watch(() => props.width, newValue => {
|
|
155
117
|
if (newValue !== localWidth.value) {
|
|
@@ -159,22 +121,36 @@ var script = defineComponent({
|
|
|
159
121
|
watch(() => props.minimumWidth, newMinimum => {
|
|
160
122
|
if (newMinimum > localWidth.value) localWidth.value = newMinimum;
|
|
161
123
|
});
|
|
124
|
+
watch(() => props.maximumWidth, newMaximum => {
|
|
125
|
+
if (newMaximum < maximumWidth.value) maximumWidth.value = newMaximum;
|
|
126
|
+
});
|
|
127
|
+
watch(containerWidth, newMaximum => {
|
|
128
|
+
if (newMaximum < maximumWidth.value) maximumWidth.value = newMaximum;
|
|
129
|
+
});
|
|
162
130
|
watch(maximumWidth, newMaximum => {
|
|
163
131
|
if (newMaximum < localWidth.value) localWidth.value = newMaximum;
|
|
164
132
|
});
|
|
165
133
|
watch(localWidth, val => emit('change:width', val));
|
|
134
|
+
watch(isCollapsed, val => emit(val ? 'close' : 'open'));
|
|
166
135
|
return {
|
|
167
136
|
root,
|
|
168
137
|
resizeBar,
|
|
169
138
|
isResizing,
|
|
139
|
+
isCollapsed,
|
|
170
140
|
localWidth,
|
|
141
|
+
isShowingToolbar,
|
|
171
142
|
sidebarStyle,
|
|
172
143
|
rootStyles,
|
|
144
|
+
sidebarStyles,
|
|
145
|
+
toolbarStyles,
|
|
173
146
|
resizeStyles,
|
|
147
|
+
collapsibleButtonStyles,
|
|
174
148
|
mainStyles,
|
|
175
149
|
headerStyles,
|
|
176
150
|
contentStyles,
|
|
177
|
-
footerStyles
|
|
151
|
+
footerStyles,
|
|
152
|
+
open,
|
|
153
|
+
close
|
|
178
154
|
};
|
|
179
155
|
}
|
|
180
156
|
});
|
|
@@ -189,20 +165,50 @@ var __vue_render__ = function () {
|
|
|
189
165
|
var _c = _vm._self._c || _h;
|
|
190
166
|
return _c('aside', {
|
|
191
167
|
ref: "root",
|
|
192
|
-
class: _vm.rootStyles
|
|
168
|
+
class: _vm.rootStyles
|
|
169
|
+
}, [_vm.side === 'right' && _vm.isShowingToolbar ? _c('div', {
|
|
170
|
+
class: _vm.toolbarStyles
|
|
171
|
+
}, [_vm._t("toolbar")], 2) : _vm._e(), _vm._v(" "), _c('div', {
|
|
172
|
+
class: _vm.sidebarStyles,
|
|
193
173
|
style: _vm.sidebarStyle
|
|
194
|
-
}, [_c('div', {
|
|
174
|
+
}, [_vm.draggable && !_vm.isCollapsed ? _c('div', {
|
|
195
175
|
ref: "resizeBar",
|
|
196
176
|
class: _vm.resizeStyles
|
|
197
|
-
}), _vm._v(" "), _c('
|
|
177
|
+
}) : _vm._e(), _vm._v(" "), _vm.collapsible ? _c('or-sidebar-collapse-button', {
|
|
178
|
+
class: _vm.collapsibleButtonStyles,
|
|
179
|
+
attrs: {
|
|
180
|
+
"side": _vm.side
|
|
181
|
+
},
|
|
182
|
+
model: {
|
|
183
|
+
value: _vm.isCollapsed,
|
|
184
|
+
callback: function ($$v) {
|
|
185
|
+
_vm.isCollapsed = $$v;
|
|
186
|
+
},
|
|
187
|
+
expression: "isCollapsed"
|
|
188
|
+
}
|
|
189
|
+
}) : _vm._e(), _vm._v(" "), _c('div', {
|
|
190
|
+
directives: [{
|
|
191
|
+
name: "show",
|
|
192
|
+
rawName: "v-show",
|
|
193
|
+
value: !_vm.isCollapsed,
|
|
194
|
+
expression: "!isCollapsed"
|
|
195
|
+
}],
|
|
198
196
|
class: _vm.mainStyles
|
|
199
197
|
}, [_vm.$slots.header ? _c('div', {
|
|
200
198
|
class: _vm.headerStyles
|
|
201
199
|
}, [_vm._t("header")], 2) : _vm._e(), _vm._v(" "), _c('div', {
|
|
202
200
|
class: _vm.contentStyles
|
|
203
201
|
}, [_vm._t("default")], 2)]), _vm._v(" "), _vm.$slots.footer ? _c('div', {
|
|
202
|
+
directives: [{
|
|
203
|
+
name: "show",
|
|
204
|
+
rawName: "v-show",
|
|
205
|
+
value: !_vm.isCollapsed,
|
|
206
|
+
expression: "!isCollapsed"
|
|
207
|
+
}],
|
|
204
208
|
class: _vm.footerStyles
|
|
205
|
-
}, [_vm._t("footer")], 2) : _vm._e()])
|
|
209
|
+
}, [_vm._t("footer")], 2) : _vm._e()], 1), _vm._v(" "), _vm.side === 'left' && _vm.isShowingToolbar ? _c('div', {
|
|
210
|
+
class: _vm.toolbarStyles
|
|
211
|
+
}, [_vm._t("toolbar")], 2) : _vm._e()]);
|
|
206
212
|
};
|
|
207
213
|
var __vue_staticRenderFns__ = [];
|
|
208
214
|
|
|
@@ -225,4 +231,4 @@ const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
|
225
231
|
staticRenderFns: __vue_staticRenderFns__
|
|
226
232
|
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
227
233
|
|
|
228
|
-
export {
|
|
234
|
+
export { __vue_component__ as _ };
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
import { defineComponent, ref, computed } from 'vue-demi';
|
|
3
|
+
import { _ as __vue_component__$1 } from './OrIconButton-04a3566d.js';
|
|
4
|
+
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
5
|
+
|
|
6
|
+
var OrSidebarPlacement;
|
|
7
|
+
(function (OrSidebarPlacement) {
|
|
8
|
+
OrSidebarPlacement["left"] = "left";
|
|
9
|
+
OrSidebarPlacement["right"] = "right";
|
|
10
|
+
})(OrSidebarPlacement || (OrSidebarPlacement = {}));
|
|
11
|
+
|
|
12
|
+
const SidebarRoot = [
|
|
13
|
+
// Position
|
|
14
|
+
'relative',
|
|
15
|
+
// Layout
|
|
16
|
+
'flex', 'flex-row', 'shrink-0',
|
|
17
|
+
// Box
|
|
18
|
+
'min-w-0', 'h-auto', 'p-0',
|
|
19
|
+
// Theme
|
|
20
|
+
'bg-background', 'dark:bg-background-dark'];
|
|
21
|
+
const SidebarBar = [
|
|
22
|
+
// Position
|
|
23
|
+
'relative',
|
|
24
|
+
// Layout
|
|
25
|
+
'flex', 'flex-col', 'shrink-0', 'grow',
|
|
26
|
+
// Box
|
|
27
|
+
'min-h-0', 'p-0',
|
|
28
|
+
// Theme
|
|
29
|
+
'text-on-background', 'dark:text-on-background-dark',
|
|
30
|
+
// Transition
|
|
31
|
+
'transition-[width]'];
|
|
32
|
+
const SidebarToolbar = [
|
|
33
|
+
// Position
|
|
34
|
+
'relative',
|
|
35
|
+
// Layout
|
|
36
|
+
'flex', 'flex-col', 'shrink-0', 'grow', 'overflow-auto', 'items-center',
|
|
37
|
+
// Sizing
|
|
38
|
+
'gap-md',
|
|
39
|
+
// Box
|
|
40
|
+
'min-h-0', 'min-w-xl', 'p-[6px]', 'py-md+',
|
|
41
|
+
// Theme
|
|
42
|
+
'text-outline', 'dark:text-outline-dark'];
|
|
43
|
+
const CollapsibleSidebarToolbar = ['pt-[56px]'];
|
|
44
|
+
const SidebarSides = {
|
|
45
|
+
[OrSidebarPlacement.left]: [
|
|
46
|
+
// Borders
|
|
47
|
+
'border-r-[1px]', 'border-r-solid', 'border-r-outline-variant dark:border-r-outline-variant-dark'],
|
|
48
|
+
[OrSidebarPlacement.right]: [
|
|
49
|
+
// Borders
|
|
50
|
+
'border-l-[1px]', 'border-l-solid', 'border-l-outline-variant dark:border-l-outline-variant-dark']
|
|
51
|
+
};
|
|
52
|
+
const SidebarToolbarSides = {
|
|
53
|
+
[OrSidebarPlacement.left]: [
|
|
54
|
+
// Borders
|
|
55
|
+
'border-r-[1px]', 'border-r-solid', 'border-r-outline-variant dark:border-r-outline-variant-dark'],
|
|
56
|
+
[OrSidebarPlacement.right]: [
|
|
57
|
+
// Borders
|
|
58
|
+
'border-l-[1px]', 'border-l-solid', 'border-l-outline-variant dark:border-l-outline-variant-dark']
|
|
59
|
+
};
|
|
60
|
+
const SidebarResize = [
|
|
61
|
+
// Position
|
|
62
|
+
'absolute', 'inset-y-none', 'z-[1]',
|
|
63
|
+
// Box
|
|
64
|
+
'w-sm+', 'h-[100%]',
|
|
65
|
+
// Cursor
|
|
66
|
+
'cursor-ew-resize'];
|
|
67
|
+
const SidebarResizeSides = {
|
|
68
|
+
[OrSidebarPlacement.left]: [
|
|
69
|
+
// Position
|
|
70
|
+
'-right-[1px]',
|
|
71
|
+
// Borders
|
|
72
|
+
'hover:border-r-2', 'hover:border-r-primary-hover hover:dark:border-r-primary-hover-dark',
|
|
73
|
+
// Transition
|
|
74
|
+
'transition-[border-right]'],
|
|
75
|
+
[OrSidebarPlacement.right]: [
|
|
76
|
+
// Position
|
|
77
|
+
'-left-[1px]',
|
|
78
|
+
// Borders
|
|
79
|
+
'hover:border-l-2', 'hover:border-l-primary-hover hover:dark:border-l-primary-hover-dark',
|
|
80
|
+
// Transition
|
|
81
|
+
'transition-[border-left]']
|
|
82
|
+
};
|
|
83
|
+
const SidebarCollapseButton = [
|
|
84
|
+
// Position
|
|
85
|
+
'absolute', 'top-md', 'inset-y-none', 'z-[1]'];
|
|
86
|
+
const SidebarCollapseButtonSides = {
|
|
87
|
+
[OrSidebarPlacement.left]: [
|
|
88
|
+
// Position
|
|
89
|
+
'-right-[12px]'],
|
|
90
|
+
[OrSidebarPlacement.right]: [
|
|
91
|
+
// Position
|
|
92
|
+
'-left-[12px]']
|
|
93
|
+
};
|
|
94
|
+
const SidebarResizingSides = {
|
|
95
|
+
[OrSidebarPlacement.left]: [
|
|
96
|
+
// Borders
|
|
97
|
+
'border-r-2', 'border-r-primary-hover dark:border-r-primary-hover-dark'],
|
|
98
|
+
[OrSidebarPlacement.right]: [
|
|
99
|
+
// Borders
|
|
100
|
+
'border-l-2', 'border-l-primary-hover dark:border-l-primary-hover-dark']
|
|
101
|
+
};
|
|
102
|
+
const SidebarMain = [
|
|
103
|
+
// Layout
|
|
104
|
+
'flex', 'flex-col', 'grow', 'overflow-x-hidden',
|
|
105
|
+
// Box
|
|
106
|
+
'min-h-0'];
|
|
107
|
+
const SidebarHeader = [
|
|
108
|
+
// Layout
|
|
109
|
+
'shrink-0', 'overflow-hidden',
|
|
110
|
+
// Sizing
|
|
111
|
+
'p-md',
|
|
112
|
+
// Typography
|
|
113
|
+
'typography-headline-2', 'whitespace-nowrap', 'text-ellipsis'];
|
|
114
|
+
const SidebarContent = [
|
|
115
|
+
// Layout
|
|
116
|
+
'grow', 'overflow-auto',
|
|
117
|
+
// Sizing
|
|
118
|
+
'p-md'];
|
|
119
|
+
const SidebarFooter = [
|
|
120
|
+
// Layout
|
|
121
|
+
'shrink-0', 'overflow-x-hidden',
|
|
122
|
+
// Sizing
|
|
123
|
+
'p-md',
|
|
124
|
+
// Borders
|
|
125
|
+
'border-t-[1px]', 'border-t-solid', 'border-t-outline-variant dark:border-t-outline-variant-dark'];
|
|
126
|
+
const CollapseButtonContainer = [
|
|
127
|
+
// Box
|
|
128
|
+
'w-[24px]', 'h-[24px]', 'rounded-full',
|
|
129
|
+
// Theme
|
|
130
|
+
'text-primary dark:text-primary-dark', 'bg-background dark:bg-background-dark'];
|
|
131
|
+
const CollapseButton = [
|
|
132
|
+
// Box
|
|
133
|
+
'w-[24px]', 'h-[24px]',
|
|
134
|
+
// Typography
|
|
135
|
+
'!text-[16px]',
|
|
136
|
+
// Borders
|
|
137
|
+
'!border-[1px]', '!border-solid',
|
|
138
|
+
// Theme
|
|
139
|
+
'!text-primary dark:!text-primary-dark', '!bg-background dark:!bg-background-dark', '!border-outline-variant dark:!border-outline-variant-dark', '!outline-none',
|
|
140
|
+
// Theme (hover)
|
|
141
|
+
'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',
|
|
142
|
+
// Theme (active)
|
|
143
|
+
'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',
|
|
144
|
+
// Theme (focus)
|
|
145
|
+
'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',
|
|
146
|
+
// Theme (disabled)
|
|
147
|
+
'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'];
|
|
148
|
+
|
|
149
|
+
var script = defineComponent({
|
|
150
|
+
name: 'OrSidebarCollapseButton',
|
|
151
|
+
components: {
|
|
152
|
+
OrIconButton: __vue_component__$1
|
|
153
|
+
},
|
|
154
|
+
props: {
|
|
155
|
+
/**
|
|
156
|
+
* Must be `true` if sidebar is collapsed.
|
|
157
|
+
*/
|
|
158
|
+
modelValue: {
|
|
159
|
+
type: Boolean,
|
|
160
|
+
default: false
|
|
161
|
+
},
|
|
162
|
+
side: {
|
|
163
|
+
type: String,
|
|
164
|
+
default: OrSidebarPlacement.right,
|
|
165
|
+
validator: value => _.includes(_.values(OrSidebarPlacement), value)
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
emits: ['update:modelValue'],
|
|
169
|
+
expose: ['root'],
|
|
170
|
+
setup(props) {
|
|
171
|
+
// Refs
|
|
172
|
+
const root = ref();
|
|
173
|
+
const rootStyles = computed(() => ['or-sidebar-collapse-button', ...CollapseButtonContainer]);
|
|
174
|
+
const buttonStyles = computed(() => [...CollapseButton]);
|
|
175
|
+
const icon = computed(() => props.side === OrSidebarPlacement.left !== props.modelValue ? 'keyboard_arrow_left' : 'keyboard_arrow_right');
|
|
176
|
+
return {
|
|
177
|
+
root,
|
|
178
|
+
rootStyles,
|
|
179
|
+
buttonStyles,
|
|
180
|
+
icon
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
/* script */
|
|
186
|
+
const __vue_script__ = script;
|
|
187
|
+
|
|
188
|
+
/* template */
|
|
189
|
+
var __vue_render__ = function () {
|
|
190
|
+
var _vm = this;
|
|
191
|
+
var _h = _vm.$createElement;
|
|
192
|
+
var _c = _vm._self._c || _h;
|
|
193
|
+
return _c('div', {
|
|
194
|
+
ref: "root",
|
|
195
|
+
class: _vm.rootStyles
|
|
196
|
+
}, [_c('or-icon-button', {
|
|
197
|
+
class: _vm.buttonStyles,
|
|
198
|
+
attrs: {
|
|
199
|
+
"icon": {
|
|
200
|
+
icon: _vm.icon,
|
|
201
|
+
size: 'inherit'
|
|
202
|
+
},
|
|
203
|
+
"color": "inherit"
|
|
204
|
+
},
|
|
205
|
+
on: {
|
|
206
|
+
"click": function ($event) {
|
|
207
|
+
return _vm.$emit('update:modelValue', !_vm.modelValue);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
})], 1);
|
|
211
|
+
};
|
|
212
|
+
var __vue_staticRenderFns__ = [];
|
|
213
|
+
|
|
214
|
+
/* style */
|
|
215
|
+
const __vue_inject_styles__ = undefined;
|
|
216
|
+
/* scoped */
|
|
217
|
+
const __vue_scope_id__ = undefined;
|
|
218
|
+
/* module identifier */
|
|
219
|
+
const __vue_module_identifier__ = undefined;
|
|
220
|
+
/* functional template */
|
|
221
|
+
const __vue_is_functional_template__ = false;
|
|
222
|
+
/* style inject */
|
|
223
|
+
|
|
224
|
+
/* style inject SSR */
|
|
225
|
+
|
|
226
|
+
/* style inject shadow dom */
|
|
227
|
+
|
|
228
|
+
const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
229
|
+
render: __vue_render__,
|
|
230
|
+
staticRenderFns: __vue_staticRenderFns__
|
|
231
|
+
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
232
|
+
|
|
233
|
+
export { CollapsibleSidebarToolbar as C, OrSidebarPlacement as O, SidebarRoot as S, __vue_component__ as _, SidebarBar as a, SidebarSides as b, SidebarToolbar as c, SidebarToolbarSides as d, SidebarResize as e, SidebarResizeSides as f, SidebarResizingSides as g, SidebarCollapseButton as h, SidebarCollapseButtonSides as i, SidebarMain as j, SidebarHeader as k, SidebarContent as l, SidebarFooter as m };
|
|
@@ -71,7 +71,8 @@ export { _ as OrSegmentedControlV3, S as SegmentedControlSize } from '../OrSegme
|
|
|
71
71
|
export { _ as OrSelect } from '../OrSelect-dae2b069.js';
|
|
72
72
|
export { _ as OrSelectV3 } from '../OrSelect-e31d1c8b.js';
|
|
73
73
|
export { _ as OrSidebar, O as OrSidebarSide } from '../OrSidebar-7d6125bb.js';
|
|
74
|
-
export {
|
|
74
|
+
export { _ as OrSidebarV3 } from '../OrSidebar-a10424d2.js';
|
|
75
|
+
export { O as OrSidebarPlacement } from '../OrSidebarCollapseButton-3b461dfe.js';
|
|
75
76
|
export { _ as OrSkeletonCircle, a as OrSkeletonRect, b as OrSkeletonText, O as OrSkeletonTextSizes } from '../OrSkeletonText-cc94bdc9.js';
|
|
76
77
|
export { _ as OrSkeletonCircleV3, a as OrSkeletonRectV3, b as OrSkeletonTextV3 } from '../OrSkeletonText-6ee72718.js';
|
|
77
78
|
export { _ as OrSlider } from '../OrSlider-f7b9c7c2.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>)>;
|