@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,7 +1,8 @@
|
|
|
1
1
|
import './index-fa6eb4ca.js';
|
|
2
2
|
import { O as OrLabel, L as LabelVariant } from './OrLabel-172c4b89.js';
|
|
3
3
|
import { u as useClassAttribute } from './useClassAttribute-9bf33346.js';
|
|
4
|
-
import {
|
|
4
|
+
import { a as useIdAttribute, u as useControlAttributes } from './useIdAttribute-cf61643f.js';
|
|
5
|
+
import { defineComponent, ref, computed, reactive } from '@vue/composition-api/dist/vue-composition-api.mjs';
|
|
5
6
|
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
6
7
|
import { c as createInjector } from './browser-82dea9ed.js';
|
|
7
8
|
|
|
@@ -72,18 +73,20 @@ var script = defineComponent({
|
|
|
72
73
|
}
|
|
73
74
|
},
|
|
74
75
|
emits: ['update:modelValue', 'input', 'focus', 'blur'],
|
|
75
|
-
expose: ['root'],
|
|
76
|
+
expose: ['root', 'focus', 'blur'],
|
|
76
77
|
setup(props, context) {
|
|
77
|
-
var _a;
|
|
78
|
-
const currentInstance = getCurrentInstance();
|
|
79
78
|
// Refs
|
|
80
79
|
const root = ref();
|
|
80
|
+
const control = ref();
|
|
81
81
|
// Styles
|
|
82
82
|
const classAttribute = useClassAttribute();
|
|
83
83
|
const rootStyles = computed(() => ['or-radio', ...RadioRoot, classAttribute.value]);
|
|
84
84
|
const controlStyles = computed(() => [...RadioControl, ...RadioControlHandle]);
|
|
85
85
|
// State
|
|
86
|
-
const
|
|
86
|
+
const controlAttributes = reactive({
|
|
87
|
+
id: useIdAttribute(),
|
|
88
|
+
...useControlAttributes()
|
|
89
|
+
});
|
|
87
90
|
const proxyModelValue = computed({
|
|
88
91
|
get: () => {
|
|
89
92
|
var _a;
|
|
@@ -95,12 +98,24 @@ var script = defineComponent({
|
|
|
95
98
|
context.emit('update:modelValue', value);
|
|
96
99
|
}
|
|
97
100
|
});
|
|
101
|
+
// Methods
|
|
102
|
+
function focus() {
|
|
103
|
+
var _a;
|
|
104
|
+
(_a = control.value) === null || _a === void 0 ? void 0 : _a.focus();
|
|
105
|
+
}
|
|
106
|
+
function blur() {
|
|
107
|
+
var _a;
|
|
108
|
+
(_a = control.value) === null || _a === void 0 ? void 0 : _a.blur();
|
|
109
|
+
}
|
|
98
110
|
return {
|
|
99
111
|
root,
|
|
112
|
+
control,
|
|
100
113
|
rootStyles,
|
|
101
114
|
controlStyles,
|
|
102
|
-
|
|
103
|
-
proxyModelValue
|
|
115
|
+
controlAttributes,
|
|
116
|
+
proxyModelValue,
|
|
117
|
+
focus,
|
|
118
|
+
blur
|
|
104
119
|
};
|
|
105
120
|
}
|
|
106
121
|
});
|
|
@@ -113,19 +128,19 @@ var __vue_render__ = function () {
|
|
|
113
128
|
var _vm = this;
|
|
114
129
|
var _h = _vm.$createElement;
|
|
115
130
|
var _c = _vm._self._c || _h;
|
|
116
|
-
return _c('div', {
|
|
131
|
+
return _c('div', _vm._b({
|
|
117
132
|
ref: "root",
|
|
118
133
|
class: _vm.rootStyles
|
|
119
|
-
}, [_c('input', _vm._b({
|
|
134
|
+
}, 'div', _vm.$attrs, false), [_c('input', _vm._b({
|
|
120
135
|
directives: [{
|
|
121
136
|
name: "model",
|
|
122
137
|
rawName: "v-model",
|
|
123
138
|
value: _vm.proxyModelValue,
|
|
124
139
|
expression: "proxyModelValue"
|
|
125
140
|
}],
|
|
141
|
+
ref: "control",
|
|
126
142
|
class: _vm.controlStyles,
|
|
127
143
|
attrs: {
|
|
128
|
-
"id": _vm.controlId,
|
|
129
144
|
"type": "radio",
|
|
130
145
|
"required": _vm.required,
|
|
131
146
|
"disabled": _vm.disabled
|
|
@@ -145,9 +160,9 @@ var __vue_render__ = function () {
|
|
|
145
160
|
_vm.proxyModelValue = _vm.inputValue;
|
|
146
161
|
}
|
|
147
162
|
}
|
|
148
|
-
}, 'input', _vm
|
|
163
|
+
}, 'input', _vm.controlAttributes, false)), _vm._v(" "), _vm.$slots.default || _vm.label ? [_c('OrLabel', {
|
|
149
164
|
attrs: {
|
|
150
|
-
"control-id": _vm.
|
|
165
|
+
"control-id": _vm.controlAttributes.id,
|
|
151
166
|
"variant": _vm.labelVariant,
|
|
152
167
|
"required": _vm.required,
|
|
153
168
|
"disabled": _vm.disabled
|
|
@@ -168,14 +183,14 @@ var __vue_staticRenderFns__ = [];
|
|
|
168
183
|
/* style */
|
|
169
184
|
const __vue_inject_styles__ = function (inject) {
|
|
170
185
|
if (!inject) return;
|
|
171
|
-
inject("data-v-
|
|
172
|
-
source: "input[data-v-
|
|
186
|
+
inject("data-v-5a34efe0_0", {
|
|
187
|
+
source: "input[data-v-5a34efe0]{appearance:none;line-height:0}",
|
|
173
188
|
map: undefined,
|
|
174
189
|
media: undefined
|
|
175
190
|
});
|
|
176
191
|
};
|
|
177
192
|
/* scoped */
|
|
178
|
-
const __vue_scope_id__ = "data-v-
|
|
193
|
+
const __vue_scope_id__ = "data-v-5a34efe0";
|
|
179
194
|
/* module identifier */
|
|
180
195
|
const __vue_module_identifier__ = undefined;
|
|
181
196
|
/* functional template */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index-fa6eb4ca.js';
|
|
2
2
|
import { debouncedWatch } from '@vueuse/core';
|
|
3
|
-
import { O as OrInput } from './OrInput-
|
|
3
|
+
import { O as OrInput } from './OrInput-770f1bed.js';
|
|
4
4
|
import { u as useClassAttribute } from './useClassAttribute-9bf33346.js';
|
|
5
5
|
import { defineComponent, ref, computed, watch } from '@vue/composition-api/dist/vue-composition-api.mjs';
|
|
6
6
|
import { a as InputBoxSize } from './OrInputBox-79ec54ad.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import './index-fa6eb4ca.js';
|
|
2
|
-
import { O as OrCheckbox } from './OrCheckbox-
|
|
2
|
+
import { O as OrCheckbox } from './OrCheckbox-251ecafc.js';
|
|
3
3
|
import { O as OrError } from './OrError-aad17598.js';
|
|
4
4
|
import { O as OrExpansionPanel } from './OrExpansionPanel-d9a260e2.js';
|
|
5
5
|
import { O as OrHint } from './OrHint-f38a1940.js';
|
|
6
6
|
import { O as OrIcon } from './OrIcon-8625385f.js';
|
|
7
|
-
import { O as OrInput } from './OrInput-
|
|
7
|
+
import { O as OrInput } from './OrInput-770f1bed.js';
|
|
8
8
|
import { O as OrInputBox, a as InputBoxSize } from './OrInputBox-79ec54ad.js';
|
|
9
9
|
import { O as OrLabel } from './OrLabel-172c4b89.js';
|
|
10
10
|
import { O as OrMenuItem } from './OrMenuItem-26420908.js';
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { useDraggable, useElementBounding } from '@vueuse/core';
|
|
2
|
+
import _ from 'lodash';
|
|
3
|
+
import './index-fa6eb4ca.js';
|
|
4
|
+
import { defineComponent, ref, computed, watch } from '@vue/composition-api/dist/vue-composition-api.mjs';
|
|
5
|
+
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
6
|
+
|
|
7
|
+
var OrSidebarPlacement;
|
|
8
|
+
(function (OrSidebarPlacement) {
|
|
9
|
+
OrSidebarPlacement["left"] = "left";
|
|
10
|
+
OrSidebarPlacement["right"] = "right";
|
|
11
|
+
})(OrSidebarPlacement || (OrSidebarPlacement = {}));
|
|
12
|
+
|
|
13
|
+
const SidebarRoot = [
|
|
14
|
+
// Position
|
|
15
|
+
'relative',
|
|
16
|
+
// Layout
|
|
17
|
+
'flex', 'flex-col', 'shrink-0',
|
|
18
|
+
// Box
|
|
19
|
+
'min-h-0', 'p-0'];
|
|
20
|
+
const SidebarRootSides = {
|
|
21
|
+
[OrSidebarPlacement.left]: [
|
|
22
|
+
// Borders
|
|
23
|
+
'border-r-[1px]', 'border-r-solid', 'border-r-secondary dark:border-r-secondary-dark'],
|
|
24
|
+
[OrSidebarPlacement.right]: [
|
|
25
|
+
// Borders
|
|
26
|
+
'border-l-[1px]', 'border-l-solid', 'border-l-secondary dark:border-l-secondary-dark']
|
|
27
|
+
};
|
|
28
|
+
const SidebarResize = [
|
|
29
|
+
// Position
|
|
30
|
+
'absolute', 'inset-y-none', 'z-[1]',
|
|
31
|
+
// Box
|
|
32
|
+
'w-[12px]', 'h-[100%]',
|
|
33
|
+
// Cursor
|
|
34
|
+
'cursor-ew-resize'];
|
|
35
|
+
const SidebarResizeSides = {
|
|
36
|
+
[OrSidebarPlacement.left]: [
|
|
37
|
+
// Position
|
|
38
|
+
'-right-[1px]',
|
|
39
|
+
// Borders
|
|
40
|
+
'hover:border-r-2', 'hover:border-r-primary hover:dark:border-r-primary-dark',
|
|
41
|
+
// Transition
|
|
42
|
+
'transition-[border-right]'],
|
|
43
|
+
[OrSidebarPlacement.right]: [
|
|
44
|
+
// Position
|
|
45
|
+
'-left-[1px]',
|
|
46
|
+
// Borders
|
|
47
|
+
'hover:border-l-2', 'hover:border-l-primary hover:dark:border-l-primary-dark',
|
|
48
|
+
// Transition
|
|
49
|
+
'transition-[border-left]']
|
|
50
|
+
};
|
|
51
|
+
const SidebarResizingSides = {
|
|
52
|
+
[OrSidebarPlacement.left]: [
|
|
53
|
+
// Borders
|
|
54
|
+
'border-r-2', 'border-r-primary dark:border-r-primary-dark'],
|
|
55
|
+
[OrSidebarPlacement.right]: [
|
|
56
|
+
// Borders
|
|
57
|
+
'border-l-2', 'border-l-primary dark:border-l-primary-dark']
|
|
58
|
+
};
|
|
59
|
+
const SidebarMain = [
|
|
60
|
+
// Layout
|
|
61
|
+
'flex', 'flex-col', 'grow',
|
|
62
|
+
// Box
|
|
63
|
+
'min-h-0'];
|
|
64
|
+
const SidebarHeader = [
|
|
65
|
+
// Sizing
|
|
66
|
+
'p-md'];
|
|
67
|
+
const SidebarContent = [
|
|
68
|
+
// Layout
|
|
69
|
+
'grow', 'overflow-auto',
|
|
70
|
+
// Sizing
|
|
71
|
+
'p-md'];
|
|
72
|
+
const SidebarFooter = [
|
|
73
|
+
// Sizing
|
|
74
|
+
'p-md',
|
|
75
|
+
// Borders
|
|
76
|
+
'border-t-[1px]', 'border-t-solid', 'border-t-secondary dark:border-t-secondary-dark'];
|
|
77
|
+
|
|
78
|
+
var script = defineComponent({
|
|
79
|
+
name: 'OrSidebar',
|
|
80
|
+
props: {
|
|
81
|
+
width: {
|
|
82
|
+
type: Number,
|
|
83
|
+
required: false,
|
|
84
|
+
default: 0,
|
|
85
|
+
validator: value => _.isNumber(value) && value >= 0
|
|
86
|
+
},
|
|
87
|
+
minimumWidth: {
|
|
88
|
+
type: Number,
|
|
89
|
+
required: false,
|
|
90
|
+
default: 350,
|
|
91
|
+
validator: value => _.isNumber(value) && value >= 0
|
|
92
|
+
},
|
|
93
|
+
/**
|
|
94
|
+
* User may put the component on the right or the left side of a container.
|
|
95
|
+
* This property mirrors the resizing behavior (drag direction) and styling (horizontal border) of the sidebar.
|
|
96
|
+
*
|
|
97
|
+
* Note: the property doesn't reposition the component in the parent container.
|
|
98
|
+
* @values left, right
|
|
99
|
+
*/
|
|
100
|
+
side: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: OrSidebarPlacement.right,
|
|
103
|
+
validator: value => _.includes(_.values(OrSidebarPlacement), value)
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
emits: ['change:width'],
|
|
107
|
+
setup(props, {
|
|
108
|
+
emit
|
|
109
|
+
}) {
|
|
110
|
+
// Refs
|
|
111
|
+
const root = ref();
|
|
112
|
+
const resizeBar = ref(null);
|
|
113
|
+
const parentContainer = computed(() => {
|
|
114
|
+
var _a;
|
|
115
|
+
return (_a = root.value) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
116
|
+
});
|
|
117
|
+
// State
|
|
118
|
+
const startPositionX = ref(0);
|
|
119
|
+
const isResizing = ref(false);
|
|
120
|
+
const localWidth = ref(props.width >= props.minimumWidth ? props.width : props.minimumWidth);
|
|
121
|
+
// Styles
|
|
122
|
+
const sidebarStyle = computed(() => ({
|
|
123
|
+
width: localWidth.value + 'px'
|
|
124
|
+
}));
|
|
125
|
+
const rootStyles = computed(() => ['or-sidebar', ...SidebarRoot, ...SidebarRootSides[props.side]]);
|
|
126
|
+
const resizeStyles = computed(() => [...SidebarResize, ...SidebarResizeSides[props.side], ...(isResizing.value ? SidebarResizingSides[props.side] : [])]);
|
|
127
|
+
const mainStyles = computed(() => [...SidebarMain]);
|
|
128
|
+
const headerStyles = computed(() => [...SidebarHeader]);
|
|
129
|
+
const contentStyles = computed(() => [...SidebarContent]);
|
|
130
|
+
const footerStyles = computed(() => [...SidebarFooter]);
|
|
131
|
+
// Effects
|
|
132
|
+
useDraggable(resizeBar, {
|
|
133
|
+
preventDefault: true,
|
|
134
|
+
onStart: (position, event) => {
|
|
135
|
+
document.body.style.cursor = 'ew-resize';
|
|
136
|
+
document.body.style.userSelect = 'none';
|
|
137
|
+
startPositionX.value = event.x;
|
|
138
|
+
isResizing.value = true;
|
|
139
|
+
},
|
|
140
|
+
onMove: position => {
|
|
141
|
+
const delta = (position.x - startPositionX.value) * (props.side === OrSidebarPlacement.left ? -1 : 1);
|
|
142
|
+
const newWidth = localWidth.value - delta;
|
|
143
|
+
localWidth.value = newWidth > maximumWidth.value ? maximumWidth.value : newWidth < props.minimumWidth ? props.minimumWidth : newWidth;
|
|
144
|
+
startPositionX.value = position.x;
|
|
145
|
+
},
|
|
146
|
+
onEnd: () => {
|
|
147
|
+
document.body.style.cursor = '';
|
|
148
|
+
document.body.style.userSelect = '';
|
|
149
|
+
isResizing.value = false;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
const {
|
|
153
|
+
width: maximumWidth
|
|
154
|
+
} = useElementBounding(parentContainer);
|
|
155
|
+
watch(() => props.width, newValue => {
|
|
156
|
+
if (newValue !== localWidth.value) {
|
|
157
|
+
localWidth.value = newValue > maximumWidth.value ? maximumWidth.value : newValue < props.minimumWidth ? props.minimumWidth : newValue;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
watch(() => props.minimumWidth, newMinimum => {
|
|
161
|
+
if (newMinimum > localWidth.value) localWidth.value = newMinimum;
|
|
162
|
+
});
|
|
163
|
+
watch(maximumWidth, newMaximum => {
|
|
164
|
+
if (newMaximum < localWidth.value) localWidth.value = newMaximum;
|
|
165
|
+
});
|
|
166
|
+
watch(localWidth, val => emit('change:width', val));
|
|
167
|
+
return {
|
|
168
|
+
root,
|
|
169
|
+
resizeBar,
|
|
170
|
+
isResizing,
|
|
171
|
+
localWidth,
|
|
172
|
+
sidebarStyle,
|
|
173
|
+
rootStyles,
|
|
174
|
+
resizeStyles,
|
|
175
|
+
mainStyles,
|
|
176
|
+
headerStyles,
|
|
177
|
+
contentStyles,
|
|
178
|
+
footerStyles
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
/* script */
|
|
184
|
+
const __vue_script__ = script;
|
|
185
|
+
|
|
186
|
+
/* template */
|
|
187
|
+
var __vue_render__ = function () {
|
|
188
|
+
var _vm = this;
|
|
189
|
+
var _h = _vm.$createElement;
|
|
190
|
+
var _c = _vm._self._c || _h;
|
|
191
|
+
return _c('aside', {
|
|
192
|
+
ref: "root",
|
|
193
|
+
class: _vm.rootStyles,
|
|
194
|
+
style: _vm.sidebarStyle
|
|
195
|
+
}, [_c('div', {
|
|
196
|
+
ref: "resizeBar",
|
|
197
|
+
class: _vm.resizeStyles
|
|
198
|
+
}), _vm._v(" "), _c('div', {
|
|
199
|
+
class: _vm.mainStyles
|
|
200
|
+
}, [_vm.$slots.header ? _c('div', {
|
|
201
|
+
class: _vm.headerStyles
|
|
202
|
+
}, [_vm._t("header")], 2) : _vm._e(), _vm._v(" "), _c('div', {
|
|
203
|
+
class: _vm.contentStyles
|
|
204
|
+
}, [_vm._t("default")], 2)]), _vm._v(" "), _vm.$slots.footer ? _c('div', {
|
|
205
|
+
class: _vm.footerStyles
|
|
206
|
+
}, [_vm._t("footer")], 2) : _vm._e()]);
|
|
207
|
+
};
|
|
208
|
+
var __vue_staticRenderFns__ = [];
|
|
209
|
+
|
|
210
|
+
/* style */
|
|
211
|
+
const __vue_inject_styles__ = undefined;
|
|
212
|
+
/* scoped */
|
|
213
|
+
const __vue_scope_id__ = undefined;
|
|
214
|
+
/* module identifier */
|
|
215
|
+
const __vue_module_identifier__ = undefined;
|
|
216
|
+
/* functional template */
|
|
217
|
+
const __vue_is_functional_template__ = false;
|
|
218
|
+
/* style inject */
|
|
219
|
+
|
|
220
|
+
/* style inject SSR */
|
|
221
|
+
|
|
222
|
+
/* style inject shadow dom */
|
|
223
|
+
|
|
224
|
+
const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
225
|
+
render: __vue_render__,
|
|
226
|
+
staticRenderFns: __vue_staticRenderFns__
|
|
227
|
+
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
228
|
+
var __vue_component__$1 = __vue_component__;
|
|
229
|
+
|
|
230
|
+
export { OrSidebarPlacement as O, __vue_component__$1 as _ };
|
|
@@ -2,7 +2,8 @@ import './index-fa6eb4ca.js';
|
|
|
2
2
|
import { O as OrLabel, L as LabelVariant } from './OrLabel-172c4b89.js';
|
|
3
3
|
import { O as OrLoader } from './OrLoader-6a1f937b.js';
|
|
4
4
|
import { u as useClassAttribute } from './useClassAttribute-9bf33346.js';
|
|
5
|
-
import {
|
|
5
|
+
import { a as useIdAttribute, u as useControlAttributes } from './useIdAttribute-cf61643f.js';
|
|
6
|
+
import { defineComponent, ref, computed, reactive } from '@vue/composition-api/dist/vue-composition-api.mjs';
|
|
6
7
|
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
7
8
|
import { c as createInjector } from './browser-82dea9ed.js';
|
|
8
9
|
|
|
@@ -98,19 +99,21 @@ var script = defineComponent({
|
|
|
98
99
|
}
|
|
99
100
|
},
|
|
100
101
|
emits: ['update:modelValue', 'input', 'focus', 'blur'],
|
|
101
|
-
expose: ['root'],
|
|
102
|
+
expose: ['root', 'focus', 'blur'],
|
|
102
103
|
setup(props, context) {
|
|
103
|
-
var _a;
|
|
104
|
-
const currentInstance = getCurrentInstance();
|
|
105
104
|
// Refs
|
|
106
105
|
const root = ref();
|
|
106
|
+
const control = ref();
|
|
107
107
|
// Styles
|
|
108
108
|
const classAttribute = useClassAttribute();
|
|
109
109
|
const rootStyles = computed(() => ['or-switch', ...SwitchRoot, classAttribute.value]);
|
|
110
110
|
const controlStyles = computed(() => [...SwitchControl, ...SwitchControlHandle]);
|
|
111
111
|
const loaderStyles = computed(() => [...SwitchLoader, ...SwitchLoaderHandle]);
|
|
112
112
|
// State
|
|
113
|
-
const
|
|
113
|
+
const controlAttributes = reactive({
|
|
114
|
+
id: useIdAttribute(),
|
|
115
|
+
...useControlAttributes()
|
|
116
|
+
});
|
|
114
117
|
const proxyModelValue = computed({
|
|
115
118
|
get: () => {
|
|
116
119
|
var _a;
|
|
@@ -122,13 +125,25 @@ var script = defineComponent({
|
|
|
122
125
|
context.emit('update:modelValue', value);
|
|
123
126
|
}
|
|
124
127
|
});
|
|
128
|
+
// Methods
|
|
129
|
+
function focus() {
|
|
130
|
+
var _a;
|
|
131
|
+
(_a = control.value) === null || _a === void 0 ? void 0 : _a.focus();
|
|
132
|
+
}
|
|
133
|
+
function blur() {
|
|
134
|
+
var _a;
|
|
135
|
+
(_a = control.value) === null || _a === void 0 ? void 0 : _a.blur();
|
|
136
|
+
}
|
|
125
137
|
return {
|
|
126
138
|
root,
|
|
139
|
+
control,
|
|
127
140
|
rootStyles,
|
|
128
141
|
controlStyles,
|
|
129
142
|
loaderStyles,
|
|
130
|
-
|
|
131
|
-
proxyModelValue
|
|
143
|
+
controlAttributes,
|
|
144
|
+
proxyModelValue,
|
|
145
|
+
focus,
|
|
146
|
+
blur
|
|
132
147
|
};
|
|
133
148
|
}
|
|
134
149
|
});
|
|
@@ -141,19 +156,19 @@ var __vue_render__ = function () {
|
|
|
141
156
|
var _vm = this;
|
|
142
157
|
var _h = _vm.$createElement;
|
|
143
158
|
var _c = _vm._self._c || _h;
|
|
144
|
-
return _c('div', {
|
|
159
|
+
return _c('div', _vm._b({
|
|
145
160
|
ref: "root",
|
|
146
161
|
class: _vm.rootStyles
|
|
147
|
-
}, [!_vm.loading ? [_c('input', _vm._b({
|
|
162
|
+
}, 'div', _vm.$attrs, false), [!_vm.loading ? [_c('input', _vm._b({
|
|
148
163
|
directives: [{
|
|
149
164
|
name: "model",
|
|
150
165
|
rawName: "v-model",
|
|
151
166
|
value: _vm.proxyModelValue,
|
|
152
167
|
expression: "proxyModelValue"
|
|
153
168
|
}],
|
|
169
|
+
ref: "control",
|
|
154
170
|
class: _vm.controlStyles,
|
|
155
171
|
attrs: {
|
|
156
|
-
"id": _vm.controlId,
|
|
157
172
|
"type": "checkbox",
|
|
158
173
|
"required": _vm.required,
|
|
159
174
|
"disabled": _vm.disabled
|
|
@@ -186,7 +201,7 @@ var __vue_render__ = function () {
|
|
|
186
201
|
}
|
|
187
202
|
}
|
|
188
203
|
}
|
|
189
|
-
}, 'input', _vm
|
|
204
|
+
}, 'input', _vm.controlAttributes, false))] : [_c('div', {
|
|
190
205
|
class: _vm.loaderStyles,
|
|
191
206
|
attrs: {
|
|
192
207
|
"disabled": _vm.disabled ? '' : null
|
|
@@ -199,7 +214,7 @@ var __vue_render__ = function () {
|
|
|
199
214
|
}
|
|
200
215
|
})], 1)], _vm._v(" "), _vm.$slots.default || _vm.label ? [_c('OrLabel', {
|
|
201
216
|
attrs: {
|
|
202
|
-
"control-id": _vm.
|
|
217
|
+
"control-id": _vm.controlAttributes.id,
|
|
203
218
|
"variant": _vm.labelVariant,
|
|
204
219
|
"required": _vm.required,
|
|
205
220
|
"disabled": _vm.disabled
|
|
@@ -220,14 +235,14 @@ var __vue_staticRenderFns__ = [];
|
|
|
220
235
|
/* style */
|
|
221
236
|
const __vue_inject_styles__ = function (inject) {
|
|
222
237
|
if (!inject) return;
|
|
223
|
-
inject("data-v-
|
|
224
|
-
source: "input[data-v-
|
|
238
|
+
inject("data-v-203b3e04_0", {
|
|
239
|
+
source: "input[data-v-203b3e04]{appearance:none;line-height:0}",
|
|
225
240
|
map: undefined,
|
|
226
241
|
media: undefined
|
|
227
242
|
});
|
|
228
243
|
};
|
|
229
244
|
/* scoped */
|
|
230
|
-
const __vue_scope_id__ = "data-v-
|
|
245
|
+
const __vue_scope_id__ = "data-v-203b3e04";
|
|
231
246
|
/* module identifier */
|
|
232
247
|
const __vue_module_identifier__ = undefined;
|
|
233
248
|
/* functional template */
|
|
@@ -4,7 +4,9 @@ import { O as OrHint } from './OrHint-f38a1940.js';
|
|
|
4
4
|
import { O as OrInputBox, a as InputBoxSize } from './OrInputBox-79ec54ad.js';
|
|
5
5
|
import { O as OrLabel } from './OrLabel-172c4b89.js';
|
|
6
6
|
import { u as useClassAttribute } from './useClassAttribute-9bf33346.js';
|
|
7
|
-
import {
|
|
7
|
+
import { a as useIdAttribute, u as useControlAttributes } from './useIdAttribute-cf61643f.js';
|
|
8
|
+
import { u as useValidationAttributes } from './useValidationAttributes-6df7bcf9.js';
|
|
9
|
+
import { defineComponent, ref, computed, reactive } from '@vue/composition-api/dist/vue-composition-api.mjs';
|
|
8
10
|
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
9
11
|
import { c as createInjector } from './browser-82dea9ed.js';
|
|
10
12
|
|
|
@@ -63,24 +65,31 @@ var script = defineComponent({
|
|
|
63
65
|
type: Boolean,
|
|
64
66
|
default: false
|
|
65
67
|
},
|
|
68
|
+
readonly: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: false
|
|
71
|
+
},
|
|
66
72
|
disabled: {
|
|
67
73
|
type: Boolean,
|
|
68
74
|
default: false
|
|
69
75
|
}
|
|
70
76
|
},
|
|
71
77
|
emits: ['update:modelValue', 'input', 'keydown', 'keyup', 'focus', 'blur'],
|
|
72
|
-
expose: ['root'],
|
|
78
|
+
expose: ['root', 'focus', 'blur'],
|
|
73
79
|
setup(props, context) {
|
|
74
|
-
var _a;
|
|
75
|
-
const currentInstance = getCurrentInstance();
|
|
76
80
|
// Refs
|
|
77
81
|
const root = ref();
|
|
82
|
+
const control = ref();
|
|
78
83
|
// Styles
|
|
79
84
|
const classAttribute = useClassAttribute();
|
|
80
85
|
const rootStyles = computed(() => ['or-textarea', ...TextareaRoot, classAttribute.value]);
|
|
81
86
|
const controlStyles = computed(() => [...TextareaControl]);
|
|
82
87
|
// State
|
|
83
|
-
const
|
|
88
|
+
const controlAttributes = reactive({
|
|
89
|
+
id: useIdAttribute(),
|
|
90
|
+
...useControlAttributes(),
|
|
91
|
+
...useValidationAttributes()
|
|
92
|
+
});
|
|
84
93
|
const proxyModelValue = computed({
|
|
85
94
|
get: () => {
|
|
86
95
|
var _a;
|
|
@@ -92,23 +101,33 @@ var script = defineComponent({
|
|
|
92
101
|
context.emit('update:modelValue', value);
|
|
93
102
|
}
|
|
94
103
|
});
|
|
95
|
-
const invalid = computed(() => !!props.error);
|
|
96
|
-
const readonly = computed(() => context.attrs.readonly);
|
|
97
104
|
const currentLength = computed(() => {
|
|
98
105
|
var _a, _b;
|
|
99
106
|
return (_b = (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.toString().length) !== null && _b !== void 0 ? _b : 0;
|
|
100
107
|
});
|
|
101
|
-
const maxLength = computed(() =>
|
|
108
|
+
const maxLength = computed(() => controlAttributes.maxlength);
|
|
109
|
+
const invalid = computed(() => !!props.error);
|
|
110
|
+
// Methods
|
|
111
|
+
function focus() {
|
|
112
|
+
var _a;
|
|
113
|
+
(_a = control.value) === null || _a === void 0 ? void 0 : _a.focus();
|
|
114
|
+
}
|
|
115
|
+
function blur() {
|
|
116
|
+
var _a;
|
|
117
|
+
(_a = control.value) === null || _a === void 0 ? void 0 : _a.blur();
|
|
118
|
+
}
|
|
102
119
|
return {
|
|
103
120
|
root,
|
|
121
|
+
control,
|
|
104
122
|
rootStyles,
|
|
105
123
|
controlStyles,
|
|
106
|
-
|
|
124
|
+
controlAttributes,
|
|
107
125
|
proxyModelValue,
|
|
108
|
-
invalid,
|
|
109
|
-
readonly,
|
|
110
126
|
currentLength,
|
|
111
|
-
maxLength
|
|
127
|
+
maxLength,
|
|
128
|
+
invalid,
|
|
129
|
+
focus,
|
|
130
|
+
blur
|
|
112
131
|
};
|
|
113
132
|
}
|
|
114
133
|
});
|
|
@@ -121,12 +140,12 @@ var __vue_render__ = function () {
|
|
|
121
140
|
var _vm = this;
|
|
122
141
|
var _h = _vm.$createElement;
|
|
123
142
|
var _c = _vm._self._c || _h;
|
|
124
|
-
return _c('div', {
|
|
143
|
+
return _c('div', _vm._b({
|
|
125
144
|
ref: "root",
|
|
126
145
|
class: _vm.rootStyles
|
|
127
|
-
}, [_vm.label ? [_c('OrLabel', {
|
|
146
|
+
}, 'div', _vm.$attrs, false), [_vm.label ? [_c('OrLabel', {
|
|
128
147
|
attrs: {
|
|
129
|
-
"control-id": _vm.
|
|
148
|
+
"control-id": _vm.controlAttributes.id,
|
|
130
149
|
"variant": 'input',
|
|
131
150
|
"required": _vm.required,
|
|
132
151
|
"disabled": _vm.disabled
|
|
@@ -152,9 +171,9 @@ var __vue_render__ = function () {
|
|
|
152
171
|
value: _vm.proxyModelValue,
|
|
153
172
|
expression: "proxyModelValue"
|
|
154
173
|
}],
|
|
174
|
+
ref: "control",
|
|
155
175
|
class: _vm.controlStyles,
|
|
156
176
|
attrs: {
|
|
157
|
-
"id": _vm.controlId,
|
|
158
177
|
"placeholder": _vm.placeholder,
|
|
159
178
|
"required": _vm.required,
|
|
160
179
|
"disabled": _vm.disabled
|
|
@@ -182,7 +201,7 @@ var __vue_render__ = function () {
|
|
|
182
201
|
_vm.proxyModelValue = $event.target.value;
|
|
183
202
|
}
|
|
184
203
|
}
|
|
185
|
-
}, 'textarea', _vm
|
|
204
|
+
}, 'textarea', _vm.controlAttributes, false))]), _vm._v(" "), !_vm.invalid ? [_vm.hint || _vm.maxLength ? [_c('OrHint', {
|
|
186
205
|
attrs: {
|
|
187
206
|
"disabled": _vm.disabled
|
|
188
207
|
},
|
|
@@ -211,14 +230,14 @@ var __vue_staticRenderFns__ = [];
|
|
|
211
230
|
/* style */
|
|
212
231
|
const __vue_inject_styles__ = function (inject) {
|
|
213
232
|
if (!inject) return;
|
|
214
|
-
inject("data-v-
|
|
215
|
-
source: "textarea[data-v-
|
|
233
|
+
inject("data-v-17d8e528_0", {
|
|
234
|
+
source: "textarea[data-v-17d8e528]{min-width:0;background:0 0;outline:0}",
|
|
216
235
|
map: undefined,
|
|
217
236
|
media: undefined
|
|
218
237
|
});
|
|
219
238
|
};
|
|
220
239
|
/* scoped */
|
|
221
|
-
const __vue_scope_id__ = "data-v-
|
|
240
|
+
const __vue_scope_id__ = "data-v-17d8e528";
|
|
222
241
|
/* module identifier */
|
|
223
242
|
const __vue_module_identifier__ = undefined;
|
|
224
243
|
/* functional template */
|