@onereach/ui-components 2.70.2-beta.2198.0 → 2.70.2-beta.2199.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-0141a358.js → OrCardCollection-1bb83cfb.js} +1 -1
- package/dist/bundled/v2/{OrCheckbox-dbef9f9a.js → OrCheckbox-251ecafc.js} +32 -17
- package/dist/bundled/v2/{OrConfirm-23c3ce56.js → OrConfirm-4cae7867.js} +1 -1
- package/dist/bundled/v2/{OrInlineInput-87589946.js → OrInlineInput-2133e469.js} +38 -22
- package/dist/bundled/v2/{OrInlineTextarea-21b0e6fc.js → OrInlineTextarea-d61ca596.js} +34 -18
- package/dist/bundled/v2/{OrInput-82ccfe00.js → OrInput-770f1bed.js} +38 -30
- package/dist/bundled/v2/{OrPagination-379c10b8.js → OrPagination-468d0964.js} +1 -1
- package/dist/bundled/v2/{OrRadio-cd39b20b.js → OrRadio-ae89bc9b.js} +30 -15
- package/dist/bundled/v2/{OrSearch-53470b0e.js → OrSearch-2e5f9e24.js} +1 -1
- package/dist/bundled/v2/{OrSelect-c49e1bcf.js → OrSelect-039c0711.js} +2 -2
- package/dist/bundled/v2/OrSidebar-c95ef614.js +230 -0
- package/dist/bundled/v2/{OrSwitch-237a2081.js → OrSwitch-20640a05.js} +30 -15
- package/dist/bundled/v2/{OrTabs-42f7c52c.js → OrTabs-85aefcba.js} +1 -1
- package/dist/bundled/v2/{OrTextarea-5593fbe9.js → OrTextarea-0ff8063b.js} +39 -20
- package/dist/bundled/v2/components/index.js +16 -14
- package/dist/bundled/v2/components/or-card-collection-v3/index.js +5 -3
- package/dist/bundled/v2/components/or-checkbox-v3/OrCheckbox.vue.d.ts +18 -2
- package/dist/bundled/v2/components/or-checkbox-v3/index.js +2 -1
- package/dist/bundled/v2/components/or-confirm-v3/index.js +4 -2
- package/dist/bundled/v2/components/or-inline-input-v3/OrInlineInput.vue.d.ts +36 -6
- package/dist/bundled/v2/components/or-inline-input-v3/index.js +3 -1
- package/dist/bundled/v2/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +36 -6
- package/dist/bundled/v2/components/or-inline-textarea-v3/index.js +3 -1
- package/dist/bundled/v2/components/or-input-v3/OrInput.vue.d.ts +43 -8
- package/dist/bundled/v2/components/or-input-v3/index.js +3 -1
- package/dist/bundled/v2/components/or-pagination-v3/index.js +1 -1
- package/dist/bundled/v2/components/or-radio-v3/OrRadio.vue.d.ts +18 -2
- package/dist/bundled/v2/components/or-radio-v3/index.js +2 -1
- package/dist/bundled/v2/components/or-search-v3/index.js +4 -2
- package/dist/bundled/v2/components/or-select-v3/index.js +5 -3
- package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
- package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
- package/dist/bundled/v2/components/or-sidebar-v3/index.js +1 -13
- package/dist/bundled/v2/components/or-sidebar-v3/styles.d.ts +1 -7
- package/dist/bundled/v2/components/or-switch-v3/OrSwitch.vue.d.ts +18 -2
- package/dist/bundled/v2/components/or-switch-v3/index.js +2 -1
- package/dist/bundled/v2/components/or-tabs-v3/index.js +1 -1
- package/dist/bundled/v2/components/or-textarea-v3/OrTextarea.vue.d.ts +45 -6
- package/dist/bundled/v2/components/or-textarea-v3/index.js +3 -1
- package/dist/bundled/v2/hooks/index.d.ts +3 -0
- package/dist/bundled/v2/hooks/index.js +2 -0
- package/dist/bundled/v2/hooks/useControlAttributes.d.ts +8 -0
- package/dist/bundled/v2/hooks/useIdAttribute.d.ts +2 -0
- package/dist/bundled/v2/hooks/useValidationAttributes.d.ts +12 -0
- package/dist/bundled/v2/index.js +17 -15
- package/dist/bundled/v2/useIdAttribute-cf61643f.js +22 -0
- package/dist/bundled/v2/useValidationAttributes-6df7bcf9.js +17 -0
- package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-2d78a51a.js → OrCardCollection.vue_vue_type_script_lang-a0f29a55.js} +1 -1
- package/dist/bundled/v3/{OrCheckbox.vue_vue_type_script_lang-8b36e06c.js → OrCheckbox.vue_vue_type_script_lang-2024ec32.js} +22 -7
- package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-05b21989.js → OrConfirm.vue_vue_type_script_lang-7d9d3810.js} +2 -2
- package/dist/bundled/v3/{OrInlineInput.vue_vue_type_script_lang-67218502.js → OrInlineInput.vue_vue_type_script_lang-40f0073f.js} +27 -11
- package/dist/bundled/v3/{OrInlineTextarea.vue_vue_type_script_lang-a1831ab8.js → OrInlineTextarea.vue_vue_type_script_lang-2817edd5.js} +27 -11
- package/dist/bundled/v3/{OrInput-a4f220ed.js → OrInput-e325a104.js} +12 -12
- package/dist/bundled/v3/{OrInput.vue_vue_type_script_lang-607d79d4.js → OrInput.vue_vue_type_script_lang-fd850b82.js} +26 -15
- package/dist/bundled/v3/{OrPagination.vue_vue_type_script_lang-c96d7cd7.js → OrPagination.vue_vue_type_script_lang-0d9daaa7.js} +1 -1
- package/dist/bundled/v3/{OrRadio.vue_vue_type_script_lang-2e666a56.js → OrRadio.vue_vue_type_script_lang-29e8b856.js} +22 -7
- package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-06f318ca.js → OrSearch.vue_vue_type_script_lang-480f4b1c.js} +2 -2
- package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-58e5a52b.js → OrSelect.vue_vue_type_script_lang-7aa8956a.js} +17 -15
- package/dist/bundled/v3/OrSidebar.vue_vue_type_script_lang-ce0b152c.js +181 -0
- package/dist/bundled/v3/{OrSwitch.vue_vue_type_script_lang-04829f64.js → OrSwitch.vue_vue_type_script_lang-02b4913a.js} +22 -7
- package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-61b79a5a.js → OrTabs.vue_vue_type_script_lang-01188224.js} +1 -1
- package/dist/bundled/v3/{OrTextarea.vue_vue_type_script_lang-8e3531cd.js → OrTextarea.vue_vue_type_script_lang-2fdac7b2.js} +31 -12
- package/dist/bundled/v3/components/index.js +17 -15
- package/dist/bundled/v3/components/or-card-collection-v3/index.js +6 -4
- package/dist/bundled/v3/components/or-checkbox-v3/OrCheckbox.vue.d.ts +18 -2
- package/dist/bundled/v3/components/or-checkbox-v3/index.js +2 -1
- package/dist/bundled/v3/components/or-confirm-v3/index.js +5 -3
- package/dist/bundled/v3/components/or-inline-input-v3/OrInlineInput.vue.d.ts +36 -6
- package/dist/bundled/v3/components/or-inline-input-v3/index.js +3 -1
- package/dist/bundled/v3/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +36 -6
- package/dist/bundled/v3/components/or-inline-textarea-v3/index.js +3 -1
- package/dist/bundled/v3/components/or-input-v3/OrInput.vue.d.ts +43 -8
- package/dist/bundled/v3/components/or-input-v3/index.js +3 -1
- package/dist/bundled/v3/components/or-pagination-v3/index.js +1 -1
- package/dist/bundled/v3/components/or-radio-v3/OrRadio.vue.d.ts +18 -2
- package/dist/bundled/v3/components/or-radio-v3/index.js +2 -1
- package/dist/bundled/v3/components/or-search-v3/index.js +5 -3
- package/dist/bundled/v3/components/or-select-v3/index.js +6 -4
- 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 -7
- package/dist/bundled/v3/components/or-switch-v3/OrSwitch.vue.d.ts +18 -2
- package/dist/bundled/v3/components/or-switch-v3/index.js +2 -1
- package/dist/bundled/v3/components/or-tabs-v3/index.js +1 -1
- package/dist/bundled/v3/components/or-textarea-v3/OrTextarea.vue.d.ts +45 -6
- package/dist/bundled/v3/components/or-textarea-v3/index.js +3 -1
- package/dist/bundled/v3/hooks/index.d.ts +3 -0
- package/dist/bundled/v3/hooks/index.js +2 -0
- package/dist/bundled/v3/hooks/useControlAttributes.d.ts +8 -0
- package/dist/bundled/v3/hooks/useIdAttribute.d.ts +2 -0
- package/dist/bundled/v3/hooks/useValidationAttributes.d.ts +12 -0
- package/dist/bundled/v3/index.js +85 -93
- package/dist/bundled/v3/useIdAttribute-b2e42f31.js +21 -0
- package/dist/bundled/v3/useValidationAttributes-5428d8fa.js +16 -0
- package/dist/esm/v2/{OrCardCollection-3c38fc85.js → OrCardCollection-784318ac.js} +1 -1
- package/dist/esm/v2/{OrCheckbox-567e387c.js → OrCheckbox-7317fe1a.js} +32 -17
- package/dist/esm/v2/{OrConfirm-e2ab9b4c.js → OrConfirm-3d064f6c.js} +1 -1
- package/dist/esm/v2/{OrInlineInput-10205811.js → OrInlineInput-7c4f1f92.js} +38 -22
- package/dist/esm/v2/{OrInlineTextarea-7658611e.js → OrInlineTextarea-3381e2a9.js} +34 -18
- package/dist/esm/v2/{OrInput-ada3a970.js → OrInput-e10cc643.js} +38 -30
- package/dist/esm/v2/{OrPagination-c0dbec6a.js → OrPagination-291bd1b9.js} +1 -1
- package/dist/esm/v2/{OrRadio-848ce55d.js → OrRadio-b0a560d2.js} +30 -15
- package/dist/esm/v2/{OrSearch-0f08f2f5.js → OrSearch-1490c00b.js} +1 -1
- package/dist/esm/v2/{OrSelect-1d705445.js → OrSelect-1fbeed4f.js} +2 -2
- package/dist/esm/v2/OrSidebar-fabc7bc9.js +228 -0
- package/dist/esm/v2/{OrSwitch-13b6a7ee.js → OrSwitch-133052ca.js} +30 -15
- package/dist/esm/v2/{OrTabs-71bd3fd2.js → OrTabs-e5b81f4b.js} +1 -1
- package/dist/esm/v2/{OrTextarea-6712a150.js → OrTextarea-a7c846da.js} +39 -20
- package/dist/esm/v2/components/index.js +16 -14
- package/dist/esm/v2/components/or-card-collection-v3/index.js +5 -3
- package/dist/esm/v2/components/or-checkbox-v3/OrCheckbox.vue.d.ts +18 -2
- package/dist/esm/v2/components/or-checkbox-v3/index.js +2 -1
- package/dist/esm/v2/components/or-confirm-v3/index.js +4 -2
- package/dist/esm/v2/components/or-inline-input-v3/OrInlineInput.vue.d.ts +36 -6
- package/dist/esm/v2/components/or-inline-input-v3/index.js +3 -1
- package/dist/esm/v2/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +36 -6
- package/dist/esm/v2/components/or-inline-textarea-v3/index.js +3 -1
- package/dist/esm/v2/components/or-input-v3/OrInput.vue.d.ts +43 -8
- package/dist/esm/v2/components/or-input-v3/index.js +3 -1
- package/dist/esm/v2/components/or-pagination-v3/index.js +1 -1
- package/dist/esm/v2/components/or-radio-v3/OrRadio.vue.d.ts +18 -2
- package/dist/esm/v2/components/or-radio-v3/index.js +2 -1
- package/dist/esm/v2/components/or-search-v3/index.js +4 -2
- package/dist/esm/v2/components/or-select-v3/index.js +5 -3
- 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 -7
- package/dist/esm/v2/components/or-switch-v3/OrSwitch.vue.d.ts +18 -2
- package/dist/esm/v2/components/or-switch-v3/index.js +2 -1
- package/dist/esm/v2/components/or-tabs-v3/index.js +1 -1
- package/dist/esm/v2/components/or-textarea-v3/OrTextarea.vue.d.ts +45 -6
- package/dist/esm/v2/components/or-textarea-v3/index.js +3 -1
- package/dist/esm/v2/hooks/index.d.ts +3 -0
- package/dist/esm/v2/hooks/index.js +2 -0
- package/dist/esm/v2/hooks/useControlAttributes.d.ts +8 -0
- package/dist/esm/v2/hooks/useIdAttribute.d.ts +2 -0
- package/dist/esm/v2/hooks/useValidationAttributes.d.ts +12 -0
- package/dist/esm/v2/index.js +16 -14
- package/dist/esm/v2/useIdAttribute-859439f0.js +21 -0
- package/dist/esm/v2/useValidationAttributes-d1abbe34.js +16 -0
- package/dist/esm/v3/{OrCardCollection-dbb3e839.js → OrCardCollection-110b3a0b.js} +1 -1
- package/dist/esm/v3/{OrCheckbox-3e139eac.js → OrCheckbox-7144da06.js} +36 -19
- package/dist/esm/v3/{OrConfirm-1bcd39b1.js → OrConfirm-1a38ed1b.js} +1 -1
- package/dist/esm/v3/{OrInlineInput-507fc99c.js → OrInlineInput-a6b19dbe.js} +37 -20
- package/dist/esm/v3/{OrInlineTextarea-53a9e027.js → OrInlineTextarea-9eb60363.js} +37 -20
- package/dist/esm/v3/{OrInput-9c0426b9.js → OrInput-e07ec00c.js} +37 -26
- package/dist/esm/v3/{OrPagination-a703307d.js → OrPagination-5e01a0a5.js} +1 -1
- package/dist/esm/v3/{OrRadio-54b6d0de.js → OrRadio-39d1905d.js} +34 -17
- package/dist/esm/v3/{OrSearch-9885d178.js → OrSearch-a60f67f0.js} +1 -1
- package/dist/esm/v3/{OrSelect-dfa4885f.js → OrSelect-2c70e384.js} +2 -2
- package/dist/esm/v3/OrSidebar-a62972f5.js +206 -0
- package/dist/esm/v3/{OrSwitch-cca30aa0.js → OrSwitch-3e9a699d.js} +34 -18
- package/dist/esm/v3/{OrTabs-d0ee6cef.js → OrTabs-91618aab.js} +1 -1
- package/dist/esm/v3/{OrTextarea-bb9ef3f2.js → OrTextarea-fd6b9f31.js} +42 -22
- package/dist/esm/v3/components/index.js +16 -14
- package/dist/esm/v3/components/or-card-collection-v3/index.js +5 -3
- package/dist/esm/v3/components/or-checkbox-v3/OrCheckbox.vue.d.ts +18 -2
- package/dist/esm/v3/components/or-checkbox-v3/index.js +2 -1
- package/dist/esm/v3/components/or-confirm-v3/index.js +4 -2
- package/dist/esm/v3/components/or-inline-input-v3/OrInlineInput.vue.d.ts +36 -6
- package/dist/esm/v3/components/or-inline-input-v3/index.js +3 -1
- package/dist/esm/v3/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +36 -6
- package/dist/esm/v3/components/or-inline-textarea-v3/index.js +3 -1
- package/dist/esm/v3/components/or-input-v3/OrInput.vue.d.ts +43 -8
- package/dist/esm/v3/components/or-input-v3/index.js +3 -1
- package/dist/esm/v3/components/or-pagination-v3/index.js +1 -1
- package/dist/esm/v3/components/or-radio-v3/OrRadio.vue.d.ts +18 -2
- package/dist/esm/v3/components/or-radio-v3/index.js +2 -1
- package/dist/esm/v3/components/or-search-v3/index.js +4 -2
- package/dist/esm/v3/components/or-select-v3/index.js +5 -3
- 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 -7
- package/dist/esm/v3/components/or-switch-v3/OrSwitch.vue.d.ts +18 -2
- package/dist/esm/v3/components/or-switch-v3/index.js +2 -1
- package/dist/esm/v3/components/or-tabs-v3/index.js +1 -1
- package/dist/esm/v3/components/or-textarea-v3/OrTextarea.vue.d.ts +45 -6
- package/dist/esm/v3/components/or-textarea-v3/index.js +3 -1
- package/dist/esm/v3/hooks/index.d.ts +3 -0
- package/dist/esm/v3/hooks/index.js +2 -0
- package/dist/esm/v3/hooks/useControlAttributes.d.ts +8 -0
- package/dist/esm/v3/hooks/useIdAttribute.d.ts +2 -0
- package/dist/esm/v3/hooks/useValidationAttributes.d.ts +12 -0
- package/dist/esm/v3/index.js +16 -14
- package/dist/esm/v3/useIdAttribute-859439f0.js +21 -0
- package/dist/esm/v3/useValidationAttributes-d1abbe34.js +16 -0
- package/package.json +1 -1
- package/src/components/or-checkbox-v3/OrCheckbox.vue +28 -10
- package/src/components/or-inline-input-v3/OrInlineInput.vue +32 -13
- package/src/components/or-inline-textarea-v3/OrInlineTextarea.vue +32 -13
- package/src/components/or-input-v3/OrInput.stories3.ts +4 -4
- package/src/components/or-input-v3/OrInput.vue +31 -19
- package/src/components/or-pagination-v3/OrPagination.vue +1 -1
- package/src/components/or-radio-v3/OrRadio.vue +27 -9
- package/src/components/or-sidebar-v3/OrSidebar.docs.mdx +0 -6
- package/src/components/or-sidebar-v3/OrSidebar.stories3.ts +6 -219
- package/src/components/or-sidebar-v3/OrSidebar.vue +22 -121
- package/src/components/or-sidebar-v3/styles.ts +9 -153
- package/src/components/or-switch-v3/OrSwitch.vue +27 -9
- package/src/components/or-tabs-v3/OrTabs.vue +1 -1
- package/src/components/or-textarea-v3/OrTextarea.stories3.ts +4 -4
- package/src/components/or-textarea-v3/OrTextarea.vue +36 -14
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useControlAttributes.ts +19 -0
- package/src/hooks/useIdAttribute.ts +9 -0
- package/src/hooks/useValidationAttributes.ts +25 -0
- package/dist/bundled/v2/OrSidebar-2a7d62a8.js +0 -455
- 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 -59
- package/dist/bundled/v3/OrSidebar.vue_vue_type_script_lang-b4fa1550.js +0 -347
- 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 -59
- package/dist/esm/v2/OrSidebar-1e02702f.js +0 -452
- 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 -59
- package/dist/esm/v3/OrSidebar-749bbcba.js +0 -387
- 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 -59
- package/src/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.ts +0 -48
- package/src/components/or-sidebar-v3/OrSidebarCollapseButton.vue +0 -64
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
ref="root"
|
|
4
|
+
v-bind="$attrs"
|
|
4
5
|
:class="rootStyles"
|
|
5
6
|
>
|
|
6
7
|
<input
|
|
7
|
-
|
|
8
|
-
:id="controlId"
|
|
8
|
+
ref="control"
|
|
9
9
|
v-model="proxyModelValue"
|
|
10
|
+
v-bind="controlAttributes"
|
|
10
11
|
:class="controlStyles"
|
|
11
12
|
type="radio"
|
|
12
13
|
:value="inputValue"
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
|
|
19
20
|
<template v-if="$slots.default || label">
|
|
20
21
|
<OrLabel
|
|
21
|
-
:control-id="
|
|
22
|
+
:control-id="controlAttributes.id"
|
|
22
23
|
:variant="labelVariant"
|
|
23
24
|
:required="required"
|
|
24
25
|
:disabled="disabled"
|
|
@@ -34,8 +35,8 @@
|
|
|
34
35
|
</template>
|
|
35
36
|
|
|
36
37
|
<script lang="ts">
|
|
37
|
-
import { computed, defineComponent,
|
|
38
|
-
import { useClassAttribute } from '../../hooks';
|
|
38
|
+
import { computed, defineComponent, PropType, reactive, ref } from 'vue-demi';
|
|
39
|
+
import { useClassAttribute, useControlAttributes, useIdAttribute } from '../../hooks';
|
|
39
40
|
import { LabelVariant, OrLabelV3 as OrLabel } from '../or-label-v3';
|
|
40
41
|
import { RadioControl, RadioControlHandle, RadioRoot } from './styles';
|
|
41
42
|
|
|
@@ -95,13 +96,15 @@ export default defineComponent({
|
|
|
95
96
|
|
|
96
97
|
expose: [
|
|
97
98
|
'root',
|
|
99
|
+
|
|
100
|
+
'focus',
|
|
101
|
+
'blur',
|
|
98
102
|
],
|
|
99
103
|
|
|
100
104
|
setup(props, context) {
|
|
101
|
-
const currentInstance = getCurrentInstance()!;
|
|
102
|
-
|
|
103
105
|
// Refs
|
|
104
106
|
const root = ref<HTMLElement>();
|
|
107
|
+
const control = ref<HTMLInputElement>();
|
|
105
108
|
|
|
106
109
|
// Styles
|
|
107
110
|
const classAttribute = useClassAttribute();
|
|
@@ -118,7 +121,10 @@ export default defineComponent({
|
|
|
118
121
|
]);
|
|
119
122
|
|
|
120
123
|
// State
|
|
121
|
-
const
|
|
124
|
+
const controlAttributes = reactive({
|
|
125
|
+
id: useIdAttribute(),
|
|
126
|
+
...useControlAttributes(),
|
|
127
|
+
});
|
|
122
128
|
|
|
123
129
|
const proxyModelValue = computed({
|
|
124
130
|
get: () => {
|
|
@@ -131,12 +137,24 @@ export default defineComponent({
|
|
|
131
137
|
},
|
|
132
138
|
});
|
|
133
139
|
|
|
140
|
+
// Methods
|
|
141
|
+
function focus(): void {
|
|
142
|
+
control.value?.focus();
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function blur(): void {
|
|
146
|
+
control.value?.blur();
|
|
147
|
+
}
|
|
148
|
+
|
|
134
149
|
return {
|
|
135
150
|
root,
|
|
151
|
+
control,
|
|
136
152
|
rootStyles,
|
|
137
153
|
controlStyles,
|
|
138
|
-
|
|
154
|
+
controlAttributes,
|
|
139
155
|
proxyModelValue,
|
|
156
|
+
focus,
|
|
157
|
+
blur,
|
|
140
158
|
};
|
|
141
159
|
},
|
|
142
160
|
});
|
|
@@ -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,14 +52,6 @@ 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: {
|
|
@@ -87,7 +67,6 @@ const DefaultTemplate: StoryFn<typeof OrSidebar> = (args) => ({
|
|
|
87
67
|
components: {
|
|
88
68
|
OrSidebar,
|
|
89
69
|
OrButton,
|
|
90
|
-
OrIconButton,
|
|
91
70
|
},
|
|
92
71
|
|
|
93
72
|
setup() {
|
|
@@ -99,9 +78,9 @@ const DefaultTemplate: StoryFn<typeof OrSidebar> = (args) => ({
|
|
|
99
78
|
},
|
|
100
79
|
|
|
101
80
|
template: `
|
|
102
|
-
<div style="display: flex; flex-direction: row; border: 1px solid gray; max-height:
|
|
81
|
+
<div style="display: flex; flex-direction: row; border: 1px solid gray; max-height: 500px">
|
|
103
82
|
<div style="flex-grow: 1; overflow: auto">
|
|
104
|
-
${Faker.lorem.paragraphs(
|
|
83
|
+
${Faker.lorem.paragraphs(3)}
|
|
105
84
|
</div>
|
|
106
85
|
<OrSidebar v-bind="args" @change:width="onChangeWidth">
|
|
107
86
|
<template v-if="${!!args.header}" v-slot:header>
|
|
@@ -113,9 +92,6 @@ const DefaultTemplate: StoryFn<typeof OrSidebar> = (args) => ({
|
|
|
113
92
|
<template v-if="${!!args.footer}" v-slot:footer>
|
|
114
93
|
${args.footer}
|
|
115
94
|
</template>
|
|
116
|
-
<template v-if="${!!args.toolbar}" v-slot:toolbar>
|
|
117
|
-
${args.toolbar}
|
|
118
|
-
</template>
|
|
119
95
|
</OrSidebar>
|
|
120
96
|
</div>
|
|
121
97
|
`,
|
|
@@ -125,7 +101,6 @@ const LeftTemplate: StoryFn<typeof OrSidebar> = (args) => ({
|
|
|
125
101
|
components: {
|
|
126
102
|
OrSidebar,
|
|
127
103
|
OrButton,
|
|
128
|
-
OrIconButton,
|
|
129
104
|
},
|
|
130
105
|
|
|
131
106
|
setup() {
|
|
@@ -137,7 +112,7 @@ const LeftTemplate: StoryFn<typeof OrSidebar> = (args) => ({
|
|
|
137
112
|
},
|
|
138
113
|
|
|
139
114
|
template: `
|
|
140
|
-
<div style="display: flex; flex-direction: row; border: 1px solid gray; max-height:
|
|
115
|
+
<div style="display: flex; flex-direction: row; border: 1px solid gray; max-height: 500px">
|
|
141
116
|
<OrSidebar v-bind="args" @change:width="onChangeWidth">
|
|
142
117
|
<template v-if="${!!args.header}" v-slot:header>
|
|
143
118
|
${args.header}
|
|
@@ -148,137 +123,14 @@ const LeftTemplate: StoryFn<typeof OrSidebar> = (args) => ({
|
|
|
148
123
|
<template v-if="${!!args.footer}" v-slot:footer>
|
|
149
124
|
${args.footer}
|
|
150
125
|
</template>
|
|
151
|
-
<template v-if="${!!args.toolbar}" v-slot:toolbar>
|
|
152
|
-
${args.toolbar}
|
|
153
|
-
</template>
|
|
154
126
|
</OrSidebar>
|
|
155
127
|
<div style="flex-grow: 1; overflow: auto">
|
|
156
|
-
${Faker.lorem.paragraphs(
|
|
128
|
+
${Faker.lorem.paragraphs(3)}
|
|
157
129
|
</div>
|
|
158
130
|
</div>
|
|
159
131
|
`,
|
|
160
132
|
});
|
|
161
133
|
|
|
162
|
-
const TabsTemplate: StoryFn<typeof OrSidebar> = (args) => ({
|
|
163
|
-
components: {
|
|
164
|
-
OrSidebar,
|
|
165
|
-
OrButton,
|
|
166
|
-
OrIconButton,
|
|
167
|
-
OrTabs,
|
|
168
|
-
},
|
|
169
|
-
|
|
170
|
-
setup() {
|
|
171
|
-
// State
|
|
172
|
-
const model = ref<string>();
|
|
173
|
-
|
|
174
|
-
return {
|
|
175
|
-
args,
|
|
176
|
-
model,
|
|
177
|
-
};
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
methods: {
|
|
181
|
-
onChangeWidth: action('change:width'),
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
template: `
|
|
185
|
-
<div style="display: flex; flex-direction: row; border: 1px solid gray; max-height: 750px">
|
|
186
|
-
<div style="flex-grow: 1; overflow: auto">
|
|
187
|
-
${Faker.lorem.paragraphs(10)}
|
|
188
|
-
</div>
|
|
189
|
-
<OrSidebar v-bind="args" @change:width="onChangeWidth">
|
|
190
|
-
<template v-if="${!!args.header}" v-slot:header>
|
|
191
|
-
${args.header}
|
|
192
|
-
</template>
|
|
193
|
-
<template v-if="${!!args.default}" v-slot:default>
|
|
194
|
-
${args.default}
|
|
195
|
-
</template>
|
|
196
|
-
<template v-else v-slot:default>
|
|
197
|
-
<or-tabs
|
|
198
|
-
v-model="model"
|
|
199
|
-
:items="args.items"
|
|
200
|
-
>
|
|
201
|
-
<template v-for="item in args.items" #[item.value]>
|
|
202
|
-
{{ item.label }} Content
|
|
203
|
-
${Faker.lorem.paragraphs(3)}
|
|
204
|
-
</template>
|
|
205
|
-
</or-tabs>
|
|
206
|
-
</template>
|
|
207
|
-
<template v-if="${!!args.footer}" v-slot:footer>
|
|
208
|
-
${args.footer}
|
|
209
|
-
</template>
|
|
210
|
-
<template v-if="${!!args.toolbar}" v-slot:toolbar>
|
|
211
|
-
${args.toolbar}
|
|
212
|
-
</template>
|
|
213
|
-
</OrSidebar>
|
|
214
|
-
</div>
|
|
215
|
-
`,
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
const longToolbar = `
|
|
219
|
-
<or-icon-button
|
|
220
|
-
icon="refresh"
|
|
221
|
-
color="inherit"
|
|
222
|
-
/>
|
|
223
|
-
<hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
|
|
224
|
-
<or-icon-button
|
|
225
|
-
icon="add"
|
|
226
|
-
color="inherit"
|
|
227
|
-
/>
|
|
228
|
-
<or-icon-button
|
|
229
|
-
icon="zoom_out_map"
|
|
230
|
-
color="inherit"
|
|
231
|
-
/>
|
|
232
|
-
<or-icon-button
|
|
233
|
-
icon="remove"
|
|
234
|
-
color="inherit"
|
|
235
|
-
/>
|
|
236
|
-
<hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
|
|
237
|
-
<or-icon-button
|
|
238
|
-
icon="description"
|
|
239
|
-
color="inherit"
|
|
240
|
-
/>
|
|
241
|
-
<or-icon-button
|
|
242
|
-
icon="tab_unselected"
|
|
243
|
-
color="inherit"
|
|
244
|
-
/>
|
|
245
|
-
<hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
|
|
246
|
-
<or-icon-button
|
|
247
|
-
icon="create_new_folder"
|
|
248
|
-
color="inherit"
|
|
249
|
-
/>
|
|
250
|
-
<or-icon-button
|
|
251
|
-
icon="content_paste"
|
|
252
|
-
color="inherit"
|
|
253
|
-
/>
|
|
254
|
-
<or-icon-button
|
|
255
|
-
icon="location_on"
|
|
256
|
-
color="inherit"
|
|
257
|
-
/>
|
|
258
|
-
<or-icon-button
|
|
259
|
-
icon="copy_all"
|
|
260
|
-
color="inherit"
|
|
261
|
-
/>
|
|
262
|
-
<or-icon-button
|
|
263
|
-
icon="call_split"
|
|
264
|
-
color="inherit"
|
|
265
|
-
/>
|
|
266
|
-
<hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
|
|
267
|
-
<or-icon-button
|
|
268
|
-
icon="sell"
|
|
269
|
-
color="inherit"
|
|
270
|
-
/>
|
|
271
|
-
<div class="mt-auto" />
|
|
272
|
-
<or-icon-button
|
|
273
|
-
icon="terminal"
|
|
274
|
-
color="inherit"
|
|
275
|
-
/>
|
|
276
|
-
<or-icon-button
|
|
277
|
-
icon="delete"
|
|
278
|
-
color="inherit"
|
|
279
|
-
/>
|
|
280
|
-
`;
|
|
281
|
-
|
|
282
134
|
export const Default = DefaultTemplate.bind({});
|
|
283
135
|
Default.args = {
|
|
284
136
|
header: 'Header',
|
|
@@ -286,24 +138,11 @@ Default.args = {
|
|
|
286
138
|
footer: 'Footer',
|
|
287
139
|
};
|
|
288
140
|
|
|
289
|
-
export const
|
|
290
|
-
|
|
141
|
+
export const WithMinimumWidth = DefaultTemplate.bind({});
|
|
142
|
+
WithMinimumWidth.args = {
|
|
291
143
|
...Default.args,
|
|
292
144
|
width: 250,
|
|
293
145
|
minimumWidth: 200,
|
|
294
|
-
maximumWidth: 500,
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
export const NotDraggable = DefaultTemplate.bind({});
|
|
298
|
-
NotDraggable.args = {
|
|
299
|
-
...Default.args,
|
|
300
|
-
draggable: false,
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
export const Collapsible = DefaultTemplate.bind({});
|
|
304
|
-
Collapsible.args = {
|
|
305
|
-
...Default.args,
|
|
306
|
-
collapsible: true,
|
|
307
146
|
};
|
|
308
147
|
|
|
309
148
|
export const OnlyContent = DefaultTemplate.bind({});
|
|
@@ -328,60 +167,8 @@ WithFooter.args = {
|
|
|
328
167
|
`,
|
|
329
168
|
};
|
|
330
169
|
|
|
331
|
-
export const WithToolbar = DefaultTemplate.bind({});
|
|
332
|
-
WithToolbar.args = {
|
|
333
|
-
...OnlyContent.args,
|
|
334
|
-
toolbar: longToolbar,
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
export const CollapsibleWithToolbar = DefaultTemplate.bind({});
|
|
338
|
-
CollapsibleWithToolbar.args = {
|
|
339
|
-
...WithToolbar.args,
|
|
340
|
-
collapsible: true,
|
|
341
|
-
};
|
|
342
|
-
|
|
343
|
-
export const WithTabs = TabsTemplate.bind({});
|
|
344
|
-
WithTabs.args = {
|
|
345
|
-
minimumWidth: 352,
|
|
346
|
-
header: 'Headline',
|
|
347
|
-
items: Array.from<string, TabsItem>([
|
|
348
|
-
'Alfa',
|
|
349
|
-
'Bravo',
|
|
350
|
-
'Charlie',
|
|
351
|
-
'Delta',
|
|
352
|
-
'Echo',
|
|
353
|
-
'Foxtrot',
|
|
354
|
-
'Golf',
|
|
355
|
-
'Hotel',
|
|
356
|
-
'India',
|
|
357
|
-
'Juliett',
|
|
358
|
-
], (item) => ({
|
|
359
|
-
value: item.toLowerCase(),
|
|
360
|
-
label: item,
|
|
361
|
-
})),
|
|
362
|
-
footer: `
|
|
363
|
-
<div style="display: flex; flex-direction: row; justify-content: end; gap: 16px">
|
|
364
|
-
<or-button color="danger" variant="outlined">Delete</or-button>
|
|
365
|
-
<or-button variant="outlined" class="ml-auto">Cancel</or-button>
|
|
366
|
-
<or-button>Save</or-button>
|
|
367
|
-
</div>
|
|
368
|
-
`,
|
|
369
|
-
};
|
|
370
|
-
|
|
371
170
|
export const LeftSidebar = LeftTemplate.bind({});
|
|
372
171
|
LeftSidebar.args = {
|
|
373
172
|
...Default.args,
|
|
374
173
|
side: 'left',
|
|
375
174
|
};
|
|
376
|
-
|
|
377
|
-
export const WithLeftToolbar = LeftTemplate.bind({});
|
|
378
|
-
WithLeftToolbar.args = {
|
|
379
|
-
...LeftSidebar.args,
|
|
380
|
-
toolbar: longToolbar,
|
|
381
|
-
};
|
|
382
|
-
|
|
383
|
-
export const CollapsibleWithWithLeftToolbar = LeftTemplate.bind({});
|
|
384
|
-
CollapsibleWithWithLeftToolbar.args = {
|
|
385
|
-
...WithLeftToolbar.args,
|
|
386
|
-
collapsible: true,
|
|
387
|
-
};
|
|
@@ -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
|
});
|