@onereach/ui-components 2.70.3-beta.2213.0 → 2.70.3-beta.2224.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundled/v2/{OrCardCollection-89428bbf.js → OrCardCollection-166cfcc6.js} +5 -5
- package/dist/bundled/v2/{OrConfirm-56d01cff.js → OrConfirm-55b89b17.js} +4 -4
- package/dist/bundled/v2/{OrListOfInputs-8f076650.js → OrListOfInputs-ab7f9d97.js} +4 -4
- package/dist/bundled/v2/OrNumberInput-face8ccc.js +227 -0
- package/dist/bundled/v2/OrPassword-a818e7b5.js +227 -0
- package/dist/bundled/v2/{OrSearch-f7cfa52f.js → OrSearch-832d7978.js} +4 -4
- package/dist/bundled/v2/OrSidebar-c95ef614.js +230 -0
- package/dist/bundled/v2/{OrPassword-7da938aa.js → OrTextarea-71ff236d.js} +7 -449
- package/dist/bundled/v2/components/index.d.ts +5 -1
- package/dist/bundled/v2/components/index.js +10 -8
- package/dist/bundled/v2/components/or-card-collection/index.js +4 -4
- package/dist/bundled/v2/components/or-confirm/index.js +2 -2
- package/dist/bundled/v2/components/or-input/index.d.ts +1 -0
- package/dist/bundled/v2/components/or-input/index.js +13 -0
- package/dist/bundled/v2/components/or-list-of-inputs/index.js +2 -2
- package/dist/bundled/v2/components/or-number-input/index.d.ts +1 -0
- package/dist/bundled/v2/components/or-number-input/index.js +14 -0
- package/dist/bundled/v2/components/or-password/index.d.ts +1 -0
- package/dist/bundled/v2/components/{or-inputs → or-password}/index.js +3 -4
- package/dist/bundled/v2/components/or-search/index.d.ts +1 -0
- package/dist/bundled/v2/components/or-search/index.js +25 -0
- package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
- package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
- package/dist/bundled/v2/components/or-sidebar-v3/index.js +1 -13
- package/dist/bundled/v2/components/or-sidebar-v3/styles.d.ts +1 -8
- package/dist/bundled/v2/components/or-textarea/index.d.ts +1 -0
- package/dist/bundled/v2/components/or-textarea/index.js +13 -0
- package/dist/bundled/v2/index.js +10 -8
- package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-d8124dda.js → OrCardCollection.vue_vue_type_script_lang-cd84f344.js} +4 -4
- package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-0f16fc67.js → OrConfirm.vue_vue_type_script_lang-41b4d791.js} +2 -1
- package/dist/bundled/v3/{OrInput-7d4b571a.js → OrInput-704e72ba.js} +5 -193
- package/dist/bundled/v3/OrInput.vue_vue_type_script_lang-409235cc.js +190 -0
- package/dist/bundled/v3/{OrListOfInputs.vue_vue_type_script_lang-62dbf1e7.js → OrListOfInputs.vue_vue_type_script_lang-6c5cf7a5.js} +2 -1
- package/dist/bundled/v3/OrNumberInput.vue_vue_type_script_lang-f061d829.js +113 -0
- package/dist/bundled/v3/OrPassword.vue_vue_type_script_lang-b75f6543.js +99 -0
- package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-16fbccc0.js → OrSearch.vue_vue_type_script_lang-5356fa79.js} +2 -1
- package/dist/bundled/v3/OrSidebar.vue_vue_type_script_lang-ce0b152c.js +181 -0
- package/dist/bundled/v3/OrTextarea.vue_vue_type_script_lang-69ea22e9.js +187 -0
- package/dist/bundled/v3/components/index.d.ts +5 -1
- package/dist/bundled/v3/components/index.js +11 -8
- package/dist/bundled/v3/components/or-card-collection/index.js +5 -4
- package/dist/bundled/v3/components/or-confirm/index.js +3 -2
- package/dist/bundled/v3/components/or-input/index.d.ts +1 -0
- package/dist/bundled/v3/components/or-input/index.js +14 -0
- package/dist/bundled/v3/components/or-list-of-inputs/index.js +3 -2
- package/dist/bundled/v3/components/or-number-input/index.d.ts +1 -0
- package/dist/bundled/v3/components/or-number-input/index.js +16 -0
- package/dist/bundled/v3/components/or-password/index.d.ts +1 -0
- package/dist/bundled/v3/components/or-password/index.js +31 -0
- package/dist/bundled/v3/components/or-search/index.d.ts +1 -0
- package/dist/bundled/v3/components/{or-inputs → or-search}/index.js +4 -5
- package/dist/bundled/v3/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
- package/dist/bundled/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
- package/dist/bundled/v3/components/or-sidebar-v3/index.js +1 -15
- package/dist/bundled/v3/components/or-sidebar-v3/styles.d.ts +1 -8
- package/dist/bundled/v3/components/or-textarea/index.d.ts +1 -0
- package/dist/bundled/v3/components/or-textarea/index.js +14 -0
- package/dist/bundled/v3/index.js +666 -677
- package/dist/esm/v2/{OrCardCollection-f6b07557.js → OrCardCollection-19582949.js} +6 -7
- package/dist/esm/v2/{OrConfirm-d7112dd3.js → OrConfirm-ede619eb.js} +4 -4
- package/dist/esm/v2/{OrSearch.vue_rollup-plugin-vue_script-197d77fc.js → OrInput-6e6cfd11.js} +4 -492
- package/dist/esm/v2/{OrListOfInputs-50aa1ef1.js → OrListOfInputs-4298fa2c.js} +5 -5
- package/dist/esm/v2/OrNumberInput-b20d75d2.js +225 -0
- package/dist/esm/v2/OrPassword-e6d5e968.js +225 -0
- package/dist/esm/v2/{OrSearch-0589d17d.js → OrSearch-b4f4d59b.js} +122 -5
- package/dist/esm/v2/OrSidebar-fabc7bc9.js +228 -0
- package/dist/esm/v2/{OrPassword-1fa97156.js → OrTextarea-91a95068.js} +187 -245
- package/dist/esm/v2/components/index.d.ts +5 -1
- package/dist/esm/v2/components/index.js +10 -8
- package/dist/esm/v2/components/or-card-collection/index.js +3 -4
- package/dist/esm/v2/components/or-confirm/index.js +2 -3
- package/dist/esm/v2/components/or-input/index.d.ts +1 -0
- package/dist/esm/v2/components/or-input/index.js +11 -0
- package/dist/esm/v2/components/or-list-of-inputs/index.js +2 -4
- package/dist/esm/v2/components/or-number-input/index.d.ts +1 -0
- package/dist/esm/v2/components/or-number-input/index.js +12 -0
- package/dist/esm/v2/components/or-password/index.d.ts +1 -0
- package/dist/esm/v2/components/{or-inputs → or-password}/index.js +5 -6
- package/dist/esm/v2/components/or-search/index.d.ts +1 -0
- package/dist/esm/v2/components/or-search/index.js +23 -0
- package/dist/esm/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
- package/dist/esm/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
- package/dist/esm/v2/components/or-sidebar-v3/index.js +1 -13
- package/dist/esm/v2/components/or-sidebar-v3/styles.d.ts +1 -8
- package/dist/esm/v2/components/or-textarea/index.d.ts +1 -0
- package/dist/esm/v2/components/or-textarea/index.js +11 -0
- package/dist/esm/v2/index.js +9 -7
- package/dist/esm/v3/{OrCardCollection-a5e326ef.js → OrCardCollection-1e44c758.js} +2 -2
- package/dist/esm/v3/{OrConfirm-f39bd784.js → OrConfirm-c11ee2ec.js} +1 -1
- package/dist/esm/v3/OrInput-81125804.js +295 -0
- package/dist/esm/v3/{OrListOfInputs-7a67440f.js → OrListOfInputs-508e056f.js} +1 -1
- package/dist/esm/v3/OrNumberInput-b32b5ce3.js +170 -0
- package/dist/esm/v3/OrPassword-b0cbb578.js +162 -0
- package/dist/esm/v3/OrSearch-11fdf667.js +188 -0
- package/dist/esm/v3/OrSidebar-a62972f5.js +206 -0
- package/dist/esm/v3/OrTextarea-1f5c3be1.js +290 -0
- package/dist/esm/v3/components/index.d.ts +5 -1
- package/dist/esm/v3/components/index.js +10 -6
- package/dist/esm/v3/components/or-card-collection/index.js +3 -3
- package/dist/esm/v3/components/or-confirm/index.js +2 -3
- package/dist/esm/v3/components/or-input/index.d.ts +1 -0
- package/dist/esm/v3/components/or-input/index.js +11 -0
- package/dist/esm/v3/components/or-list-of-inputs/index.js +2 -4
- package/dist/esm/v3/components/or-number-input/index.d.ts +1 -0
- package/dist/esm/v3/components/or-number-input/index.js +12 -0
- package/dist/esm/v3/components/or-password/index.d.ts +1 -0
- package/dist/esm/v3/components/{or-inputs → or-password}/index.js +3 -2
- package/dist/esm/v3/components/or-search/index.d.ts +1 -0
- package/dist/esm/v3/components/or-search/index.js +20 -0
- package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
- package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
- package/dist/esm/v3/components/or-sidebar-v3/index.js +1 -12
- package/dist/esm/v3/components/or-sidebar-v3/styles.d.ts +1 -8
- package/dist/esm/v3/components/or-textarea/index.d.ts +1 -0
- package/dist/esm/v3/components/or-textarea/index.js +11 -0
- package/dist/esm/v3/index.js +9 -5
- package/package.json +1 -1
- package/src/components/index.ts +5 -1
- package/src/components/or-card-collection/OrCardCollection.vue +8 -8
- package/src/components/or-confirm/OrConfirm.vue +1 -1
- package/src/components/or-input/index.ts +1 -0
- package/src/components/or-list/OrList.stories.ts +1 -1
- package/src/components/or-list-of-inputs/OrListOfInputs.vue +1 -1
- package/src/components/or-modal/OrModal.stories.ts +1 -1
- package/src/components/{or-inputs → or-number-input}/OrNumberInput.vue +1 -1
- package/src/components/or-number-input/index.ts +1 -0
- package/src/components/{or-inputs → or-password}/OrPassword.vue +1 -1
- package/src/components/or-password/index.ts +1 -0
- package/src/components/{or-inputs → or-search}/OrSearch.vue +1 -1
- package/src/components/or-search/index.ts +1 -0
- package/src/components/or-sidebar-v3/OrSidebar.docs.mdx +0 -6
- package/src/components/or-sidebar-v3/OrSidebar.stories3.ts +10 -230
- package/src/components/or-sidebar-v3/OrSidebar.vue +22 -121
- package/src/components/or-sidebar-v3/styles.ts +9 -161
- package/src/components/{or-inputs → or-textarea}/OrTextarea.vue +225 -6
- package/src/components/or-textarea/index.ts +1 -0
- package/dist/bundled/v2/OrSidebar-774b382d.js +0 -462
- package/dist/bundled/v2/components/or-inputs/index.d.ts +0 -5
- package/dist/bundled/v2/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
- package/dist/bundled/v2/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -53
- package/dist/bundled/v3/OrPassword.vue_vue_type_script_lang-13bc5b00.js +0 -390
- package/dist/bundled/v3/OrSidebar.vue_vue_type_script_lang-8305a28b.js +0 -354
- package/dist/bundled/v3/components/or-inputs/index.d.ts +0 -5
- package/dist/bundled/v3/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
- package/dist/bundled/v3/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -53
- package/dist/esm/v2/OrSidebar-a6ee22d1.js +0 -459
- package/dist/esm/v2/components/or-inputs/index.d.ts +0 -5
- package/dist/esm/v2/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
- package/dist/esm/v2/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -53
- package/dist/esm/v3/OrSearch-7cb2c91c.js +0 -1075
- package/dist/esm/v3/OrSidebar-f2150587.js +0 -394
- package/dist/esm/v3/components/or-inputs/index.d.ts +0 -5
- package/dist/esm/v3/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
- package/dist/esm/v3/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -53
- package/src/components/or-inputs/index.ts +0 -5
- package/src/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.ts +0 -48
- package/src/components/or-sidebar-v3/OrSidebarCollapseButton.vue +0 -74
- /package/dist/bundled/v2/{OrInput-08f2f666.js → OrInput-df1a14fa.js} +0 -0
- /package/dist/bundled/v2/components/{or-inputs → or-input}/OrInput.vue.d.ts +0 -0
- /package/dist/bundled/v2/components/{or-inputs → or-number-input}/OrNumberInput.vue.d.ts +0 -0
- /package/dist/bundled/v2/components/{or-inputs → or-password}/OrPassword.vue.d.ts +0 -0
- /package/dist/bundled/v2/components/{or-inputs → or-search}/OrSearch.vue.d.ts +0 -0
- /package/dist/bundled/v2/components/{or-inputs → or-textarea}/OrTextarea.vue.d.ts +0 -0
- /package/dist/bundled/v3/components/{or-inputs → or-input}/OrInput.vue.d.ts +0 -0
- /package/dist/bundled/v3/components/{or-inputs → or-number-input}/OrNumberInput.vue.d.ts +0 -0
- /package/dist/bundled/v3/components/{or-inputs → or-password}/OrPassword.vue.d.ts +0 -0
- /package/dist/bundled/v3/components/{or-inputs → or-search}/OrSearch.vue.d.ts +0 -0
- /package/dist/bundled/v3/components/{or-inputs → or-textarea}/OrTextarea.vue.d.ts +0 -0
- /package/dist/esm/v2/components/{or-inputs → or-input}/OrInput.vue.d.ts +0 -0
- /package/dist/esm/v2/components/{or-inputs → or-number-input}/OrNumberInput.vue.d.ts +0 -0
- /package/dist/esm/v2/components/{or-inputs → or-password}/OrPassword.vue.d.ts +0 -0
- /package/dist/esm/v2/components/{or-inputs → or-search}/OrSearch.vue.d.ts +0 -0
- /package/dist/esm/v2/components/{or-inputs → or-textarea}/OrTextarea.vue.d.ts +0 -0
- /package/dist/esm/v3/components/{or-inputs → or-input}/OrInput.vue.d.ts +0 -0
- /package/dist/esm/v3/components/{or-inputs → or-number-input}/OrNumberInput.vue.d.ts +0 -0
- /package/dist/esm/v3/components/{or-inputs → or-password}/OrPassword.vue.d.ts +0 -0
- /package/dist/esm/v3/components/{or-inputs → or-search}/OrSearch.vue.d.ts +0 -0
- /package/dist/esm/v3/components/{or-inputs → or-textarea}/OrTextarea.vue.d.ts +0 -0
- /package/src/components/{or-inputs → or-input}/OrInput.stories.ts +0 -0
- /package/src/components/{or-inputs → or-input}/OrInput.vue +0 -0
- /package/src/components/{or-inputs → or-input}/or-textbox-migration.stories.mdx +0 -0
- /package/src/components/{or-inputs → or-input}/styles.scss +0 -0
- /package/src/components/{or-inputs → or-number-input}/OrNumberInput.stories.ts +0 -0
- /package/src/components/{or-inputs → or-password}/OrPassword.stories.ts +0 -0
- /package/src/components/{or-inputs → or-search}/OrSearch.stories.ts +0 -0
- /package/src/components/{or-inputs → or-textarea}/OrTextarea.stories.ts +0 -0
|
@@ -3,11 +3,8 @@ import OrSidebarDocs from './OrSidebar.docs.mdx';
|
|
|
3
3
|
import OrSidebar from './OrSidebar.vue';
|
|
4
4
|
import { OrSidebarPlacement } from './props';
|
|
5
5
|
import { action } from '@storybook/addon-actions';
|
|
6
|
-
import { ref } from 'vue-demi';
|
|
7
6
|
import * as Faker from 'faker';
|
|
8
7
|
import { OrButtonV3 as OrButton } from '../or-button-v3';
|
|
9
|
-
import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3';
|
|
10
|
-
import { OrTabsV3 as OrTabs, TabsItem } from '../or-tabs-v3';
|
|
11
8
|
|
|
12
9
|
export default {
|
|
13
10
|
title: 'Components/Sidebar',
|
|
@@ -42,15 +39,6 @@ export default {
|
|
|
42
39
|
control: { type: 'text' },
|
|
43
40
|
},
|
|
44
41
|
|
|
45
|
-
toolbar: {
|
|
46
|
-
type: {
|
|
47
|
-
name: 'string',
|
|
48
|
-
required: false,
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
control: { type: 'text' },
|
|
52
|
-
},
|
|
53
|
-
|
|
54
42
|
// Props
|
|
55
43
|
width: {
|
|
56
44
|
control: { type: 'number' },
|
|
@@ -64,17 +52,11 @@ export default {
|
|
|
64
52
|
control: { type: 'select' },
|
|
65
53
|
options: Object.values(OrSidebarPlacement),
|
|
66
54
|
},
|
|
67
|
-
|
|
68
|
-
draggable: {
|
|
69
|
-
control: { type: 'boolean' },
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
collapsible: {
|
|
73
|
-
control: { type: 'boolean' },
|
|
74
|
-
},
|
|
75
55
|
},
|
|
76
56
|
|
|
77
57
|
parameters: {
|
|
58
|
+
layout: 'centered',
|
|
59
|
+
|
|
78
60
|
docs: {
|
|
79
61
|
page: OrSidebarDocs,
|
|
80
62
|
},
|
|
@@ -85,7 +67,6 @@ const DefaultTemplate: StoryFn<typeof OrSidebar> = (args) => ({
|
|
|
85
67
|
components: {
|
|
86
68
|
OrSidebar,
|
|
87
69
|
OrButton,
|
|
88
|
-
OrIconButton,
|
|
89
70
|
},
|
|
90
71
|
|
|
91
72
|
setup() {
|
|
@@ -97,12 +78,9 @@ const DefaultTemplate: StoryFn<typeof OrSidebar> = (args) => ({
|
|
|
97
78
|
},
|
|
98
79
|
|
|
99
80
|
template: `
|
|
100
|
-
<div style="display: flex; flex-direction: row; border: 1px solid gray; height:
|
|
101
|
-
<div
|
|
102
|
-
|
|
103
|
-
style="flex-grow: 1; overflow: auto; padding: 16px"
|
|
104
|
-
>
|
|
105
|
-
${Faker.lorem.paragraphs(10)}
|
|
81
|
+
<div style="display: flex; flex-direction: row; border: 1px solid gray; max-height: 500px">
|
|
82
|
+
<div style="flex-grow: 1; overflow: auto">
|
|
83
|
+
${Faker.lorem.paragraphs(3)}
|
|
106
84
|
</div>
|
|
107
85
|
<OrSidebar v-bind="args" @change:width="onChangeWidth">
|
|
108
86
|
<template v-if="${!!args.header}" v-slot:header>
|
|
@@ -114,9 +92,6 @@ const DefaultTemplate: StoryFn<typeof OrSidebar> = (args) => ({
|
|
|
114
92
|
<template v-if="${!!args.footer}" v-slot:footer>
|
|
115
93
|
${args.footer}
|
|
116
94
|
</template>
|
|
117
|
-
<template v-if="${!!args.toolbar}" v-slot:toolbar>
|
|
118
|
-
${args.toolbar}
|
|
119
|
-
</template>
|
|
120
95
|
</OrSidebar>
|
|
121
96
|
</div>
|
|
122
97
|
`,
|
|
@@ -126,7 +101,6 @@ const LeftTemplate: StoryFn<typeof OrSidebar> = (args) => ({
|
|
|
126
101
|
components: {
|
|
127
102
|
OrSidebar,
|
|
128
103
|
OrButton,
|
|
129
|
-
OrIconButton,
|
|
130
104
|
},
|
|
131
105
|
|
|
132
106
|
setup() {
|
|
@@ -138,7 +112,7 @@ const LeftTemplate: StoryFn<typeof OrSidebar> = (args) => ({
|
|
|
138
112
|
},
|
|
139
113
|
|
|
140
114
|
template: `
|
|
141
|
-
<div style="display: flex; flex-direction: row; border: 1px solid gray; height:
|
|
115
|
+
<div style="display: flex; flex-direction: row; border: 1px solid gray; max-height: 500px">
|
|
142
116
|
<OrSidebar v-bind="args" @change:width="onChangeWidth">
|
|
143
117
|
<template v-if="${!!args.header}" v-slot:header>
|
|
144
118
|
${args.header}
|
|
@@ -149,143 +123,14 @@ const LeftTemplate: StoryFn<typeof OrSidebar> = (args) => ({
|
|
|
149
123
|
<template v-if="${!!args.footer}" v-slot:footer>
|
|
150
124
|
${args.footer}
|
|
151
125
|
</template>
|
|
152
|
-
<template v-if="${!!args.toolbar}" v-slot:toolbar>
|
|
153
|
-
${args.toolbar}
|
|
154
|
-
</template>
|
|
155
126
|
</OrSidebar>
|
|
156
|
-
<div
|
|
157
|
-
|
|
158
|
-
style="flex-grow: 1; overflow: auto; padding: 16px"
|
|
159
|
-
>
|
|
160
|
-
${Faker.lorem.paragraphs(10)}
|
|
127
|
+
<div style="flex-grow: 1; overflow: auto">
|
|
128
|
+
${Faker.lorem.paragraphs(3)}
|
|
161
129
|
</div>
|
|
162
130
|
</div>
|
|
163
131
|
`,
|
|
164
132
|
});
|
|
165
133
|
|
|
166
|
-
const TabsTemplate: StoryFn<typeof OrSidebar> = (args) => ({
|
|
167
|
-
components: {
|
|
168
|
-
OrSidebar,
|
|
169
|
-
OrButton,
|
|
170
|
-
OrIconButton,
|
|
171
|
-
OrTabs,
|
|
172
|
-
},
|
|
173
|
-
|
|
174
|
-
setup() {
|
|
175
|
-
// State
|
|
176
|
-
const model = ref<string>();
|
|
177
|
-
|
|
178
|
-
return {
|
|
179
|
-
args,
|
|
180
|
-
model,
|
|
181
|
-
};
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
methods: {
|
|
185
|
-
onChangeWidth: action('change:width'),
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
template: `
|
|
189
|
-
<div style="display: flex; flex-direction: row; border: 1px solid gray; height: 650px">
|
|
190
|
-
<div
|
|
191
|
-
class="theme-background-surface-1 dark:theme-background-surface-1-dark text-on-background dark:text-on-background-dark"
|
|
192
|
-
style="flex-grow: 1; overflow: auto; padding: 16px"
|
|
193
|
-
>
|
|
194
|
-
${Faker.lorem.paragraphs(10)}
|
|
195
|
-
</div>
|
|
196
|
-
<OrSidebar v-bind="args" @change:width="onChangeWidth">
|
|
197
|
-
<template v-if="${!!args.header}" v-slot:header>
|
|
198
|
-
${args.header}
|
|
199
|
-
</template>
|
|
200
|
-
<template v-if="${!!args.default}" v-slot:default>
|
|
201
|
-
${args.default}
|
|
202
|
-
</template>
|
|
203
|
-
<template v-else v-slot:default>
|
|
204
|
-
<or-tabs
|
|
205
|
-
v-model="model"
|
|
206
|
-
:items="args.items"
|
|
207
|
-
>
|
|
208
|
-
<template v-for="item in args.items" #[item.value]>
|
|
209
|
-
{{ item.label }} Content
|
|
210
|
-
${Faker.lorem.paragraphs(3)}
|
|
211
|
-
</template>
|
|
212
|
-
</or-tabs>
|
|
213
|
-
</template>
|
|
214
|
-
<template v-if="${!!args.footer}" v-slot:footer>
|
|
215
|
-
${args.footer}
|
|
216
|
-
</template>
|
|
217
|
-
<template v-if="${!!args.toolbar}" v-slot:toolbar>
|
|
218
|
-
${args.toolbar}
|
|
219
|
-
</template>
|
|
220
|
-
</OrSidebar>
|
|
221
|
-
</div>
|
|
222
|
-
`,
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
const longToolbar = `
|
|
226
|
-
<or-icon-button
|
|
227
|
-
icon="refresh"
|
|
228
|
-
color="inherit"
|
|
229
|
-
/>
|
|
230
|
-
<hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
|
|
231
|
-
<or-icon-button
|
|
232
|
-
icon="add"
|
|
233
|
-
color="inherit"
|
|
234
|
-
/>
|
|
235
|
-
<or-icon-button
|
|
236
|
-
icon="zoom_out_map"
|
|
237
|
-
color="inherit"
|
|
238
|
-
/>
|
|
239
|
-
<or-icon-button
|
|
240
|
-
icon="remove"
|
|
241
|
-
color="inherit"
|
|
242
|
-
/>
|
|
243
|
-
<hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
|
|
244
|
-
<or-icon-button
|
|
245
|
-
icon="description"
|
|
246
|
-
color="inherit"
|
|
247
|
-
/>
|
|
248
|
-
<or-icon-button
|
|
249
|
-
icon="tab_unselected"
|
|
250
|
-
color="inherit"
|
|
251
|
-
/>
|
|
252
|
-
<hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
|
|
253
|
-
<or-icon-button
|
|
254
|
-
icon="create_new_folder"
|
|
255
|
-
color="inherit"
|
|
256
|
-
/>
|
|
257
|
-
<or-icon-button
|
|
258
|
-
icon="content_paste"
|
|
259
|
-
color="inherit"
|
|
260
|
-
/>
|
|
261
|
-
<or-icon-button
|
|
262
|
-
icon="location_on"
|
|
263
|
-
color="inherit"
|
|
264
|
-
/>
|
|
265
|
-
<or-icon-button
|
|
266
|
-
icon="copy_all"
|
|
267
|
-
color="inherit"
|
|
268
|
-
/>
|
|
269
|
-
<or-icon-button
|
|
270
|
-
icon="call_split"
|
|
271
|
-
color="inherit"
|
|
272
|
-
/>
|
|
273
|
-
<hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
|
|
274
|
-
<or-icon-button
|
|
275
|
-
icon="sell"
|
|
276
|
-
color="inherit"
|
|
277
|
-
/>
|
|
278
|
-
<div class="mt-auto" />
|
|
279
|
-
<or-icon-button
|
|
280
|
-
icon="terminal"
|
|
281
|
-
color="inherit"
|
|
282
|
-
/>
|
|
283
|
-
<or-icon-button
|
|
284
|
-
icon="delete"
|
|
285
|
-
color="inherit"
|
|
286
|
-
/>
|
|
287
|
-
`;
|
|
288
|
-
|
|
289
134
|
export const Default = DefaultTemplate.bind({});
|
|
290
135
|
Default.args = {
|
|
291
136
|
header: 'Header',
|
|
@@ -293,24 +138,11 @@ Default.args = {
|
|
|
293
138
|
footer: 'Footer',
|
|
294
139
|
};
|
|
295
140
|
|
|
296
|
-
export const
|
|
297
|
-
|
|
141
|
+
export const WithMinimumWidth = DefaultTemplate.bind({});
|
|
142
|
+
WithMinimumWidth.args = {
|
|
298
143
|
...Default.args,
|
|
299
144
|
width: 250,
|
|
300
145
|
minimumWidth: 200,
|
|
301
|
-
maximumWidth: 500,
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
export const NotDraggable = DefaultTemplate.bind({});
|
|
305
|
-
NotDraggable.args = {
|
|
306
|
-
...Default.args,
|
|
307
|
-
draggable: false,
|
|
308
|
-
};
|
|
309
|
-
|
|
310
|
-
export const Collapsible = DefaultTemplate.bind({});
|
|
311
|
-
Collapsible.args = {
|
|
312
|
-
...Default.args,
|
|
313
|
-
collapsible: true,
|
|
314
146
|
};
|
|
315
147
|
|
|
316
148
|
export const OnlyContent = DefaultTemplate.bind({});
|
|
@@ -335,60 +167,8 @@ WithFooter.args = {
|
|
|
335
167
|
`,
|
|
336
168
|
};
|
|
337
169
|
|
|
338
|
-
export const WithToolbar = DefaultTemplate.bind({});
|
|
339
|
-
WithToolbar.args = {
|
|
340
|
-
...OnlyContent.args,
|
|
341
|
-
toolbar: longToolbar,
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
export const CollapsibleWithToolbar = DefaultTemplate.bind({});
|
|
345
|
-
CollapsibleWithToolbar.args = {
|
|
346
|
-
...WithToolbar.args,
|
|
347
|
-
collapsible: true,
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
export const WithTabs = TabsTemplate.bind({});
|
|
351
|
-
WithTabs.args = {
|
|
352
|
-
minimumWidth: 352,
|
|
353
|
-
header: 'Headline',
|
|
354
|
-
items: Array.from<string, TabsItem>([
|
|
355
|
-
'Alfa',
|
|
356
|
-
'Bravo',
|
|
357
|
-
'Charlie',
|
|
358
|
-
'Delta',
|
|
359
|
-
'Echo',
|
|
360
|
-
'Foxtrot',
|
|
361
|
-
'Golf',
|
|
362
|
-
'Hotel',
|
|
363
|
-
'India',
|
|
364
|
-
'Juliett',
|
|
365
|
-
], (item) => ({
|
|
366
|
-
value: item.toLowerCase(),
|
|
367
|
-
label: item,
|
|
368
|
-
})),
|
|
369
|
-
footer: `
|
|
370
|
-
<div style="display: flex; flex-direction: row; justify-content: end; gap: 16px">
|
|
371
|
-
<or-button color="danger" variant="outlined">Delete</or-button>
|
|
372
|
-
<or-button variant="outlined" class="ml-auto">Cancel</or-button>
|
|
373
|
-
<or-button>Save</or-button>
|
|
374
|
-
</div>
|
|
375
|
-
`,
|
|
376
|
-
};
|
|
377
|
-
|
|
378
170
|
export const LeftSidebar = LeftTemplate.bind({});
|
|
379
171
|
LeftSidebar.args = {
|
|
380
172
|
...Default.args,
|
|
381
173
|
side: 'left',
|
|
382
174
|
};
|
|
383
|
-
|
|
384
|
-
export const WithLeftToolbar = LeftTemplate.bind({});
|
|
385
|
-
WithLeftToolbar.args = {
|
|
386
|
-
...LeftSidebar.args,
|
|
387
|
-
toolbar: longToolbar,
|
|
388
|
-
};
|
|
389
|
-
|
|
390
|
-
export const CollapsibleWithWithLeftToolbar = LeftTemplate.bind({});
|
|
391
|
-
CollapsibleWithWithLeftToolbar.args = {
|
|
392
|
-
...WithLeftToolbar.args,
|
|
393
|
-
collapsible: true,
|
|
394
|
-
};
|
|
@@ -2,55 +2,28 @@
|
|
|
2
2
|
<aside
|
|
3
3
|
ref="root"
|
|
4
4
|
:class="rootStyles"
|
|
5
|
+
:style="sidebarStyle"
|
|
5
6
|
>
|
|
6
7
|
<div
|
|
7
|
-
|
|
8
|
-
:class="
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
</div>
|
|
12
|
-
<div
|
|
13
|
-
:class="sidebarStyles"
|
|
14
|
-
:style="sidebarStyle"
|
|
15
|
-
>
|
|
8
|
+
ref="resizeBar"
|
|
9
|
+
:class="resizeStyles"
|
|
10
|
+
/>
|
|
11
|
+
<div :class="mainStyles">
|
|
16
12
|
<div
|
|
17
|
-
v-if="
|
|
18
|
-
|
|
19
|
-
:class="resizeStyles"
|
|
20
|
-
/>
|
|
21
|
-
<or-sidebar-collapse-button
|
|
22
|
-
v-if="collapsible"
|
|
23
|
-
v-model="isCollapsed"
|
|
24
|
-
:class="collapsibleButtonStyles"
|
|
25
|
-
:side="side"
|
|
26
|
-
/>
|
|
27
|
-
<div
|
|
28
|
-
v-show="!isCollapsed"
|
|
29
|
-
:class="mainStyles"
|
|
13
|
+
v-if="$slots.header"
|
|
14
|
+
:class="headerStyles"
|
|
30
15
|
>
|
|
31
|
-
<
|
|
32
|
-
v-if="$slots.header"
|
|
33
|
-
:class="headerStyles"
|
|
34
|
-
>
|
|
35
|
-
<slot name="header" />
|
|
36
|
-
</div>
|
|
37
|
-
<div :class="contentStyles">
|
|
38
|
-
<slot />
|
|
39
|
-
</div>
|
|
16
|
+
<slot name="header" />
|
|
40
17
|
</div>
|
|
41
|
-
<div
|
|
42
|
-
|
|
43
|
-
v-show="!isCollapsed"
|
|
44
|
-
:class="footerStyles"
|
|
45
|
-
>
|
|
46
|
-
<slot name="footer" />
|
|
18
|
+
<div :class="contentStyles">
|
|
19
|
+
<slot />
|
|
47
20
|
</div>
|
|
48
21
|
</div>
|
|
49
22
|
<div
|
|
50
|
-
v-if="
|
|
51
|
-
:class="
|
|
23
|
+
v-if="$slots.footer"
|
|
24
|
+
:class="footerStyles"
|
|
52
25
|
>
|
|
53
|
-
<slot name="
|
|
26
|
+
<slot name="footer" />
|
|
54
27
|
</div>
|
|
55
28
|
</aside>
|
|
56
29
|
</template>
|
|
@@ -58,47 +31,34 @@
|
|
|
58
31
|
<script lang="ts">
|
|
59
32
|
import { useDraggable, useElementBounding } from '@vueuse/core';
|
|
60
33
|
import _ from 'lodash';
|
|
61
|
-
import { computed, defineComponent, PropType, ref, watch
|
|
34
|
+
import { computed, defineComponent, PropType, ref, watch } from 'vue-demi';
|
|
62
35
|
import { OrSidebarPlacement } from './props';
|
|
63
36
|
import {
|
|
64
37
|
SidebarRoot,
|
|
65
|
-
|
|
66
|
-
SidebarToolbar,
|
|
67
|
-
SidebarSides,
|
|
68
|
-
SidebarToolbarSides,
|
|
38
|
+
SidebarRootSides,
|
|
69
39
|
SidebarResize,
|
|
70
40
|
SidebarResizeSides,
|
|
71
|
-
SidebarCollapseButton,
|
|
72
|
-
SidebarCollapseButtonSides,
|
|
73
41
|
SidebarResizingSides,
|
|
74
42
|
SidebarMain,
|
|
75
43
|
SidebarHeader,
|
|
76
44
|
SidebarContent,
|
|
77
45
|
SidebarFooter,
|
|
78
46
|
} from './styles';
|
|
79
|
-
import OrSidebarCollapseButton from './OrSidebarCollapseButton.vue';
|
|
80
47
|
|
|
81
48
|
export default defineComponent({
|
|
82
49
|
name: 'OrSidebar',
|
|
83
50
|
|
|
84
|
-
components: {
|
|
85
|
-
OrSidebarCollapseButton,
|
|
86
|
-
},
|
|
87
|
-
|
|
88
51
|
props: {
|
|
89
52
|
width: {
|
|
90
53
|
type: Number,
|
|
91
|
-
|
|
54
|
+
required: false,
|
|
55
|
+
default: 0,
|
|
92
56
|
validator: (value?: any) => _.isNumber(value) && value >= 0,
|
|
93
57
|
},
|
|
94
58
|
minimumWidth: {
|
|
95
59
|
type: Number,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
},
|
|
99
|
-
maximumWidth: {
|
|
100
|
-
type: Number,
|
|
101
|
-
default: 384,
|
|
60
|
+
required: false,
|
|
61
|
+
default: 350,
|
|
102
62
|
validator: (value?: any) => _.isNumber(value) && value >= 0,
|
|
103
63
|
},
|
|
104
64
|
/**
|
|
@@ -113,24 +73,10 @@ export default defineComponent({
|
|
|
113
73
|
default: OrSidebarPlacement.right,
|
|
114
74
|
validator: (value?: any) => _.includes(_.values(OrSidebarPlacement), value),
|
|
115
75
|
},
|
|
116
|
-
draggable: {
|
|
117
|
-
type: Boolean,
|
|
118
|
-
default: true,
|
|
119
|
-
},
|
|
120
|
-
collapsible: {
|
|
121
|
-
type: Boolean,
|
|
122
|
-
default: false,
|
|
123
|
-
},
|
|
124
76
|
},
|
|
125
77
|
|
|
126
78
|
emits: ['change:width'],
|
|
127
79
|
|
|
128
|
-
expose: [
|
|
129
|
-
'root',
|
|
130
|
-
'open',
|
|
131
|
-
'close',
|
|
132
|
-
],
|
|
133
|
-
|
|
134
80
|
setup(props, { emit }) {
|
|
135
81
|
// Refs
|
|
136
82
|
const root = ref<HTMLElement>();
|
|
@@ -138,36 +84,20 @@ export default defineComponent({
|
|
|
138
84
|
|
|
139
85
|
const parentContainer = computed(() => root.value?.parentElement);
|
|
140
86
|
|
|
141
|
-
// Slots
|
|
142
|
-
const { toolbar: toolbarSlot } = useSlots();
|
|
143
|
-
|
|
144
87
|
// State
|
|
145
88
|
const startPositionX = ref(0);
|
|
146
89
|
const isResizing = ref(false);
|
|
147
|
-
const isCollapsed = ref(false);
|
|
148
|
-
const maximumWidth = ref(props.maximumWidth || 384);
|
|
149
90
|
const localWidth = ref(props.width >= props.minimumWidth ? props.width : props.minimumWidth);
|
|
150
91
|
|
|
151
|
-
const isShowingToolbar = computed(() => !!toolbarSlot);
|
|
152
|
-
|
|
153
92
|
// Styles
|
|
154
93
|
const sidebarStyle = computed(() => ({
|
|
155
|
-
width:
|
|
94
|
+
width: localWidth.value + 'px',
|
|
156
95
|
}));
|
|
157
96
|
|
|
158
97
|
const rootStyles = computed(() => [
|
|
159
98
|
'or-sidebar',
|
|
160
99
|
...SidebarRoot,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
const sidebarStyles = computed(() => [
|
|
164
|
-
...SidebarBar,
|
|
165
|
-
...SidebarSides[props.side],
|
|
166
|
-
]);
|
|
167
|
-
|
|
168
|
-
const toolbarStyles = computed(() => [
|
|
169
|
-
...SidebarToolbar,
|
|
170
|
-
...SidebarToolbarSides[props.side],
|
|
100
|
+
...SidebarRootSides[props.side],
|
|
171
101
|
]);
|
|
172
102
|
|
|
173
103
|
const resizeStyles = computed(() => [
|
|
@@ -176,11 +106,6 @@ export default defineComponent({
|
|
|
176
106
|
...(isResizing.value ? SidebarResizingSides[props.side] : []),
|
|
177
107
|
]);
|
|
178
108
|
|
|
179
|
-
const collapsibleButtonStyles = computed(() => [
|
|
180
|
-
...SidebarCollapseButton,
|
|
181
|
-
...SidebarCollapseButtonSides[props.side],
|
|
182
|
-
]);
|
|
183
|
-
|
|
184
109
|
const mainStyles = computed(() => [...SidebarMain]);
|
|
185
110
|
|
|
186
111
|
const headerStyles = computed(() => [...SidebarHeader]);
|
|
@@ -212,16 +137,7 @@ export default defineComponent({
|
|
|
212
137
|
},
|
|
213
138
|
});
|
|
214
139
|
|
|
215
|
-
|
|
216
|
-
function open(): void {
|
|
217
|
-
isCollapsed.value = false;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
function close(): void {
|
|
221
|
-
isCollapsed.value = true;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
const { width: containerWidth } = useElementBounding(parentContainer);
|
|
140
|
+
const { width: maximumWidth } = useElementBounding(parentContainer);
|
|
225
141
|
|
|
226
142
|
watch(() => props.width, (newValue: number) => {
|
|
227
143
|
if (newValue !== localWidth.value) {
|
|
@@ -234,14 +150,6 @@ export default defineComponent({
|
|
|
234
150
|
if (newMinimum > localWidth.value) localWidth.value = newMinimum;
|
|
235
151
|
});
|
|
236
152
|
|
|
237
|
-
watch(() => props.maximumWidth, (newMaximum: number) => {
|
|
238
|
-
if (newMaximum < maximumWidth.value) maximumWidth.value = newMaximum;
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
watch(containerWidth, (newMaximum: number) => {
|
|
242
|
-
if (newMaximum < maximumWidth.value) maximumWidth.value = newMaximum;
|
|
243
|
-
});
|
|
244
|
-
|
|
245
153
|
watch(maximumWidth, (newMaximum: number) => {
|
|
246
154
|
if (newMaximum < localWidth.value) localWidth.value = newMaximum;
|
|
247
155
|
});
|
|
@@ -252,21 +160,14 @@ export default defineComponent({
|
|
|
252
160
|
root,
|
|
253
161
|
resizeBar,
|
|
254
162
|
isResizing,
|
|
255
|
-
isCollapsed,
|
|
256
163
|
localWidth,
|
|
257
|
-
isShowingToolbar,
|
|
258
164
|
sidebarStyle,
|
|
259
165
|
rootStyles,
|
|
260
|
-
sidebarStyles,
|
|
261
|
-
toolbarStyles,
|
|
262
166
|
resizeStyles,
|
|
263
|
-
collapsibleButtonStyles,
|
|
264
167
|
mainStyles,
|
|
265
168
|
headerStyles,
|
|
266
169
|
contentStyles,
|
|
267
170
|
footerStyles,
|
|
268
|
-
open,
|
|
269
|
-
close,
|
|
270
171
|
};
|
|
271
172
|
},
|
|
272
173
|
});
|