@nextcloud/vue 8.0.1 → 8.2.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/CHANGELOG.md +43 -0
- package/dist/Components/NcActionButton.cjs +16 -8
- package/dist/Components/NcActionButton.cjs.map +1 -1
- package/dist/Components/NcActionButton.mjs +21 -13
- package/dist/Components/NcActionButton.mjs.map +1 -1
- package/dist/Components/NcActionButtonGroup.cjs +22 -11
- package/dist/Components/NcActionButtonGroup.cjs.map +1 -1
- package/dist/Components/NcActionButtonGroup.mjs +19 -7
- package/dist/Components/NcActionButtonGroup.mjs.map +1 -1
- package/dist/Components/NcActionCaption.cjs +17 -11
- package/dist/Components/NcActionCaption.cjs.map +1 -1
- package/dist/Components/NcActionCaption.mjs +14 -8
- package/dist/Components/NcActionCaption.mjs.map +1 -1
- package/dist/Components/NcActionCheckbox.cjs +26 -11
- package/dist/Components/NcActionCheckbox.cjs.map +1 -1
- package/dist/Components/NcActionCheckbox.mjs +26 -11
- package/dist/Components/NcActionCheckbox.mjs.map +1 -1
- package/dist/Components/NcActionInput.cjs +7 -5
- package/dist/Components/NcActionInput.cjs.map +1 -1
- package/dist/Components/NcActionInput.mjs +11 -9
- package/dist/Components/NcActionInput.mjs.map +1 -1
- package/dist/Components/NcActionLink.cjs +14 -6
- package/dist/Components/NcActionLink.cjs.map +1 -1
- package/dist/Components/NcActionLink.mjs +19 -11
- package/dist/Components/NcActionLink.mjs.map +1 -1
- package/dist/Components/NcActionRadio.cjs +29 -14
- package/dist/Components/NcActionRadio.cjs.map +1 -1
- package/dist/Components/NcActionRadio.mjs +26 -11
- package/dist/Components/NcActionRadio.mjs.map +1 -1
- package/dist/Components/NcActionRouter.cjs +14 -8
- package/dist/Components/NcActionRouter.cjs.map +1 -1
- package/dist/Components/NcActionRouter.mjs +17 -11
- package/dist/Components/NcActionRouter.mjs.map +1 -1
- package/dist/Components/NcActionSeparator.cjs +10 -10
- package/dist/Components/NcActionSeparator.cjs.map +1 -1
- package/dist/Components/NcActionSeparator.mjs +11 -11
- package/dist/Components/NcActionSeparator.mjs.map +1 -1
- package/dist/Components/NcActionText.cjs +15 -9
- package/dist/Components/NcActionText.cjs.map +1 -1
- package/dist/Components/NcActionText.mjs +20 -14
- package/dist/Components/NcActionText.mjs.map +1 -1
- package/dist/Components/NcActionTextEditable.cjs +1 -1
- package/dist/Components/NcActionTextEditable.mjs +1 -1
- package/dist/Components/NcActions.cjs +100 -79
- package/dist/Components/NcActions.cjs.map +1 -1
- package/dist/Components/NcActions.mjs +103 -82
- package/dist/Components/NcActions.mjs.map +1 -1
- package/dist/Components/NcAppContent.cjs +9 -5
- package/dist/Components/NcAppContent.cjs.map +1 -1
- package/dist/Components/NcAppContent.mjs +13 -9
- package/dist/Components/NcAppContent.mjs.map +1 -1
- package/dist/Components/NcAppNavigation.cjs +11 -7
- package/dist/Components/NcAppNavigation.cjs.map +1 -1
- package/dist/Components/NcAppNavigation.mjs +9 -5
- package/dist/Components/NcAppNavigation.mjs.map +1 -1
- package/dist/Components/NcAppNavigationItem.cjs +16 -12
- package/dist/Components/NcAppNavigationItem.cjs.map +1 -1
- package/dist/Components/NcAppNavigationItem.mjs +14 -10
- package/dist/Components/NcAppNavigationItem.mjs.map +1 -1
- package/dist/Components/NcAppNavigationNewItem.cjs +1 -1
- package/dist/Components/NcAppNavigationNewItem.mjs +1 -1
- package/dist/Components/NcAppNavigationSettings.cjs +4 -2
- package/dist/Components/NcAppNavigationSettings.cjs.map +1 -1
- package/dist/Components/NcAppNavigationSettings.mjs +6 -4
- package/dist/Components/NcAppNavigationSettings.mjs.map +1 -1
- package/dist/Components/NcAppNavigationToggle.cjs +1 -1
- package/dist/Components/NcAppNavigationToggle.mjs +1 -1
- package/dist/Components/NcAppSettingsDialog.cjs +43 -39
- package/dist/Components/NcAppSettingsDialog.cjs.map +1 -1
- package/dist/Components/NcAppSettingsDialog.mjs +63 -58
- package/dist/Components/NcAppSettingsDialog.mjs.map +1 -1
- package/dist/Components/NcAppSidebar.cjs +3 -3
- package/dist/Components/NcAppSidebar.cjs.map +1 -1
- package/dist/Components/NcAppSidebar.mjs +3 -3
- package/dist/Components/NcAppSidebar.mjs.map +1 -1
- package/dist/Components/NcAvatar.cjs +1 -1
- package/dist/Components/NcAvatar.mjs +1 -1
- package/dist/Components/NcButton.cjs +6 -4
- package/dist/Components/NcButton.cjs.map +1 -1
- package/dist/Components/NcButton.mjs +11 -9
- package/dist/Components/NcButton.mjs.map +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.cjs +3 -3
- package/dist/Components/NcCheckboxRadioSwitch.cjs.map +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.mjs +3 -3
- package/dist/Components/NcCheckboxRadioSwitch.mjs.map +1 -1
- package/dist/Components/NcColorPicker.cjs +48 -31
- package/dist/Components/NcColorPicker.cjs.map +1 -1
- package/dist/Components/NcColorPicker.mjs +56 -38
- package/dist/Components/NcColorPicker.mjs.map +1 -1
- package/dist/Components/NcDashboardWidget.cjs +1 -1
- package/dist/Components/NcDashboardWidget.mjs +2 -2
- package/dist/Components/NcDashboardWidgetItem.cjs +1 -1
- package/dist/Components/NcDashboardWidgetItem.mjs +1 -1
- package/dist/Components/NcDateTime.cjs +17 -14
- package/dist/Components/NcDateTime.cjs.map +1 -1
- package/dist/Components/NcDateTime.mjs +18 -15
- package/dist/Components/NcDateTime.mjs.map +1 -1
- package/dist/Components/NcDateTimePicker.cjs +2 -2
- package/dist/Components/NcDateTimePicker.mjs +4 -4
- package/dist/Components/NcDateTimePickerNative.cjs +1 -1
- package/dist/Components/NcDateTimePickerNative.mjs +1 -1
- package/dist/Components/NcEmojiPicker.cjs +1 -1
- package/dist/Components/NcEmojiPicker.mjs +1 -1
- package/dist/Components/NcHeaderMenu.cjs +11 -9
- package/dist/Components/NcHeaderMenu.cjs.map +1 -1
- package/dist/Components/NcHeaderMenu.mjs +16 -14
- package/dist/Components/NcHeaderMenu.mjs.map +1 -1
- package/dist/Components/NcListItem.cjs +1 -1
- package/dist/Components/NcListItem.mjs +1 -1
- package/dist/Components/NcListItemIcon.cjs +4 -2
- package/dist/Components/NcListItemIcon.cjs.map +1 -1
- package/dist/Components/NcListItemIcon.mjs +9 -7
- package/dist/Components/NcListItemIcon.mjs.map +1 -1
- package/dist/Components/NcModal.cjs +1 -1
- package/dist/Components/NcModal.mjs +3 -3
- package/dist/Components/NcPasswordField.cjs +1 -1
- package/dist/Components/NcPasswordField.mjs +1 -1
- package/dist/Components/NcRelatedResourcesPanel.cjs +1 -1
- package/dist/Components/NcRelatedResourcesPanel.mjs +1 -1
- package/dist/Components/NcRichContenteditable.cjs +5 -5
- package/dist/Components/NcRichContenteditable.cjs.map +1 -1
- package/dist/Components/NcRichContenteditable.mjs +5 -5
- package/dist/Components/NcRichContenteditable.mjs.map +1 -1
- package/dist/Components/NcRichText.cjs +1 -1
- package/dist/Components/NcRichText.mjs +3 -3
- package/dist/Components/NcSelect.cjs +2 -2
- package/dist/Components/NcSelect.cjs.map +1 -1
- package/dist/Components/NcSelect.mjs +3 -3
- package/dist/Components/NcSelect.mjs.map +1 -1
- package/dist/Components/NcSelectTags.cjs +1 -1
- package/dist/Components/NcSelectTags.mjs +1 -1
- package/dist/Components/NcSettingsInputText.cjs +1 -1
- package/dist/Components/NcSettingsInputText.mjs +1 -1
- package/dist/Components/NcSettingsSection.cjs +1 -1
- package/dist/Components/NcSettingsSection.mjs +1 -1
- package/dist/Components/NcSettingsSelectGroup.cjs +1 -1
- package/dist/Components/NcSettingsSelectGroup.mjs +1 -1
- package/dist/Components/NcTextArea.cjs +5 -5
- package/dist/Components/NcTextArea.cjs.map +1 -1
- package/dist/Components/NcTextArea.mjs +4 -4
- package/dist/Components/NcTextArea.mjs.map +1 -1
- package/dist/Components/NcTextField.cjs +25 -17
- package/dist/Components/NcTextField.cjs.map +1 -1
- package/dist/Components/NcTextField.mjs +27 -19
- package/dist/Components/NcTextField.mjs.map +1 -1
- package/dist/Components/NcTimezonePicker.cjs +1 -1
- package/dist/Components/NcTimezonePicker.mjs +1 -1
- package/dist/Components/NcUserBubble.cjs +1 -1
- package/dist/Components/NcUserBubble.mjs +1 -1
- package/dist/Composables/useIsFullscreen.cjs +34 -0
- package/dist/Composables/useIsFullscreen.cjs.map +1 -0
- package/dist/Composables/useIsFullscreen.mjs +34 -0
- package/dist/Composables/useIsFullscreen.mjs.map +1 -0
- package/dist/Composables/useIsMobile.cjs +35 -0
- package/dist/Composables/useIsMobile.cjs.map +1 -0
- package/dist/Composables/useIsMobile.mjs +35 -0
- package/dist/Composables/useIsMobile.mjs.map +1 -0
- package/dist/Functions/usernameToColor.cjs +1 -1
- package/dist/Functions/usernameToColor.mjs +1 -1
- package/dist/Mixins/isFullscreen.cjs +10 -19
- package/dist/Mixins/isFullscreen.cjs.map +1 -1
- package/dist/Mixins/isFullscreen.mjs +10 -19
- package/dist/Mixins/isFullscreen.mjs.map +1 -1
- package/dist/Mixins/isMobile.cjs +10 -62
- package/dist/Mixins/isMobile.cjs.map +1 -1
- package/dist/Mixins/isMobile.mjs +10 -62
- package/dist/Mixins/isMobile.mjs.map +1 -1
- package/dist/assets/{NcSettingsSelectGroup-0d38d76b.css → NcSettingsSelectGroup-6ddb63a6.css} +2 -2
- package/dist/assets/{index-d3702c91.css → index-00012a4c.css} +18 -18
- package/dist/assets/{index-8f52a20f.css → index-018895f7.css} +2 -2
- package/dist/assets/{index-6899d75b.css → index-30ca9574.css} +31 -30
- package/dist/assets/{index-7d211db9.css → index-3d1ccc15.css} +31 -16
- package/dist/assets/{index-441b6552.css → index-418d4e87.css} +2 -2
- package/dist/assets/{index-ebbb7829.css → index-4437e6bf.css} +8 -8
- package/dist/assets/{index-4271da53.css → index-4596132f.css} +17 -17
- package/dist/assets/{index-05760fea.css → index-4ba699a1.css} +12 -12
- package/dist/assets/{index-db5a8b1c.css → index-51c1f2a9.css} +15 -11
- package/dist/assets/{index-24f6c355.css → index-542cf50a.css} +12 -12
- package/dist/assets/{index-dea0aef3.css → index-5c74e333.css} +10 -10
- package/dist/assets/{index-802d2118.css → index-7fac55ed.css} +16 -16
- package/dist/assets/{index-e7c55791.css → index-9020d9ca.css} +67 -67
- package/dist/assets/{index-4ef32afd.css → index-a9d1ad5c.css} +26 -23
- package/dist/assets/{index-55600948.css → index-d1c0876d.css} +11 -11
- package/dist/assets/{index-fbc0b606.css → index-db846386.css} +10 -9
- package/dist/assets/{index-baf8711a.css → index-e0e6bab6.css} +12 -12
- package/dist/assets/{index-0e9b11c7.css → index-e9fce208.css} +16 -16
- package/dist/assets/{index-d812ed9e.css → index-f091e784.css} +43 -43
- package/dist/assets/{index-9176105d.css → index-f8d6daf3.css} +41 -41
- package/dist/assets/{index-750c02cc.css → index-f9bfa317.css} +3 -0
- package/dist/assets/{index-d9ae9479.css → index-ffa6d11c.css} +7 -7
- package/dist/chunks/GenColors-02173e2c.mjs +56 -0
- package/dist/chunks/GenColors-02173e2c.mjs.map +1 -0
- package/dist/chunks/GenColors-4314c256.cjs +55 -0
- package/dist/chunks/GenColors-4314c256.cjs.map +1 -0
- package/dist/chunks/{NcAppNavigationToggle-60664a28.cjs → NcAppNavigationToggle-1301e882.cjs} +1 -1
- package/dist/chunks/{NcAppNavigationToggle-60664a28.cjs.map → NcAppNavigationToggle-1301e882.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationToggle-82764816.mjs → NcAppNavigationToggle-2574bba5.mjs} +1 -1
- package/dist/chunks/{NcAppNavigationToggle-82764816.mjs.map → NcAppNavigationToggle-2574bba5.mjs.map} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-262d455f.cjs → NcInputConfirmCancel-9906b563.cjs} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-262d455f.cjs.map → NcInputConfirmCancel-9906b563.cjs.map} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-906c7816.mjs → NcInputConfirmCancel-a612e6a3.mjs} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-906c7816.mjs.map → NcInputConfirmCancel-a612e6a3.mjs.map} +1 -1
- package/dist/chunks/{NcRichText-ae95c854.cjs → NcRichText-9f77a9c6.cjs} +1 -1
- package/dist/chunks/{NcRichText-ae95c854.cjs.map → NcRichText-9f77a9c6.cjs.map} +1 -1
- package/dist/chunks/{NcRichText-1e8fd02d.mjs → NcRichText-f5cfcd57.mjs} +1 -1
- package/dist/chunks/{NcRichText-1e8fd02d.mjs.map → NcRichText-f5cfcd57.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-ae323579.mjs → NcSettingsSelectGroup-091c0306.mjs} +12 -12
- package/dist/chunks/NcSettingsSelectGroup-091c0306.mjs.map +1 -0
- package/dist/chunks/{NcSettingsSelectGroup-e8f9f9fe.cjs → NcSettingsSelectGroup-0f71fef4.cjs} +12 -12
- package/dist/chunks/NcSettingsSelectGroup-0f71fef4.cjs.map +1 -0
- package/dist/chunks/{ScopeComponent-1ab1ebb9.mjs → ScopeComponent-3ea00dcd.mjs} +1 -1
- package/dist/chunks/{ScopeComponent-1ab1ebb9.mjs.map → ScopeComponent-3ea00dcd.mjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-50287dad.cjs → ScopeComponent-df4b58b1.cjs} +1 -1
- package/dist/chunks/{ScopeComponent-50287dad.cjs.map → ScopeComponent-df4b58b1.cjs.map} +1 -1
- package/dist/chunks/{actionText-a64be267.mjs → actionText-60ff01d1.mjs} +3 -1
- package/dist/chunks/{actionText-54bc24a6.cjs.map → actionText-60ff01d1.mjs.map} +1 -1
- package/dist/chunks/{actionText-54bc24a6.cjs → actionText-9582810f.cjs} +3 -1
- package/dist/chunks/{actionText-a64be267.mjs.map → actionText-9582810f.cjs.map} +1 -1
- package/dist/chunks/{index-fbf943b3.mjs → index-cea13a24.mjs} +6 -4
- package/dist/chunks/{index-fbf943b3.mjs.map → index-cea13a24.mjs.map} +1 -1
- package/dist/chunks/{index-e06b96d3.cjs → index-dc10fd2b.cjs} +7 -5
- package/dist/chunks/{index-e06b96d3.cjs.map → index-dc10fd2b.cjs.map} +1 -1
- package/dist/chunks/{l10n-ec2d3010.cjs → l10n-a12cdbfa.cjs} +1 -1
- package/dist/chunks/{l10n-ec2d3010.cjs.map → l10n-a12cdbfa.cjs.map} +1 -1
- package/dist/chunks/{l10n-9fc9974f.mjs → l10n-c603e589.mjs} +1 -1
- package/dist/chunks/{l10n-9fc9974f.mjs.map → l10n-c603e589.mjs.map} +1 -1
- package/dist/chunks/l10n-e9ffbe5e.cjs +29 -0
- package/dist/chunks/l10n-e9ffbe5e.cjs.map +1 -0
- package/dist/chunks/l10n-ef44019c.mjs +31 -0
- package/dist/chunks/l10n-ef44019c.mjs.map +1 -0
- package/dist/chunks/{referencePickerModal-e033bf2c.cjs → referencePickerModal-aa5d3f47.cjs} +1 -1
- package/dist/chunks/{referencePickerModal-e033bf2c.cjs.map → referencePickerModal-aa5d3f47.cjs.map} +1 -1
- package/dist/chunks/{referencePickerModal-6bc8f6b9.mjs → referencePickerModal-c2f33569.mjs} +1 -1
- package/dist/chunks/{referencePickerModal-6bc8f6b9.mjs.map → referencePickerModal-c2f33569.mjs.map} +1 -1
- package/dist/index.cjs +139 -134
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +96 -89
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/chunks/GenColors-38246c38.mjs +0 -46
- package/dist/chunks/GenColors-38246c38.mjs.map +0 -1
- package/dist/chunks/GenColors-eedcc70a.cjs +0 -45
- package/dist/chunks/GenColors-eedcc70a.cjs.map +0 -1
- package/dist/chunks/NcSettingsSelectGroup-ae323579.mjs.map +0 -1
- package/dist/chunks/NcSettingsSelectGroup-e8f9f9fe.cjs.map +0 -1
- package/dist/chunks/l10n-f491109d.cjs +0 -29
- package/dist/chunks/l10n-f491109d.cjs.map +0 -1
- package/dist/chunks/l10n-f692947e.mjs +0 -31
- package/dist/chunks/l10n-f692947e.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcTextArea.mjs","sources":["../../src/components/NcTextArea/NcTextArea.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2023 Richard Steinmetz <richard@steinmetz.cloud>\n -\n - @author Richard Steinmetz <richard@steinmetz.cloud>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU General Public License as published by\n - the Free Software Foundation, either version 3 of the License, or\n - (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU General Public License for more details.\n -\n - You should have received a copy of the GNU General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\n### Description\n\nThis component is a textarea field.\nIt extends and styles an HTMLTextAreaElement.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcTextArea label=\"Text area\"\n\t\t\tplaceholder=\"Placeholders are possible\"\n\t\t\thelper-text=\"This is a regular helper text.\" >\n\t\t</NcTextArea>\n\t\t<NcTextArea label=\"Success state\"\n\t\t\t:success=\"true\">\n\t\t</NcTextArea>\n\t\t<NcTextArea label=\"Error state\"\n\t\t\tplaceholder=\"Enter something valid\"\n\t\t\thelper-text=\"Helper texts will be styled accordingly.\"\n\t\t\t:error=\"true\">\n\t\t</NcTextArea>\n\t\t<NcTextArea label=\"Disabled\"\n\t\t\t:disabled=\"true\" />\n\t\t<NcTextArea label=\"Disabled + Success\"\n\t\t\t:success=\"true\"\n\t\t\t:disabled=\"true\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">External label</label>\n\t\t\t<NcTextArea id=\"textField\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Text area with external label\" />\n\t\t</div>\n\t\t<NcTextArea label=\"Custom size and no resize\"\n\t\t\tresize=\"none\"\n\t\t\trows=\"5\" />\n\t\t</NcTextArea>\n\t</div>\n</template>\n\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\twidth: 100%;\n\talign-items: center;\n\tgap: 14px;\n\n\t> label {\n\t\tflex-shrink: 0;\n\t}\n}\n</style>\n```\n</docs>\n\n<template>\n\t<div class=\"textarea\" :class=\"{ 'textarea--disabled': disabled }\">\n\t\t<div class=\"textarea__main-wrapper\">\n\t\t\t<textarea v-bind=\"$attrs\"\n\t\t\t\t:id=\"computedId\"\n\t\t\t\tref=\"input\"\n\t\t\t\tclass=\"textarea__input\"\n\t\t\t\t:type=\"type\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:placeholder=\"computedPlaceholder\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\taria-live=\"polite\"\n\t\t\t\t:class=\"[inputClass,\n\t\t\t\t\t{\n\t\t\t\t\t\t'textarea__input--label-outside': labelOutside,\n\t\t\t\t\t\t'textarea__input--success': success,\n\t\t\t\t\t\t'textarea__input--error': error,\n\t\t\t\t\t}]\"\n\t\t\t\t:style=\"{ resize: resize }\"\n\t\t\t\t:value=\"value\"\n\t\t\t\tv-on=\"$listeners\"\n\t\t\t\t@input=\"handleInput\" />\n\t\t\t<!-- Label -->\n\t\t\t<label v-if=\"!labelOutside && isValidLabel\"\n\t\t\t\tclass=\"textarea__label\"\n\t\t\t\t:for=\"computedId\">\n\t\t\t\t{{ label }}\n\t\t\t</label>\n\t\t</div>\n\t\t<p v-if=\"helperText.length > 0\"\n\t\t\t:id=\"`${inputName}-helper-text`\"\n\t\t\tclass=\"textarea__helper-text-message\"\n\t\t\t:class=\"{\n\t\t\t\t'textarea__helper-text-message--error': error,\n\t\t\t\t'textarea__helper-text-message--success': success,\n\t\t\t}\">\n\t\t\t<Check v-if=\"success\" class=\"textarea__helper-text-message__icon\" :size=\"18\" />\n\t\t\t<AlertCircle v-else-if=\"error\" class=\"textarea__helper-text-message__icon\" :size=\"18\" />\n\t\t\t{{ helperText }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport GenRandomId from '../../utils/GenRandomId.js'\n\nimport AlertCircle from 'vue-material-design-icons/AlertCircleOutline.vue'\nimport Check from 'vue-material-design-icons/Check.vue'\n\nexport default {\n\tname: 'NcTextArea',\n\n\tcomponents: {\n\t\tAlertCircle,\n\t\tCheck,\n\t},\n\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t/**\n\t\t * The value of the input field\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * The input label, always provide one for accessibility purposes.\n\t\t * This will also be used as a placeholder unless the placeholder\n\t\t * prop is populated with a different string.\n\t\t */\n\t\tlabel: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/**\n\t\t * Pass in true if you want to use an external label. This is useful\n\t\t * if you need a label that looks different from the one provided by\n\t\t * this component\n\t\t */\n\t\tlabelOutside: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The placeholder of the input. This defaults as the string that's\n\t\t * passed into the label prop. In order to remove the placeholder,\n\t\t * pass in an empty string.\n\t\t */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/**\n\t\t * Toggles the success state of the component. Adds a checkmark icon.\n\t\t * this cannot be used together with canClear.\n\t\t */\n\t\tsuccess: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Toggles the error state of the component. Adds an error icon.\n\t\t * this cannot be used together with canClear.\n\t\t */\n\t\terror: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Additional helper text message\n\t\t *\n\t\t * This will be displayed beneath the input field. In case the field is\n\t\t * also marked as having an error, the text will be displayed in red.\n\t\t */\n\t\thelperText: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Disable the input field\n\t\t */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Class to add to the input field.\n\t\t * Necessary to use NcInputField in the NcActionInput component.\n\t\t */\n\t\tinputClass: {\n\t\t\ttype: [Object, String],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * The resize CSS property sets whether an element is resizable, and if\n\t\t * so, in which directions.\n\t\t */\n\t\tresize: {\n\t\t\ttype: String,\n\t\t\tdefault: 'both',\n\t\t\tvalidator: (value) => ['both', 'vertical', 'horizontal', 'none'].includes(value),\n\t\t},\n\t},\n\n\temits: [\n\t\t'update:value',\n\t],\n\n\tcomputed: {\n\t\tcomputedId() {\n\t\t\treturn this.$attrs.id && this.$attrs.id !== '' ? this.$attrs.id : this.inputName\n\t\t},\n\n\t\tinputName() {\n\t\t\treturn 'input' + GenRandomId()\n\t\t},\n\n\t\thasPlaceholder() {\n\t\t\treturn this.placeholder !== '' && this.placeholder !== undefined\n\t\t},\n\n\t\tcomputedPlaceholder() {\n\t\t\treturn this.hasPlaceholder ? this.placeholder : this.label\n\t\t},\n\n\t\tisValidLabel() {\n\t\t\tconst isValidLabel = this.label || this.labelOutside\n\t\t\tif (!isValidLabel) {\n\t\t\t\tconsole.warn('You need to add a label to the NcInputField component. Either use the prop label or use an external one, as per the example in the documentation.')\n\t\t\t}\n\t\t\treturn isValidLabel\n\t\t},\n\n\t\tariaDescribedby() {\n\t\t\tconst ariaDescribedby = []\n\t\t\tif (this.helperText.length > 0) {\n\t\t\t\tariaDescribedby.push(`${this.inputName}-helper-text`)\n\t\t\t}\n\t\t\tif (this.$attrs['aria-describedby']) {\n\t\t\t\tariaDescribedby.push(this.$attrs['aria-describedby'])\n\t\t\t}\n\t\t\treturn ariaDescribedby.join(' ') || null\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Focus the input element\n\t\t *\n\t\t * @public\n\t\t */\n\t\tfocus() {\n\t\t\tthis.$refs.input.focus()\n\t\t},\n\n\t\t/**\n\t\t * Select all the text in the input\n\t\t *\n\t\t * @public\n\t\t */\n\t\tselect() {\n\t\t\tthis.$refs.input.select()\n\t\t},\n\n\t\thandleInput(event) {\n\t\t\tthis.$emit('update:value', event.target.value)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n\n.textarea {\n\tposition: relative;\n\twidth: 100%;\n\tborder-radius: var(--border-radius-large);\n\tmargin-block-start: 6px; // for the label in active state\n\tresize: vertical;\n\n\t&__main-wrapper {\n\t\tposition: relative;\n\t}\n\n\t&--disabled {\n\t\topacity: 0.7;\n\t\tfilter: saturate(0.7);\n\t}\n\n\t&__input {\n\t\tmargin: 0;\n\t\tpadding-inline: 10px 6px; // align with label 8px margin label + 4px padding label - 2px border input\n\t\twidth: 100%;\n\n\t\tfont-size: var(--default-font-size);\n\t\ttext-overflow: ellipsis;\n\n\t\tbackground-color: var(--color-main-background);\n\t\tcolor: var(--color-main-text);\n\t\tborder: 2px solid var(--color-border-maxcontrast);\n\t\tborder-radius: var(--border-radius-large);\n\n\t\tcursor: pointer;\n\n\t\t&:active:not([disabled]),\n\t\t&:hover:not([disabled]),\n\t\t&:focus:not([disabled]) {\n\t\t\tborder-color: var(--color-primary-element);\n\t\t}\n\n\t\t// Hide placeholder while not focussed -> show label instead (only if internal label is used)\n\t\t&:not(:focus,&--label-outside)::placeholder {\n\t\t\topacity: 0;\n\t\t}\n\n\t\t&:focus {\n\t\t\tcursor: text;\n\t\t}\n\n\t\t&:disabled {\n\t\t\tcursor: default;\n\t\t}\n\n\t\t&:focus-visible {\n\t\t\tbox-shadow: unset !important; // Override server rules\n\t\t}\n\n\t\t&--success {\n\t\t\tborder-color: var(--color-success) !important; //Override hover border color\n\t\t\t&:focus-visible {\n\t\t\t\tbox-shadow: rgb(248, 250, 252) 0px 0px 0px 2px, var(--color-primary-element) 0px 0px 0px 4px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px\n\t\t\t}\n\n\t\t\t// Align label text color with border color (on hover / focus)\n\t\t\t&:focus + .textarea__label,\n\t\t\t&:hover:not(:placeholder-shown) + .textarea__label {\n\t\t\t\tcolor: var(--color-success-text);\n\t\t\t}\n\t\t}\n\n\t\t&--error {\n\t\t\tborder-color: var(--color-error) !important; //Override hover border color\n\t\t\t&:focus-visible {\n\t\t\t\tbox-shadow: rgb(248, 250, 252) 0px 0px 0px 2px, var(--color-primary-element) 0px 0px 0px 4px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px\n\t\t\t}\n\n\t\t\t// Align label text color with border color (on hover / focus)\n\t\t\t&:focus + .textarea__label,\n\t\t\t&:hover:not(:placeholder-shown) + .textarea__label {\n\t\t\t\tcolor: var(--color-error-text);\n\t\t\t}\n\t\t}\n\n\t\t// Align label text color with border color (on hover / focus)\n\t\t&:not(&--success, &--error) {\n\t\t\t&:focus + .textarea__label,\n\t\t\t&:hover:not(:placeholder-shown) + .textarea__label {\n\t\t\t\tcolor: var(--color-primary-element);\n\t\t\t}\n\t\t}\n\t}\n\n\t&__label {\n\t\tposition: absolute;\n\t\tmargin-inline: 12px 0;\n\t\t// fix height and line height to center label\n\t\theight: 17px;\n\t\tmax-width: fit-content;\n\t\tline-height: 1;\n\t\tinset-block-start: 12px;\n\t\tinset-inline: 0;\n\t\t// Fix color so that users do not think the input already has content\n\t\tcolor: var(--color-text-maxcontrast);\n\t\t// only one line labels are allowed\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\t// forward events to input\n\t\tpointer-events: none;\n\t\t// Position transition\n\t\ttransition: height var(--animation-quick), inset-block-start var(--animation-quick), font-size var(--animation-quick), color var(--animation-quick), background-color var(--animation-quick) var(--animation-slow);\n\t}\n\n\t&__input:focus + &__label,\n\t&__input:not(:placeholder-shown) + &__label {\n\t\tinset-block-start: -6px;\n\t\tfont-size: 13px; // minimum allowed font size for accessibility\n\t\tbackground-color: var(--color-main-background);\n\t\theight: 14px;\n\t\tpadding-inline: 4px;\n\t\tmargin-inline-start: 8px;\n\n\t\ttransition: height var(--animation-quick), inset-block-start var(--animation-quick), font-size var(--animation-quick), color var(--animation-quick);\n\t}\n\n\t&__helper-text-message {\n\t\tpadding-block: 4px;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\n\t\t&__icon {\n\t\t\tmargin-inline-end: 8px;\n\t\t}\n\n\t\t&--error {\n\t\t\tcolor: var(--color-error-text);\n\t\t}\n\n\t\t&--success {\n\t\t\tcolor: var(--color-success-text);\n\t\t}\n\t}\n}\n</style>\n"],"names":["_sfc_main","AlertCircle","Check","value","GenRandomId","isValidLabel","ariaDescribedby","event"],"mappings":";;;;;AAoIA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,EACA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,CAAA,QAAA,YAAA,cAAA,MAAA,EAAA,SAAAA,CAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,aAAA;AACA,aAAA,KAAA,OAAA,MAAA,KAAA,OAAA,OAAA,KAAA,KAAA,OAAA,KAAA,KAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,aAAA,UAAAC,EAAA;AAAA,IACA;AAAA,IAEA,iBAAA;AACA,aAAA,KAAA,gBAAA,MAAA,KAAA,gBAAA;AAAA,IACA;AAAA,IAEA,sBAAA;AACA,aAAA,KAAA,iBAAA,KAAA,cAAA,KAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,YAAAC,IAAA,KAAA,SAAA,KAAA;AACA,aAAAA,KACA,QAAA,KAAA,mJAAA,GAEAA;AAAA,IACA;AAAA,IAEA,kBAAA;AACA,YAAAC,IAAA,CAAA;AACA,aAAA,KAAA,WAAA,SAAA,KACAA,EAAA,KAAA,GAAA,KAAA,SAAA,cAAA,GAEA,KAAA,OAAA,kBAAA,KACAA,EAAA,KAAA,KAAA,OAAA,kBAAA,CAAA,GAEAA,EAAA,KAAA,GAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AACA,WAAA,MAAA,MAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,SAAA;AACA,WAAA,MAAA,MAAA,OAAA;AAAA,IACA;AAAA,IAEA,YAAAC,GAAA;AACA,WAAA,MAAA,gBAAAA,EAAA,OAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcTextArea.mjs","sources":["../../src/components/NcTextArea/NcTextArea.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2023 Richard Steinmetz <richard@steinmetz.cloud>\n -\n - @author Richard Steinmetz <richard@steinmetz.cloud>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU General Public License as published by\n - the Free Software Foundation, either version 3 of the License, or\n - (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU General Public License for more details.\n -\n - You should have received a copy of the GNU General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\n### Description\n\nThis component is a textarea field.\nIt extends and styles an HTMLTextAreaElement.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcTextArea label=\"Text area\"\n\t\t\tplaceholder=\"Placeholders are possible\"\n\t\t\thelper-text=\"This is a regular helper text.\" >\n\t\t</NcTextArea>\n\t\t<NcTextArea label=\"Success state\"\n\t\t\t:success=\"true\">\n\t\t</NcTextArea>\n\t\t<NcTextArea label=\"Error state\"\n\t\t\tplaceholder=\"Enter something valid\"\n\t\t\thelper-text=\"Helper texts will be styled accordingly.\"\n\t\t\t:error=\"true\">\n\t\t</NcTextArea>\n\t\t<NcTextArea label=\"Disabled\"\n\t\t\t:disabled=\"true\" />\n\t\t<NcTextArea label=\"Disabled + Success\"\n\t\t\t:success=\"true\"\n\t\t\t:disabled=\"true\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">External label</label>\n\t\t\t<NcTextArea id=\"textField\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Text area with external label\" />\n\t\t</div>\n\t\t<NcTextArea label=\"Custom size and no resize\"\n\t\t\tresize=\"none\"\n\t\t\trows=\"5\" />\n\t\t</NcTextArea>\n\t</div>\n</template>\n\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\twidth: 100%;\n\talign-items: center;\n\tgap: 14px;\n\n\t> label {\n\t\tflex-shrink: 0;\n\t}\n}\n</style>\n```\n</docs>\n\n<template>\n\t<div class=\"textarea\" :class=\"{ 'textarea--disabled': disabled }\">\n\t\t<div class=\"textarea__main-wrapper\">\n\t\t\t<textarea v-bind=\"$attrs\"\n\t\t\t\t:id=\"computedId\"\n\t\t\t\tref=\"input\"\n\t\t\t\tclass=\"textarea__input\"\n\t\t\t\t:type=\"type\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:placeholder=\"computedPlaceholder\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\taria-live=\"polite\"\n\t\t\t\t:class=\"[inputClass,\n\t\t\t\t\t{\n\t\t\t\t\t\t'textarea__input--label-outside': labelOutside,\n\t\t\t\t\t\t'textarea__input--success': success,\n\t\t\t\t\t\t'textarea__input--error': error,\n\t\t\t\t\t}]\"\n\t\t\t\t:style=\"{ resize: resize }\"\n\t\t\t\t:value=\"value\"\n\t\t\t\tv-on=\"$listeners\"\n\t\t\t\t@input=\"handleInput\" />\n\t\t\t<!-- Label -->\n\t\t\t<label v-if=\"!labelOutside && isValidLabel\"\n\t\t\t\tclass=\"textarea__label\"\n\t\t\t\t:for=\"computedId\">\n\t\t\t\t{{ label }}\n\t\t\t</label>\n\t\t</div>\n\t\t<p v-if=\"helperText.length > 0\"\n\t\t\t:id=\"`${inputName}-helper-text`\"\n\t\t\tclass=\"textarea__helper-text-message\"\n\t\t\t:class=\"{\n\t\t\t\t'textarea__helper-text-message--error': error,\n\t\t\t\t'textarea__helper-text-message--success': success,\n\t\t\t}\">\n\t\t\t<Check v-if=\"success\" class=\"textarea__helper-text-message__icon\" :size=\"18\" />\n\t\t\t<AlertCircle v-else-if=\"error\" class=\"textarea__helper-text-message__icon\" :size=\"18\" />\n\t\t\t{{ helperText }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport GenRandomId from '../../utils/GenRandomId.js'\n\nimport AlertCircle from 'vue-material-design-icons/AlertCircleOutline.vue'\nimport Check from 'vue-material-design-icons/Check.vue'\n\nexport default {\n\tname: 'NcTextArea',\n\n\tcomponents: {\n\t\tAlertCircle,\n\t\tCheck,\n\t},\n\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t/**\n\t\t * The value of the input field\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * The input label, always provide one for accessibility purposes.\n\t\t * This will also be used as a placeholder unless the placeholder\n\t\t * prop is populated with a different string.\n\t\t */\n\t\tlabel: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/**\n\t\t * Pass in true if you want to use an external label. This is useful\n\t\t * if you need a label that looks different from the one provided by\n\t\t * this component\n\t\t */\n\t\tlabelOutside: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The placeholder of the input. This defaults as the string that's\n\t\t * passed into the label prop. In order to remove the placeholder,\n\t\t * pass in an empty string.\n\t\t */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/**\n\t\t * Toggles the success state of the component. Adds a checkmark icon.\n\t\t * this cannot be used together with canClear.\n\t\t */\n\t\tsuccess: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Toggles the error state of the component. Adds an error icon.\n\t\t * this cannot be used together with canClear.\n\t\t */\n\t\terror: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Additional helper text message\n\t\t *\n\t\t * This will be displayed beneath the input field. In case the field is\n\t\t * also marked as having an error, the text will be displayed in red.\n\t\t */\n\t\thelperText: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Disable the input field\n\t\t */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Class to add to the input field.\n\t\t * Necessary to use NcInputField in the NcActionInput component.\n\t\t */\n\t\tinputClass: {\n\t\t\ttype: [Object, String],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * The resize CSS property sets whether an element is resizable, and if\n\t\t * so, in which directions.\n\t\t */\n\t\tresize: {\n\t\t\ttype: String,\n\t\t\tdefault: 'both',\n\t\t\tvalidator: (value) => ['both', 'vertical', 'horizontal', 'none'].includes(value),\n\t\t},\n\t},\n\n\temits: [\n\t\t'update:value',\n\t],\n\n\tcomputed: {\n\t\tcomputedId() {\n\t\t\treturn this.$attrs.id && this.$attrs.id !== '' ? this.$attrs.id : this.inputName\n\t\t},\n\n\t\tinputName() {\n\t\t\treturn 'input' + GenRandomId()\n\t\t},\n\n\t\thasPlaceholder() {\n\t\t\treturn this.placeholder !== '' && this.placeholder !== undefined\n\t\t},\n\n\t\tcomputedPlaceholder() {\n\t\t\treturn this.hasPlaceholder ? this.placeholder : this.label\n\t\t},\n\n\t\tisValidLabel() {\n\t\t\tconst isValidLabel = this.label || this.labelOutside\n\t\t\tif (!isValidLabel) {\n\t\t\t\tconsole.warn('You need to add a label to the NcInputField component. Either use the prop label or use an external one, as per the example in the documentation.')\n\t\t\t}\n\t\t\treturn isValidLabel\n\t\t},\n\n\t\tariaDescribedby() {\n\t\t\tconst ariaDescribedby = []\n\t\t\tif (this.helperText.length > 0) {\n\t\t\t\tariaDescribedby.push(`${this.inputName}-helper-text`)\n\t\t\t}\n\t\t\tif (this.$attrs['aria-describedby']) {\n\t\t\t\tariaDescribedby.push(this.$attrs['aria-describedby'])\n\t\t\t}\n\t\t\treturn ariaDescribedby.join(' ') || null\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Focus the input element\n\t\t *\n\t\t * @public\n\t\t */\n\t\tfocus() {\n\t\t\tthis.$refs.input.focus()\n\t\t},\n\n\t\t/**\n\t\t * Select all the text in the input\n\t\t *\n\t\t * @public\n\t\t */\n\t\tselect() {\n\t\t\tthis.$refs.input.select()\n\t\t},\n\n\t\thandleInput(event) {\n\t\t\tthis.$emit('update:value', event.target.value)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n\n.textarea {\n\tposition: relative;\n\twidth: 100%;\n\tborder-radius: var(--border-radius-large);\n\tmargin-block-start: 6px; // for the label in active state\n\tresize: vertical;\n\n\t&__main-wrapper {\n\t\tposition: relative;\n\t}\n\n\t&--disabled {\n\t\topacity: 0.7;\n\t\tfilter: saturate(0.7);\n\t}\n\n\t&__input {\n\t\tmargin: 0;\n\t\tpadding-inline: 10px 6px; // align with label 8px margin label + 4px padding label - 2px border input\n\t\twidth: 100%;\n\n\t\tfont-size: var(--default-font-size);\n\t\ttext-overflow: ellipsis;\n\n\t\tbackground-color: var(--color-main-background);\n\t\tcolor: var(--color-main-text);\n\t\tborder: 2px solid var(--color-border-maxcontrast);\n\t\tborder-radius: var(--border-radius-large);\n\n\t\tcursor: pointer;\n\n\t\t&:active:not([disabled]),\n\t\t&:hover:not([disabled]),\n\t\t&:focus:not([disabled]) {\n\t\t\tborder-color: 2px solid var(--color-main-text) !important;\n\t\t\tbox-shadow: 0 0 0 2px var(--color-main-background) !important;\n\t\t}\n\n\t\t// Hide placeholder while not focussed -> show label instead (only if internal label is used)\n\t\t&:not(:focus,&--label-outside)::placeholder {\n\t\t\topacity: 0;\n\t\t}\n\n\t\t&:focus {\n\t\t\tcursor: text;\n\t\t}\n\n\t\t&:disabled {\n\t\t\tcursor: default;\n\t\t}\n\n\t\t&:focus-visible {\n\t\t\tbox-shadow: unset !important; // Override server rules\n\t\t}\n\n\t\t&--success {\n\t\t\tborder-color: var(--color-success) !important; //Override hover border color\n\t\t\t&:focus-visible {\n\t\t\t\tbox-shadow: rgb(248, 250, 252) 0px 0px 0px 2px, var(--color-primary-element) 0px 0px 0px 4px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px\n\t\t\t}\n\n\t\t\t// Align label text color with border color (on hover / focus)\n\t\t\t&:focus + .textarea__label,\n\t\t\t&:hover:not(:placeholder-shown) + .textarea__label {\n\t\t\t\tcolor: var(--color-success-text);\n\t\t\t}\n\t\t}\n\n\t\t&--error {\n\t\t\tborder-color: var(--color-error) !important; //Override hover border color\n\t\t\t&:focus-visible {\n\t\t\t\tbox-shadow: rgb(248, 250, 252) 0px 0px 0px 2px, var(--color-primary-element) 0px 0px 0px 4px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px\n\t\t\t}\n\n\t\t\t// Align label text color with border color (on hover / focus)\n\t\t\t&:focus + .textarea__label,\n\t\t\t&:hover:not(:placeholder-shown) + .textarea__label {\n\t\t\t\tcolor: var(--color-error-text);\n\t\t\t}\n\t\t}\n\n\t\t// Align label text color with border color (on hover / focus)\n\t\t&:not(&--success, &--error) {\n\t\t\t&:focus + .textarea__label,\n\t\t\t&:hover:not(:placeholder-shown) + .textarea__label {\n\t\t\t\tcolor: var(--color-primary-element);\n\t\t\t}\n\t\t}\n\t}\n\n\t&__label {\n\t\tposition: absolute;\n\t\tmargin-inline: 12px 0;\n\t\t// fix height and line height to center label\n\t\theight: 17px;\n\t\tmax-width: fit-content;\n\t\tline-height: 1;\n\t\tinset-block-start: 12px;\n\t\tinset-inline: 0;\n\t\t// Fix color so that users do not think the input already has content\n\t\tcolor: var(--color-text-maxcontrast);\n\t\t// only one line labels are allowed\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\t// forward events to input\n\t\tpointer-events: none;\n\t\t// Position transition\n\t\ttransition: height var(--animation-quick), inset-block-start var(--animation-quick), font-size var(--animation-quick), color var(--animation-quick), background-color var(--animation-quick) var(--animation-slow);\n\t}\n\n\t&__input:focus + &__label,\n\t&__input:not(:placeholder-shown) + &__label {\n\t\tinset-block-start: -6px;\n\t\tfont-size: 13px; // minimum allowed font size for accessibility\n\t\tbackground-color: var(--color-main-background);\n\t\theight: 14px;\n\t\tpadding-inline: 4px;\n\t\tmargin-inline-start: 8px;\n\n\t\ttransition: height var(--animation-quick), inset-block-start var(--animation-quick), font-size var(--animation-quick), color var(--animation-quick);\n\t}\n\n\t&__helper-text-message {\n\t\tpadding-block: 4px;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\n\t\t&__icon {\n\t\t\tmargin-inline-end: 8px;\n\t\t}\n\n\t\t&--error {\n\t\t\tcolor: var(--color-error-text);\n\t\t}\n\n\t\t&--success {\n\t\t\tcolor: var(--color-success-text);\n\t\t}\n\t}\n}\n</style>\n"],"names":["_sfc_main","AlertCircle","Check","value","GenRandomId","isValidLabel","ariaDescribedby","event"],"mappings":";;;;;AAoIA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,EACA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,CAAA,QAAA,YAAA,cAAA,MAAA,EAAA,SAAAA,CAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,aAAA;AACA,aAAA,KAAA,OAAA,MAAA,KAAA,OAAA,OAAA,KAAA,KAAA,OAAA,KAAA,KAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,aAAA,UAAAC,EAAA;AAAA,IACA;AAAA,IAEA,iBAAA;AACA,aAAA,KAAA,gBAAA,MAAA,KAAA,gBAAA;AAAA,IACA;AAAA,IAEA,sBAAA;AACA,aAAA,KAAA,iBAAA,KAAA,cAAA,KAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,YAAAC,IAAA,KAAA,SAAA,KAAA;AACA,aAAAA,KACA,QAAA,KAAA,mJAAA,GAEAA;AAAA,IACA;AAAA,IAEA,kBAAA;AACA,YAAAC,IAAA,CAAA;AACA,aAAA,KAAA,WAAA,SAAA,KACAA,EAAA,KAAA,GAAA,KAAA,SAAA,cAAA,GAEA,KAAA,OAAA,kBAAA,KACAA,EAAA,KAAA,KAAA,OAAA,kBAAA,CAAA,GAEAA,EAAA,KAAA,GAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AACA,WAAA,MAAA,MAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,SAAA;AACA,WAAA,MAAA,MAAA,OAAA;AAAA,IACA;AAAA,IAEA,YAAAC,GAAA;AACA,WAAA,MAAA,gBAAAA,EAAA,OAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
2
|
+
const i = require("./NcInputField.cjs"), o = require("../chunks/Close-98cb6f12.cjs"), a = require("../chunks/ArrowRight-7315f6c1.cjs"), s = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), r = require("../chunks/l10n-e9ffbe5e.cjs"), c = {
|
|
3
3
|
name: "UndoVariantIcon",
|
|
4
4
|
emits: ["click"],
|
|
5
5
|
props: {
|
|
@@ -18,10 +18,10 @@ const r = require("./NcInputField.cjs"), l = require("../chunks/Close-98cb6f12.c
|
|
|
18
18
|
};
|
|
19
19
|
var u = function() {
|
|
20
20
|
var t = this, e = t._self._c;
|
|
21
|
-
return e("span", t._b({ staticClass: "material-design-icon undo-variant-icon", attrs: { "aria-hidden": !t.title, "aria-label": t.title, role: "img" }, on: { click: function(
|
|
22
|
-
return t.$emit("click",
|
|
21
|
+
return e("span", t._b({ staticClass: "material-design-icon undo-variant-icon", attrs: { "aria-hidden": !t.title, "aria-label": t.title, role: "img" }, on: { click: function(l) {
|
|
22
|
+
return t.$emit("click", l);
|
|
23
23
|
} } }, "span", t.$attrs, !1), [e("svg", { staticClass: "material-design-icon__svg", attrs: { fill: t.fillColor, width: t.size, height: t.size, viewBox: "0 0 24 24" } }, [e("path", { attrs: { d: "M13.5,7A6.5,6.5 0 0,1 20,13.5A6.5,6.5 0 0,1 13.5,20H10V18H13.5C16,18 18,16 18,13.5C18,11 16,9 13.5,9H7.83L10.91,12.09L9.5,13.5L4,8L9.5,2.5L10.92,3.91L7.83,7H13.5M6,18H8V20H6V18Z" } }, [t.title ? e("title", [t._v(t._s(t.title))]) : t._e()])])]);
|
|
24
|
-
}, p = [], d = /* @__PURE__ */
|
|
24
|
+
}, p = [], d = /* @__PURE__ */ s.normalizeComponent(
|
|
25
25
|
c,
|
|
26
26
|
u,
|
|
27
27
|
p,
|
|
@@ -31,12 +31,12 @@ var u = function() {
|
|
|
31
31
|
null,
|
|
32
32
|
null
|
|
33
33
|
);
|
|
34
|
-
const _ = d.exports, f = new Set(Object.keys(
|
|
34
|
+
const _ = d.exports, f = new Set(Object.keys(i.props)), g = {
|
|
35
35
|
name: "NcTextField",
|
|
36
36
|
components: {
|
|
37
|
-
NcInputField:
|
|
38
|
-
Close:
|
|
39
|
-
ArrowRight:
|
|
37
|
+
NcInputField: i,
|
|
38
|
+
Close: o.Close,
|
|
39
|
+
ArrowRight: a.ArrowRight,
|
|
40
40
|
Undo: _
|
|
41
41
|
},
|
|
42
42
|
// Allow forwarding all attributes
|
|
@@ -49,14 +49,15 @@ const _ = d.exports, f = new Set(Object.keys(r.props)), m = {
|
|
|
49
49
|
// eslint-disable-next-line
|
|
50
50
|
" ": {},
|
|
51
51
|
// Reuse all the props from NcInputField for better typing and documentation
|
|
52
|
-
...
|
|
53
|
-
// Redefined props
|
|
52
|
+
...i.props,
|
|
54
53
|
/**
|
|
55
|
-
*
|
|
54
|
+
* The `aria-label` to set on the trailing button
|
|
55
|
+
* If no explicit value is set it will default to the one matching the `trailingButtonIcon`:
|
|
56
|
+
* @default 'Clear text'|'Save changes'|'Undo changes'
|
|
56
57
|
*/
|
|
57
58
|
trailingButtonLabel: {
|
|
58
59
|
type: String,
|
|
59
|
-
default:
|
|
60
|
+
default: ""
|
|
60
61
|
},
|
|
61
62
|
// Custom props
|
|
62
63
|
/**
|
|
@@ -79,13 +80,20 @@ const _ = d.exports, f = new Set(Object.keys(r.props)), m = {
|
|
|
79
80
|
],
|
|
80
81
|
computed: {
|
|
81
82
|
propsAndAttrsToForward() {
|
|
83
|
+
const n = {
|
|
84
|
+
undo: r.t("Undo changes"),
|
|
85
|
+
close: r.t("Clear text"),
|
|
86
|
+
arrowRight: r.t("Save changes")
|
|
87
|
+
};
|
|
82
88
|
return {
|
|
83
89
|
// Proxy all the HTML attributes
|
|
84
90
|
...this.$attrs,
|
|
85
91
|
// Proxy original NcInputField's props
|
|
86
92
|
...Object.fromEntries(
|
|
87
|
-
Object.entries(this.$props).filter(([
|
|
88
|
-
)
|
|
93
|
+
Object.entries(this.$props).filter(([t]) => f.has(t))
|
|
94
|
+
),
|
|
95
|
+
// Adjust aria-label for predefined trailing buttons
|
|
96
|
+
trailingButtonLabel: this.trailingButtonLabel || n[this.trailingButtonIcon]
|
|
89
97
|
};
|
|
90
98
|
}
|
|
91
99
|
},
|
|
@@ -111,15 +119,15 @@ const _ = d.exports, f = new Set(Object.keys(r.props)), m = {
|
|
|
111
119
|
}
|
|
112
120
|
}
|
|
113
121
|
};
|
|
114
|
-
var
|
|
122
|
+
var h = function() {
|
|
115
123
|
var t = this, e = t._self._c;
|
|
116
124
|
return e("NcInputField", t._g(t._b({ ref: "inputField", on: { input: t.handleInput }, scopedSlots: t._u([t.type !== "search" ? { key: "trailing-button-icon", fn: function() {
|
|
117
125
|
return [t.trailingButtonIcon === "close" ? e("Close", { attrs: { size: 20 } }) : t.trailingButtonIcon === "arrowRight" ? e("ArrowRight", { attrs: { size: 20 } }) : t.trailingButtonIcon === "undo" ? e("Undo", { attrs: { size: 20 } }) : t._e()];
|
|
118
126
|
}, proxy: !0 } : null], null, !0) }, "NcInputField", t.propsAndAttrsToForward, !1), t.$listeners), [t._t("default")], 2);
|
|
119
|
-
},
|
|
120
|
-
m,
|
|
127
|
+
}, m = [], v = /* @__PURE__ */ s.normalizeComponent(
|
|
121
128
|
g,
|
|
122
129
|
h,
|
|
130
|
+
m,
|
|
123
131
|
!1,
|
|
124
132
|
null,
|
|
125
133
|
null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcTextField.cjs","sources":["../../node_modules/vue-material-design-icons/UndoVariant.vue","../../src/components/NcTextField/NcTextField.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"!title\"\n :aria-label=\"title\"\n class=\"material-design-icon undo-variant-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M13.5,7A6.5,6.5 0 0,1 20,13.5A6.5,6.5 0 0,1 13.5,20H10V18H13.5C16,18 18,16 18,13.5C18,11 16,9 13.5,9H7.83L10.91,12.09L9.5,13.5L4,8L9.5,2.5L10.92,3.91L7.83,7H13.5M6,18H8V20H6V18Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"UndoVariantIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - @copyright Copyright (c) 2022 Marco Ambrosini <marcoambrosini@pm.me>\n -\n - @author Marco Ambrosini <marcoambrosini@pm.me>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n\n<docs>\n### Description\nSee [NcInputField](#/Components/NcFields?id=ncinputfield) for a list of all available props.\n\nGeneral purpose text field component.\nIt is recommended to not only provide a placeholder, but also a label.\nThe label should describe what input is expected and the placehold what format the input should have.\n\nNote: the inner html `input` element inherits all the attributes from the\nNcTextField component so you can add things like `autocomplete`, `maxlength`\nand `minlength`.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcTextField :value.sync=\"text1\"\n\t\t\tlabel=\"Leading icon and clear trailing button\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text1 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<Magnify :size=\"20\" />\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text4\"\n\t\t\tlabel=\"Internal label\"\n\t\t\tplaceholder=\"That can be used together with placeholder\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text4 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<Lock :size=\"20\" />\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text2\"\n\t\t\tlabel=\"Success state\"\n\t\t\tplaceholder=\"Placeholders are possible\"\n\t\t\t:success=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text3\"\n\t\t\tlabel=\"Error state\"\n\t\t\tplaceholder=\"Enter something valid\"\n\t\t\t:error=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField label=\"Disabled\"\n\t\t\t:disabled=\"true\" />\n\t\t<NcTextField label=\"Disabled + Success\"\n\t\t\t:success=\"true\"\n\t\t\t:disabled=\"true\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">External label</label>\n\t\t\t<NcTextField :value.sync=\"text5\"\n\t\t\t\tid=\"textField\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Input with external label\"\n\t\t\t\t@trailing-button-click=\"clearText\" />\n\t\t</div>\n\t</div>\n</template>\n<script>\nimport Magnify from 'vue-material-design-icons/Magnify'\nimport Lock from 'vue-material-design-icons/Lock'\nimport Close from 'vue-material-design-icons/Close'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext1: '',\n\t\t\ttext2: '',\n\t\t\ttext3: '',\n\t\t\ttext4: '',\n\t\t\ttext5: '',\n\t\t}\n\t},\n\n\tcomponents: {\n\t\tMagnify,\n\t\tLock,\n\t\tClose,\n\t},\n\n\tmethods: {\n\t\tclearText() {\n\t\t\tthis.text1 = ''\n\t\t\tthis.text3 = ''\n\t\t}\n\t}\n}\n</script>\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\tpadding-right: 14px;\n\twhite-space: nowrap;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<NcInputField v-bind=\"propsAndAttrsToForward\"\n\t\tref=\"inputField\"\n\t\tv-on=\"$listeners\"\n\t\t@input=\"handleInput\">\n\t\t<!-- Default slot for the leading icon -->\n\t\t<slot />\n\n\t\t<!-- Trailing icon slot, except for search type input as the browser already adds a trailing close icon -->\n\t\t<template v-if=\"type !== 'search'\" #trailing-button-icon>\n\t\t\t<Close v-if=\"trailingButtonIcon === 'close'\" :size=\"20\" />\n\t\t\t<ArrowRight v-else-if=\"trailingButtonIcon === 'arrowRight'\" :size=\"20\" />\n\t\t\t<Undo v-else-if=\"trailingButtonIcon === 'undo'\" :size=\"20\" />\n\t\t</template>\n\t</NcInputField>\n</template>\n\n<script>\n\nimport NcInputField from '../NcInputField/NcInputField.vue'\n\nimport Close from 'vue-material-design-icons/Close.vue'\nimport ArrowRight from 'vue-material-design-icons/ArrowRight.vue'\nimport Undo from 'vue-material-design-icons/UndoVariant.vue'\n\nimport { t } from '../../l10n.js'\n\nconst NcInputFieldProps = new Set(Object.keys(NcInputField.props))\n\nexport default {\n\tname: 'NcTextField',\n\n\tcomponents: {\n\t\tNcInputField,\n\t\tClose,\n\t\tArrowRight,\n\t\tUndo,\n\t},\n\n\t// Allow forwarding all attributes\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t/**\n\t\t * Any [NcInputField](#/Components/NcFields?id=ncinputfield) props\n\t\t */\n\t\t// Not an actual prop but needed to show in vue-styleguidist docs\n\t\t// eslint-disable-next-line\n\t\t' ': {},\n\n\t\t// Reuse all the props from NcInputField for better typing and documentation\n\t\t...NcInputField.props,\n\n\t\t
|
|
1
|
+
{"version":3,"file":"NcTextField.cjs","sources":["../../node_modules/vue-material-design-icons/UndoVariant.vue","../../src/components/NcTextField/NcTextField.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"!title\"\n :aria-label=\"title\"\n class=\"material-design-icon undo-variant-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M13.5,7A6.5,6.5 0 0,1 20,13.5A6.5,6.5 0 0,1 13.5,20H10V18H13.5C16,18 18,16 18,13.5C18,11 16,9 13.5,9H7.83L10.91,12.09L9.5,13.5L4,8L9.5,2.5L10.92,3.91L7.83,7H13.5M6,18H8V20H6V18Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"UndoVariantIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - @copyright Copyright (c) 2022 Marco Ambrosini <marcoambrosini@pm.me>\n -\n - @author Marco Ambrosini <marcoambrosini@pm.me>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n\n<docs>\n### Description\nSee [NcInputField](#/Components/NcFields?id=ncinputfield) for a list of all available props.\n\nGeneral purpose text field component.\nIt is recommended to not only provide a placeholder, but also a label.\nThe label should describe what input is expected and the placehold what format the input should have.\n\nNote: the inner html `input` element inherits all the attributes from the\nNcTextField component so you can add things like `autocomplete`, `maxlength`\nand `minlength`.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcTextField :value.sync=\"text1\"\n\t\t\tlabel=\"Leading icon and clear trailing button\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text1 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<Magnify :size=\"20\" />\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text4\"\n\t\t\tlabel=\"Internal label\"\n\t\t\tplaceholder=\"That can be used together with placeholder\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text4 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<Lock :size=\"20\" />\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text2\"\n\t\t\tlabel=\"Success state\"\n\t\t\tplaceholder=\"Placeholders are possible\"\n\t\t\t:success=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text3\"\n\t\t\tlabel=\"Error state\"\n\t\t\tplaceholder=\"Enter something valid\"\n\t\t\t:error=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField label=\"Disabled\"\n\t\t\t:disabled=\"true\" />\n\t\t<NcTextField label=\"Disabled + Success\"\n\t\t\t:success=\"true\"\n\t\t\t:disabled=\"true\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">External label</label>\n\t\t\t<NcTextField :value.sync=\"text5\"\n\t\t\t\tid=\"textField\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Input with external label\"\n\t\t\t\t@trailing-button-click=\"clearText\" />\n\t\t</div>\n\t</div>\n</template>\n<script>\nimport Magnify from 'vue-material-design-icons/Magnify'\nimport Lock from 'vue-material-design-icons/Lock'\nimport Close from 'vue-material-design-icons/Close'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext1: '',\n\t\t\ttext2: '',\n\t\t\ttext3: '',\n\t\t\ttext4: '',\n\t\t\ttext5: '',\n\t\t}\n\t},\n\n\tcomponents: {\n\t\tMagnify,\n\t\tLock,\n\t\tClose,\n\t},\n\n\tmethods: {\n\t\tclearText() {\n\t\t\tthis.text1 = ''\n\t\t\tthis.text3 = ''\n\t\t}\n\t}\n}\n</script>\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\tpadding-right: 14px;\n\twhite-space: nowrap;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<NcInputField v-bind=\"propsAndAttrsToForward\"\n\t\tref=\"inputField\"\n\t\tv-on=\"$listeners\"\n\t\t@input=\"handleInput\">\n\t\t<!-- Default slot for the leading icon -->\n\t\t<slot />\n\n\t\t<!-- Trailing icon slot, except for search type input as the browser already adds a trailing close icon -->\n\t\t<template v-if=\"type !== 'search'\" #trailing-button-icon>\n\t\t\t<Close v-if=\"trailingButtonIcon === 'close'\" :size=\"20\" />\n\t\t\t<ArrowRight v-else-if=\"trailingButtonIcon === 'arrowRight'\" :size=\"20\" />\n\t\t\t<Undo v-else-if=\"trailingButtonIcon === 'undo'\" :size=\"20\" />\n\t\t</template>\n\t</NcInputField>\n</template>\n\n<script>\n\nimport NcInputField from '../NcInputField/NcInputField.vue'\n\nimport Close from 'vue-material-design-icons/Close.vue'\nimport ArrowRight from 'vue-material-design-icons/ArrowRight.vue'\nimport Undo from 'vue-material-design-icons/UndoVariant.vue'\n\nimport { t } from '../../l10n.js'\n\nconst NcInputFieldProps = new Set(Object.keys(NcInputField.props))\n\nexport default {\n\tname: 'NcTextField',\n\n\tcomponents: {\n\t\tNcInputField,\n\t\tClose,\n\t\tArrowRight,\n\t\tUndo,\n\t},\n\n\t// Allow forwarding all attributes\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t/**\n\t\t * Any [NcInputField](#/Components/NcFields?id=ncinputfield) props\n\t\t */\n\t\t// Not an actual prop but needed to show in vue-styleguidist docs\n\t\t// eslint-disable-next-line\n\t\t' ': {},\n\n\t\t// Reuse all the props from NcInputField for better typing and documentation\n\t\t...NcInputField.props,\n\n\t\t/**\n\t\t * The `aria-label` to set on the trailing button\n\t\t * If no explicit value is set it will default to the one matching the `trailingButtonIcon`:\n\t\t * @default 'Clear text'|'Save changes'|'Undo changes'\n\t\t */\n\t\ttrailingButtonLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t// Custom props\n\n\t\t/**\n\t\t * Specifies which material design icon should be used for the trailing\n\t\t * button.\n\t\t * @type {'close'|'arrowRight'|'undo'}\n\t\t */\n\t\ttrailingButtonIcon: {\n\t\t\ttype: String,\n\t\t\tdefault: 'close',\n\t\t\tvalidator: (value) => [\n\t\t\t\t'close',\n\t\t\t\t'arrowRight',\n\t\t\t\t'undo',\n\t\t\t].includes(value),\n\t\t},\n\t},\n\n\temits: [\n\t\t'update:value',\n\t],\n\n\tcomputed: {\n\t\tpropsAndAttrsToForward() {\n\t\t\tconst predefinedLabels = {\n\t\t\t\tundo: t('Undo changes'),\n\t\t\t\tclose: t('Clear text'),\n\t\t\t\tarrowRight: t('Save changes'),\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t// Proxy all the HTML attributes\n\t\t\t\t...this.$attrs,\n\t\t\t\t// Proxy original NcInputField's props\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\tObject.entries(this.$props).filter(([key]) => NcInputFieldProps.has(key)),\n\t\t\t\t),\n\t\t\t\t// Adjust aria-label for predefined trailing buttons\n\t\t\t\ttrailingButtonLabel: this.trailingButtonLabel || predefinedLabels[this.trailingButtonIcon],\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Focus the input element\n\t\t *\n\t\t * @public\n\t\t */\n\t\tfocus() {\n\t\t\tthis.$refs.inputField.focus()\n\t\t},\n\n\t\t/**\n\t\t * Select all the text in the input\n\t\t *\n\t\t * @public\n\t\t */\n\t\tselect() {\n\t\t\tthis.$refs.inputField.select()\n\t\t},\n\n\t\thandleInput(event) {\n\t\t\tthis.$emit('update:value', event.target.value)\n\t\t},\n\t},\n}\n</script>\n"],"names":["_sfc_main","NcInputFieldProps","NcInputField","Close","ArrowRight","Undo","value","predefinedLabels","t","key","event"],"mappings":";mPAoBAA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,CAAA,OAAA;AAAA,EACA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;qBC0HAC,IAAA,IAAA,IAAA,OAAA,KAAAC,EAAA,KAAA,CAAA,GAEAF,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,cAAAE;AAAAA,IACA,OAAAC,EAAA;AAAA,IACA,YAAAC,EAAA;AAAA,IACA,MAAAC;AAAA,EACA;AAAA;AAAA,EAGA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,KAAA,CAAA;AAAA;AAAA,IAGA,GAAAH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,qBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,oBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAI,MAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACA,EAAA,SAAAA,CAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,yBAAA;AACA,YAAAC,IAAA;AAAA,QACA,MAAAC,EAAA,EAAA,cAAA;AAAA,QACA,OAAAA,EAAA,EAAA,YAAA;AAAA,QACA,YAAAA,EAAA,EAAA,cAAA;AAAA,MACA;AAEA,aAAA;AAAA;AAAA,QAEA,GAAA,KAAA;AAAA;AAAA,QAEA,GAAA,OAAA;AAAA,UACA,OAAA,QAAA,KAAA,MAAA,EAAA,OAAA,CAAA,CAAAC,CAAA,MAAAR,EAAA,IAAAQ,CAAA,CAAA;AAAA,QACA;AAAA;AAAA,QAEA,qBAAA,KAAA,uBAAAF,EAAA,KAAA,kBAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AACA,WAAA,MAAA,WAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,SAAA;AACA,WAAA,MAAA,WAAA,OAAA;AAAA,IACA;AAAA,IAEA,YAAAG,GAAA;AACA,WAAA,MAAA,gBAAAA,EAAA,OAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i from "./NcInputField.mjs";
|
|
2
2
|
import { C as l } from "../chunks/Close-271f72e2.mjs";
|
|
3
|
-
import { A as
|
|
4
|
-
import { n as
|
|
5
|
-
import { t as
|
|
3
|
+
import { A as a } from "../chunks/ArrowRight-74a9fcb2.mjs";
|
|
4
|
+
import { n as s } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
|
|
5
|
+
import { t as r } from "../chunks/l10n-ef44019c.mjs";
|
|
6
6
|
const c = {
|
|
7
7
|
name: "UndoVariantIcon",
|
|
8
8
|
emits: ["click"],
|
|
@@ -22,10 +22,10 @@ const c = {
|
|
|
22
22
|
};
|
|
23
23
|
var u = function() {
|
|
24
24
|
var t = this, e = t._self._c;
|
|
25
|
-
return e("span", t._b({ staticClass: "material-design-icon undo-variant-icon", attrs: { "aria-hidden": !t.title, "aria-label": t.title, role: "img" }, on: { click: function(
|
|
26
|
-
return t.$emit("click",
|
|
25
|
+
return e("span", t._b({ staticClass: "material-design-icon undo-variant-icon", attrs: { "aria-hidden": !t.title, "aria-label": t.title, role: "img" }, on: { click: function(o) {
|
|
26
|
+
return t.$emit("click", o);
|
|
27
27
|
} } }, "span", t.$attrs, !1), [e("svg", { staticClass: "material-design-icon__svg", attrs: { fill: t.fillColor, width: t.size, height: t.size, viewBox: "0 0 24 24" } }, [e("path", { attrs: { d: "M13.5,7A6.5,6.5 0 0,1 20,13.5A6.5,6.5 0 0,1 13.5,20H10V18H13.5C16,18 18,16 18,13.5C18,11 16,9 13.5,9H7.83L10.91,12.09L9.5,13.5L4,8L9.5,2.5L10.92,3.91L7.83,7H13.5M6,18H8V20H6V18Z" } }, [t.title ? e("title", [t._v(t._s(t.title))]) : t._e()])])]);
|
|
28
|
-
}, p = [], d = /* @__PURE__ */
|
|
28
|
+
}, p = [], d = /* @__PURE__ */ s(
|
|
29
29
|
c,
|
|
30
30
|
u,
|
|
31
31
|
p,
|
|
@@ -35,12 +35,12 @@ var u = function() {
|
|
|
35
35
|
null,
|
|
36
36
|
null
|
|
37
37
|
);
|
|
38
|
-
const f = d.exports, _ = new Set(Object.keys(
|
|
38
|
+
const f = d.exports, _ = new Set(Object.keys(i.props)), m = {
|
|
39
39
|
name: "NcTextField",
|
|
40
40
|
components: {
|
|
41
|
-
NcInputField:
|
|
41
|
+
NcInputField: i,
|
|
42
42
|
Close: l,
|
|
43
|
-
ArrowRight:
|
|
43
|
+
ArrowRight: a,
|
|
44
44
|
Undo: f
|
|
45
45
|
},
|
|
46
46
|
// Allow forwarding all attributes
|
|
@@ -53,14 +53,15 @@ const f = d.exports, _ = new Set(Object.keys(r.props)), m = {
|
|
|
53
53
|
// eslint-disable-next-line
|
|
54
54
|
" ": {},
|
|
55
55
|
// Reuse all the props from NcInputField for better typing and documentation
|
|
56
|
-
...
|
|
57
|
-
// Redefined props
|
|
56
|
+
...i.props,
|
|
58
57
|
/**
|
|
59
|
-
*
|
|
58
|
+
* The `aria-label` to set on the trailing button
|
|
59
|
+
* If no explicit value is set it will default to the one matching the `trailingButtonIcon`:
|
|
60
|
+
* @default 'Clear text'|'Save changes'|'Undo changes'
|
|
60
61
|
*/
|
|
61
62
|
trailingButtonLabel: {
|
|
62
63
|
type: String,
|
|
63
|
-
default:
|
|
64
|
+
default: ""
|
|
64
65
|
},
|
|
65
66
|
// Custom props
|
|
66
67
|
/**
|
|
@@ -83,13 +84,20 @@ const f = d.exports, _ = new Set(Object.keys(r.props)), m = {
|
|
|
83
84
|
],
|
|
84
85
|
computed: {
|
|
85
86
|
propsAndAttrsToForward() {
|
|
87
|
+
const n = {
|
|
88
|
+
undo: r("Undo changes"),
|
|
89
|
+
close: r("Clear text"),
|
|
90
|
+
arrowRight: r("Save changes")
|
|
91
|
+
};
|
|
86
92
|
return {
|
|
87
93
|
// Proxy all the HTML attributes
|
|
88
94
|
...this.$attrs,
|
|
89
95
|
// Proxy original NcInputField's props
|
|
90
96
|
...Object.fromEntries(
|
|
91
|
-
Object.entries(this.$props).filter(([
|
|
92
|
-
)
|
|
97
|
+
Object.entries(this.$props).filter(([t]) => _.has(t))
|
|
98
|
+
),
|
|
99
|
+
// Adjust aria-label for predefined trailing buttons
|
|
100
|
+
trailingButtonLabel: this.trailingButtonLabel || n[this.trailingButtonIcon]
|
|
93
101
|
};
|
|
94
102
|
}
|
|
95
103
|
},
|
|
@@ -120,7 +128,7 @@ var g = function() {
|
|
|
120
128
|
return e("NcInputField", t._g(t._b({ ref: "inputField", on: { input: t.handleInput }, scopedSlots: t._u([t.type !== "search" ? { key: "trailing-button-icon", fn: function() {
|
|
121
129
|
return [t.trailingButtonIcon === "close" ? e("Close", { attrs: { size: 20 } }) : t.trailingButtonIcon === "arrowRight" ? e("ArrowRight", { attrs: { size: 20 } }) : t.trailingButtonIcon === "undo" ? e("Undo", { attrs: { size: 20 } }) : t._e()];
|
|
122
130
|
}, proxy: !0 } : null], null, !0) }, "NcInputField", t.propsAndAttrsToForward, !1), t.$listeners), [t._t("default")], 2);
|
|
123
|
-
}, h = [], v = /* @__PURE__ */
|
|
131
|
+
}, h = [], v = /* @__PURE__ */ s(
|
|
124
132
|
m,
|
|
125
133
|
g,
|
|
126
134
|
h,
|
|
@@ -130,7 +138,7 @@ var g = function() {
|
|
|
130
138
|
null,
|
|
131
139
|
null
|
|
132
140
|
);
|
|
133
|
-
const
|
|
141
|
+
const w = v.exports;
|
|
134
142
|
export {
|
|
135
|
-
|
|
143
|
+
w as default
|
|
136
144
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcTextField.mjs","sources":["../../node_modules/vue-material-design-icons/UndoVariant.vue","../../src/components/NcTextField/NcTextField.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"!title\"\n :aria-label=\"title\"\n class=\"material-design-icon undo-variant-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M13.5,7A6.5,6.5 0 0,1 20,13.5A6.5,6.5 0 0,1 13.5,20H10V18H13.5C16,18 18,16 18,13.5C18,11 16,9 13.5,9H7.83L10.91,12.09L9.5,13.5L4,8L9.5,2.5L10.92,3.91L7.83,7H13.5M6,18H8V20H6V18Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"UndoVariantIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - @copyright Copyright (c) 2022 Marco Ambrosini <marcoambrosini@pm.me>\n -\n - @author Marco Ambrosini <marcoambrosini@pm.me>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n\n<docs>\n### Description\nSee [NcInputField](#/Components/NcFields?id=ncinputfield) for a list of all available props.\n\nGeneral purpose text field component.\nIt is recommended to not only provide a placeholder, but also a label.\nThe label should describe what input is expected and the placehold what format the input should have.\n\nNote: the inner html `input` element inherits all the attributes from the\nNcTextField component so you can add things like `autocomplete`, `maxlength`\nand `minlength`.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcTextField :value.sync=\"text1\"\n\t\t\tlabel=\"Leading icon and clear trailing button\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text1 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<Magnify :size=\"20\" />\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text4\"\n\t\t\tlabel=\"Internal label\"\n\t\t\tplaceholder=\"That can be used together with placeholder\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text4 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<Lock :size=\"20\" />\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text2\"\n\t\t\tlabel=\"Success state\"\n\t\t\tplaceholder=\"Placeholders are possible\"\n\t\t\t:success=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text3\"\n\t\t\tlabel=\"Error state\"\n\t\t\tplaceholder=\"Enter something valid\"\n\t\t\t:error=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField label=\"Disabled\"\n\t\t\t:disabled=\"true\" />\n\t\t<NcTextField label=\"Disabled + Success\"\n\t\t\t:success=\"true\"\n\t\t\t:disabled=\"true\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">External label</label>\n\t\t\t<NcTextField :value.sync=\"text5\"\n\t\t\t\tid=\"textField\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Input with external label\"\n\t\t\t\t@trailing-button-click=\"clearText\" />\n\t\t</div>\n\t</div>\n</template>\n<script>\nimport Magnify from 'vue-material-design-icons/Magnify'\nimport Lock from 'vue-material-design-icons/Lock'\nimport Close from 'vue-material-design-icons/Close'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext1: '',\n\t\t\ttext2: '',\n\t\t\ttext3: '',\n\t\t\ttext4: '',\n\t\t\ttext5: '',\n\t\t}\n\t},\n\n\tcomponents: {\n\t\tMagnify,\n\t\tLock,\n\t\tClose,\n\t},\n\n\tmethods: {\n\t\tclearText() {\n\t\t\tthis.text1 = ''\n\t\t\tthis.text3 = ''\n\t\t}\n\t}\n}\n</script>\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\tpadding-right: 14px;\n\twhite-space: nowrap;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<NcInputField v-bind=\"propsAndAttrsToForward\"\n\t\tref=\"inputField\"\n\t\tv-on=\"$listeners\"\n\t\t@input=\"handleInput\">\n\t\t<!-- Default slot for the leading icon -->\n\t\t<slot />\n\n\t\t<!-- Trailing icon slot, except for search type input as the browser already adds a trailing close icon -->\n\t\t<template v-if=\"type !== 'search'\" #trailing-button-icon>\n\t\t\t<Close v-if=\"trailingButtonIcon === 'close'\" :size=\"20\" />\n\t\t\t<ArrowRight v-else-if=\"trailingButtonIcon === 'arrowRight'\" :size=\"20\" />\n\t\t\t<Undo v-else-if=\"trailingButtonIcon === 'undo'\" :size=\"20\" />\n\t\t</template>\n\t</NcInputField>\n</template>\n\n<script>\n\nimport NcInputField from '../NcInputField/NcInputField.vue'\n\nimport Close from 'vue-material-design-icons/Close.vue'\nimport ArrowRight from 'vue-material-design-icons/ArrowRight.vue'\nimport Undo from 'vue-material-design-icons/UndoVariant.vue'\n\nimport { t } from '../../l10n.js'\n\nconst NcInputFieldProps = new Set(Object.keys(NcInputField.props))\n\nexport default {\n\tname: 'NcTextField',\n\n\tcomponents: {\n\t\tNcInputField,\n\t\tClose,\n\t\tArrowRight,\n\t\tUndo,\n\t},\n\n\t// Allow forwarding all attributes\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t/**\n\t\t * Any [NcInputField](#/Components/NcFields?id=ncinputfield) props\n\t\t */\n\t\t// Not an actual prop but needed to show in vue-styleguidist docs\n\t\t// eslint-disable-next-line\n\t\t' ': {},\n\n\t\t// Reuse all the props from NcInputField for better typing and documentation\n\t\t...NcInputField.props,\n\n\t\t
|
|
1
|
+
{"version":3,"file":"NcTextField.mjs","sources":["../../node_modules/vue-material-design-icons/UndoVariant.vue","../../src/components/NcTextField/NcTextField.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"!title\"\n :aria-label=\"title\"\n class=\"material-design-icon undo-variant-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M13.5,7A6.5,6.5 0 0,1 20,13.5A6.5,6.5 0 0,1 13.5,20H10V18H13.5C16,18 18,16 18,13.5C18,11 16,9 13.5,9H7.83L10.91,12.09L9.5,13.5L4,8L9.5,2.5L10.92,3.91L7.83,7H13.5M6,18H8V20H6V18Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"UndoVariantIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - @copyright Copyright (c) 2022 Marco Ambrosini <marcoambrosini@pm.me>\n -\n - @author Marco Ambrosini <marcoambrosini@pm.me>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n\n<docs>\n### Description\nSee [NcInputField](#/Components/NcFields?id=ncinputfield) for a list of all available props.\n\nGeneral purpose text field component.\nIt is recommended to not only provide a placeholder, but also a label.\nThe label should describe what input is expected and the placehold what format the input should have.\n\nNote: the inner html `input` element inherits all the attributes from the\nNcTextField component so you can add things like `autocomplete`, `maxlength`\nand `minlength`.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcTextField :value.sync=\"text1\"\n\t\t\tlabel=\"Leading icon and clear trailing button\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text1 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<Magnify :size=\"20\" />\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text4\"\n\t\t\tlabel=\"Internal label\"\n\t\t\tplaceholder=\"That can be used together with placeholder\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text4 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<Lock :size=\"20\" />\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text2\"\n\t\t\tlabel=\"Success state\"\n\t\t\tplaceholder=\"Placeholders are possible\"\n\t\t\t:success=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text3\"\n\t\t\tlabel=\"Error state\"\n\t\t\tplaceholder=\"Enter something valid\"\n\t\t\t:error=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField label=\"Disabled\"\n\t\t\t:disabled=\"true\" />\n\t\t<NcTextField label=\"Disabled + Success\"\n\t\t\t:success=\"true\"\n\t\t\t:disabled=\"true\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">External label</label>\n\t\t\t<NcTextField :value.sync=\"text5\"\n\t\t\t\tid=\"textField\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Input with external label\"\n\t\t\t\t@trailing-button-click=\"clearText\" />\n\t\t</div>\n\t</div>\n</template>\n<script>\nimport Magnify from 'vue-material-design-icons/Magnify'\nimport Lock from 'vue-material-design-icons/Lock'\nimport Close from 'vue-material-design-icons/Close'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext1: '',\n\t\t\ttext2: '',\n\t\t\ttext3: '',\n\t\t\ttext4: '',\n\t\t\ttext5: '',\n\t\t}\n\t},\n\n\tcomponents: {\n\t\tMagnify,\n\t\tLock,\n\t\tClose,\n\t},\n\n\tmethods: {\n\t\tclearText() {\n\t\t\tthis.text1 = ''\n\t\t\tthis.text3 = ''\n\t\t}\n\t}\n}\n</script>\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\tpadding-right: 14px;\n\twhite-space: nowrap;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<NcInputField v-bind=\"propsAndAttrsToForward\"\n\t\tref=\"inputField\"\n\t\tv-on=\"$listeners\"\n\t\t@input=\"handleInput\">\n\t\t<!-- Default slot for the leading icon -->\n\t\t<slot />\n\n\t\t<!-- Trailing icon slot, except for search type input as the browser already adds a trailing close icon -->\n\t\t<template v-if=\"type !== 'search'\" #trailing-button-icon>\n\t\t\t<Close v-if=\"trailingButtonIcon === 'close'\" :size=\"20\" />\n\t\t\t<ArrowRight v-else-if=\"trailingButtonIcon === 'arrowRight'\" :size=\"20\" />\n\t\t\t<Undo v-else-if=\"trailingButtonIcon === 'undo'\" :size=\"20\" />\n\t\t</template>\n\t</NcInputField>\n</template>\n\n<script>\n\nimport NcInputField from '../NcInputField/NcInputField.vue'\n\nimport Close from 'vue-material-design-icons/Close.vue'\nimport ArrowRight from 'vue-material-design-icons/ArrowRight.vue'\nimport Undo from 'vue-material-design-icons/UndoVariant.vue'\n\nimport { t } from '../../l10n.js'\n\nconst NcInputFieldProps = new Set(Object.keys(NcInputField.props))\n\nexport default {\n\tname: 'NcTextField',\n\n\tcomponents: {\n\t\tNcInputField,\n\t\tClose,\n\t\tArrowRight,\n\t\tUndo,\n\t},\n\n\t// Allow forwarding all attributes\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t/**\n\t\t * Any [NcInputField](#/Components/NcFields?id=ncinputfield) props\n\t\t */\n\t\t// Not an actual prop but needed to show in vue-styleguidist docs\n\t\t// eslint-disable-next-line\n\t\t' ': {},\n\n\t\t// Reuse all the props from NcInputField for better typing and documentation\n\t\t...NcInputField.props,\n\n\t\t/**\n\t\t * The `aria-label` to set on the trailing button\n\t\t * If no explicit value is set it will default to the one matching the `trailingButtonIcon`:\n\t\t * @default 'Clear text'|'Save changes'|'Undo changes'\n\t\t */\n\t\ttrailingButtonLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t// Custom props\n\n\t\t/**\n\t\t * Specifies which material design icon should be used for the trailing\n\t\t * button.\n\t\t * @type {'close'|'arrowRight'|'undo'}\n\t\t */\n\t\ttrailingButtonIcon: {\n\t\t\ttype: String,\n\t\t\tdefault: 'close',\n\t\t\tvalidator: (value) => [\n\t\t\t\t'close',\n\t\t\t\t'arrowRight',\n\t\t\t\t'undo',\n\t\t\t].includes(value),\n\t\t},\n\t},\n\n\temits: [\n\t\t'update:value',\n\t],\n\n\tcomputed: {\n\t\tpropsAndAttrsToForward() {\n\t\t\tconst predefinedLabels = {\n\t\t\t\tundo: t('Undo changes'),\n\t\t\t\tclose: t('Clear text'),\n\t\t\t\tarrowRight: t('Save changes'),\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t// Proxy all the HTML attributes\n\t\t\t\t...this.$attrs,\n\t\t\t\t// Proxy original NcInputField's props\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\tObject.entries(this.$props).filter(([key]) => NcInputFieldProps.has(key)),\n\t\t\t\t),\n\t\t\t\t// Adjust aria-label for predefined trailing buttons\n\t\t\t\ttrailingButtonLabel: this.trailingButtonLabel || predefinedLabels[this.trailingButtonIcon],\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Focus the input element\n\t\t *\n\t\t * @public\n\t\t */\n\t\tfocus() {\n\t\t\tthis.$refs.inputField.focus()\n\t\t},\n\n\t\t/**\n\t\t * Select all the text in the input\n\t\t *\n\t\t * @public\n\t\t */\n\t\tselect() {\n\t\t\tthis.$refs.inputField.select()\n\t\t},\n\n\t\thandleInput(event) {\n\t\t\tthis.$emit('update:value', event.target.value)\n\t\t},\n\t},\n}\n</script>\n"],"names":["_sfc_main","NcInputFieldProps","NcInputField","Close","ArrowRight","Undo","value","predefinedLabels","t","key","event"],"mappings":";;;;;AAoBA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,CAAA,OAAA;AAAA,EACA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;qBC0HAC,IAAA,IAAA,IAAA,OAAA,KAAAC,EAAA,KAAA,CAAA,GAEAF,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,cAAAE;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,MAAAC;AAAA,EACA;AAAA;AAAA,EAGA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,KAAA,CAAA;AAAA;AAAA,IAGA,GAAAH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,qBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,oBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAI,MAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACA,EAAA,SAAAA,CAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,yBAAA;AACA,YAAAC,IAAA;AAAA,QACA,MAAAC,EAAA,cAAA;AAAA,QACA,OAAAA,EAAA,YAAA;AAAA,QACA,YAAAA,EAAA,cAAA;AAAA,MACA;AAEA,aAAA;AAAA;AAAA,QAEA,GAAA,KAAA;AAAA;AAAA,QAEA,GAAA,OAAA;AAAA,UACA,OAAA,QAAA,KAAA,MAAA,EAAA,OAAA,CAAA,CAAAC,CAAA,MAAAR,EAAA,IAAAQ,CAAA,CAAA;AAAA,QACA;AAAA;AAAA,QAEA,qBAAA,KAAA,uBAAAF,EAAA,KAAA,kBAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AACA,WAAA,MAAA,WAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,SAAA;AACA,WAAA,MAAA,WAAA,OAAA;AAAA,IACA;AAAA,IAEA,YAAAG,GAAA;AACA,WAAA,MAAA,gBAAAA,EAAA,OAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const N = require("../chunks/l10n-
|
|
2
|
+
const N = require("../chunks/l10n-e9ffbe5e.cjs"), t = require("../chunks/logger-4998b668.cjs"), e = require("@nextcloud/calendar-js"), Z = require("../chunks/GenRandomId-c214d235.cjs"), Y = require("./NcSelect.cjs"), M = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs");
|
|
3
3
|
/**
|
|
4
4
|
* @copyright Copyright (c) 2019 Georg Ehrke
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as N } from "../chunks/l10n-
|
|
1
|
+
import { t as N } from "../chunks/l10n-ef44019c.mjs";
|
|
2
2
|
import { l as t } from "../chunks/logger-3612e664.mjs";
|
|
3
3
|
import { getTimezoneManager as e } from "@nextcloud/calendar-js";
|
|
4
4
|
import { G as Z } from "../chunks/GenRandomId-cb9ccebe.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var y = require("../assets/index-c221fe05.css");
|
|
2
|
-
const s = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), a = require("../chunks/index-
|
|
2
|
+
const s = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), a = require("../chunks/index-dc10fd2b.cjs"), n = require("./NcPopover.cjs"), i = require("vue"), o = (t) => t && t.__esModule ? t : { default: t }, u = /* @__PURE__ */ o(i), l = {
|
|
3
3
|
name: "NcUserBubbleDiv"
|
|
4
4
|
};
|
|
5
5
|
var c = function() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../assets/index-c221fe05.css";
|
|
2
2
|
import { n as s } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
|
|
3
|
-
import { N as a } from "../chunks/index-
|
|
3
|
+
import { N as a } from "../chunks/index-cea13a24.mjs";
|
|
4
4
|
import n from "./NcPopover.mjs";
|
|
5
5
|
import i from "vue";
|
|
6
6
|
const o = {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const e = require("vue");
|
|
4
|
+
/**
|
|
5
|
+
* @copyright Copyright (c) 2023 Grigorii K. Shartsev <me@shgk.me>
|
|
6
|
+
*
|
|
7
|
+
* @author Grigorii K. Shartsev <me@shgk.me>
|
|
8
|
+
*
|
|
9
|
+
* @license AGPL-3.0-or-later
|
|
10
|
+
*
|
|
11
|
+
* This program is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU Affero General Public License as
|
|
13
|
+
* published by the Free Software Foundation, either version 3 of the
|
|
14
|
+
* License, or (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU Affero General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
const n = () => window.outerHeight === screen.height, s = e.ref(n());
|
|
26
|
+
window.addEventListener("resize", () => {
|
|
27
|
+
s.value = n();
|
|
28
|
+
});
|
|
29
|
+
function r() {
|
|
30
|
+
return e.readonly(s);
|
|
31
|
+
}
|
|
32
|
+
const t = e.readonly(s);
|
|
33
|
+
exports.isFullscreenState = t;
|
|
34
|
+
exports.useIsFullscreen = r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIsFullscreen.cjs","sources":["../../src/composables/useIsFullscreen/index.js"],"sourcesContent":["/**\n * @copyright Copyright (c) 2023 Grigorii K. Shartsev <me@shgk.me>\n *\n * @author Grigorii K. Shartsev <me@shgk.me>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { readonly, ref } from 'vue'\n\n// if the window height is equal to the screen height,\n// we're in full screen mode\nconst checkIfIsFullscreen = () => window.outerHeight === screen.height\n\nconst isFullscreen = ref(checkIfIsFullscreen())\n\nwindow.addEventListener('resize', () => {\n\tisFullscreen.value = checkIfIsFullscreen()\n})\n\n/**\n * Use global isFullscreen state, based on the screen height check\n *\n * @return {import('vue').DeepReadonly<import('vue').Ref<boolean>>}\n */\nexport function useIsFullscreen() {\n\treturn readonly(isFullscreen)\n}\n\n/**\n * @deprecated Is to be removed in v9.0.0 with Vue 3 migration.\n * Use `composables/useIsFullscreen` instead.\n * Defined and exported only for isFullscreen mixin.\n */\nexport const isFullscreenState = readonly(isFullscreen)\n"],"names":["checkIfIsFullscreen","isFullscreen","ref","useIsFullscreen","readonly","isFullscreenState"],"mappings":";;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BA,MAAMA,IAAsB,MAAM,OAAO,gBAAgB,OAAO,QAE1DC,IAAeC,EAAAA,IAAIF,GAAqB;AAE9C,OAAO,iBAAiB,UAAU,MAAM;AACvC,EAAAC,EAAa,QAAQD,EAAqB;AAC3C,CAAC;AAOM,SAASG,IAAkB;AACjC,SAAOC,EAAAA,SAASH,CAAY;AAC7B;AAOY,MAACI,IAAoBD,EAAQ,SAACH,CAAY;;;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ref as s, readonly as n } from "vue";
|
|
2
|
+
/**
|
|
3
|
+
* @copyright Copyright (c) 2023 Grigorii K. Shartsev <me@shgk.me>
|
|
4
|
+
*
|
|
5
|
+
* @author Grigorii K. Shartsev <me@shgk.me>
|
|
6
|
+
*
|
|
7
|
+
* @license AGPL-3.0-or-later
|
|
8
|
+
*
|
|
9
|
+
* This program is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU Affero General Public License as
|
|
11
|
+
* published by the Free Software Foundation, either version 3 of the
|
|
12
|
+
* License, or (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU Affero General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
const r = () => window.outerHeight === screen.height, e = s(r());
|
|
24
|
+
window.addEventListener("resize", () => {
|
|
25
|
+
e.value = r();
|
|
26
|
+
});
|
|
27
|
+
function c() {
|
|
28
|
+
return n(e);
|
|
29
|
+
}
|
|
30
|
+
const o = n(e);
|
|
31
|
+
export {
|
|
32
|
+
o as isFullscreenState,
|
|
33
|
+
c as useIsFullscreen
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIsFullscreen.mjs","sources":["../../src/composables/useIsFullscreen/index.js"],"sourcesContent":["/**\n * @copyright Copyright (c) 2023 Grigorii K. Shartsev <me@shgk.me>\n *\n * @author Grigorii K. Shartsev <me@shgk.me>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { readonly, ref } from 'vue'\n\n// if the window height is equal to the screen height,\n// we're in full screen mode\nconst checkIfIsFullscreen = () => window.outerHeight === screen.height\n\nconst isFullscreen = ref(checkIfIsFullscreen())\n\nwindow.addEventListener('resize', () => {\n\tisFullscreen.value = checkIfIsFullscreen()\n})\n\n/**\n * Use global isFullscreen state, based on the screen height check\n *\n * @return {import('vue').DeepReadonly<import('vue').Ref<boolean>>}\n */\nexport function useIsFullscreen() {\n\treturn readonly(isFullscreen)\n}\n\n/**\n * @deprecated Is to be removed in v9.0.0 with Vue 3 migration.\n * Use `composables/useIsFullscreen` instead.\n * Defined and exported only for isFullscreen mixin.\n */\nexport const isFullscreenState = readonly(isFullscreen)\n"],"names":["checkIfIsFullscreen","isFullscreen","ref","useIsFullscreen","readonly","isFullscreenState"],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BA,MAAMA,IAAsB,MAAM,OAAO,gBAAgB,OAAO,QAE1DC,IAAeC,EAAIF,GAAqB;AAE9C,OAAO,iBAAiB,UAAU,MAAM;AACvC,EAAAC,EAAa,QAAQD,EAAqB;AAC3C,CAAC;AAOM,SAASG,IAAkB;AACjC,SAAOC,EAASH,CAAY;AAC7B;AAOY,MAACI,IAAoBD,EAASH,CAAY;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const e = require("vue");
|
|
4
|
+
/**
|
|
5
|
+
* @copyright Copyright (c) 2023 Grigorii K. Shartsev <me@shgk.me>
|
|
6
|
+
*
|
|
7
|
+
* @author Grigorii K. Shartsev <me@shgk.me>
|
|
8
|
+
*
|
|
9
|
+
* @license AGPL-3.0-or-later
|
|
10
|
+
*
|
|
11
|
+
* This program is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU Affero General Public License as
|
|
13
|
+
* published by the Free Software Foundation, either version 3 of the
|
|
14
|
+
* License, or (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU Affero General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
const o = 1024, i = () => document.documentElement.clientWidth < o, t = e.ref(i());
|
|
26
|
+
window.addEventListener("resize", () => {
|
|
27
|
+
t.value = i();
|
|
28
|
+
});
|
|
29
|
+
function n() {
|
|
30
|
+
return e.readonly(t);
|
|
31
|
+
}
|
|
32
|
+
const s = e.readonly(t);
|
|
33
|
+
exports.MOBILE_BREAKPOINT = o;
|
|
34
|
+
exports.isMobileState = s;
|
|
35
|
+
exports.useIsMobile = n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIsMobile.cjs","sources":["../../src/composables/useIsMobile/index.js"],"sourcesContent":["/**\n * @copyright Copyright (c) 2023 Grigorii K. Shartsev <me@shgk.me>\n *\n * @author Grigorii K. Shartsev <me@shgk.me>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { readonly, ref } from 'vue'\n\n/**\n * The minimal width of the viewport to be considered a desktop device\n */\nexport const MOBILE_BREAKPOINT = 1024\n\nconst checkIfIsMobile = () => document.documentElement.clientWidth < MOBILE_BREAKPOINT\n\nconst isMobile = ref(checkIfIsMobile())\n\nwindow.addEventListener('resize', () => {\n\tisMobile.value = checkIfIsMobile()\n})\n\n/**\n * Use global isMobile state, based on the viewport width\n *\n * @return {import('vue').DeepReadonly<import('vue').Ref<boolean>>}\n */\nexport function useIsMobile() {\n\treturn readonly(isMobile)\n}\n\n/**\n * @deprecated Is to be removed in v9.0.0 with Vue 3 migration.\n * Use `composables/useIsMobile` instead.\n * Defined and exported only for isMobile mixin.\n */\nexport const isMobileState = readonly(isMobile)\n"],"names":["MOBILE_BREAKPOINT","checkIfIsMobile","isMobile","ref","useIsMobile","readonly","isMobileState"],"mappings":";;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2BY,MAACA,IAAoB,MAE3BC,IAAkB,MAAM,SAAS,gBAAgB,cAAcD,GAE/DE,IAAWC,EAAAA,IAAIF,GAAiB;AAEtC,OAAO,iBAAiB,UAAU,MAAM;AACvC,EAAAC,EAAS,QAAQD,EAAiB;AACnC,CAAC;AAOM,SAASG,IAAc;AAC7B,SAAOC,EAAAA,SAASH,CAAQ;AACzB;AAOY,MAACI,IAAgBD,EAAQ,SAACH,CAAQ;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ref as n, readonly as t } from "vue";
|
|
2
|
+
/**
|
|
3
|
+
* @copyright Copyright (c) 2023 Grigorii K. Shartsev <me@shgk.me>
|
|
4
|
+
*
|
|
5
|
+
* @author Grigorii K. Shartsev <me@shgk.me>
|
|
6
|
+
*
|
|
7
|
+
* @license AGPL-3.0-or-later
|
|
8
|
+
*
|
|
9
|
+
* This program is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU Affero General Public License as
|
|
11
|
+
* published by the Free Software Foundation, either version 3 of the
|
|
12
|
+
* License, or (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU Affero General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
const i = 1024, o = () => document.documentElement.clientWidth < i, e = n(o());
|
|
24
|
+
window.addEventListener("resize", () => {
|
|
25
|
+
e.value = o();
|
|
26
|
+
});
|
|
27
|
+
function c() {
|
|
28
|
+
return t(e);
|
|
29
|
+
}
|
|
30
|
+
const r = t(e);
|
|
31
|
+
export {
|
|
32
|
+
i as MOBILE_BREAKPOINT,
|
|
33
|
+
r as isMobileState,
|
|
34
|
+
c as useIsMobile
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIsMobile.mjs","sources":["../../src/composables/useIsMobile/index.js"],"sourcesContent":["/**\n * @copyright Copyright (c) 2023 Grigorii K. Shartsev <me@shgk.me>\n *\n * @author Grigorii K. Shartsev <me@shgk.me>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { readonly, ref } from 'vue'\n\n/**\n * The minimal width of the viewport to be considered a desktop device\n */\nexport const MOBILE_BREAKPOINT = 1024\n\nconst checkIfIsMobile = () => document.documentElement.clientWidth < MOBILE_BREAKPOINT\n\nconst isMobile = ref(checkIfIsMobile())\n\nwindow.addEventListener('resize', () => {\n\tisMobile.value = checkIfIsMobile()\n})\n\n/**\n * Use global isMobile state, based on the viewport width\n *\n * @return {import('vue').DeepReadonly<import('vue').Ref<boolean>>}\n */\nexport function useIsMobile() {\n\treturn readonly(isMobile)\n}\n\n/**\n * @deprecated Is to be removed in v9.0.0 with Vue 3 migration.\n * Use `composables/useIsMobile` instead.\n * Defined and exported only for isMobile mixin.\n */\nexport const isMobileState = readonly(isMobile)\n"],"names":["MOBILE_BREAKPOINT","checkIfIsMobile","isMobile","ref","useIsMobile","readonly","isMobileState"],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2BY,MAACA,IAAoB,MAE3BC,IAAkB,MAAM,SAAS,gBAAgB,cAAcD,GAE/DE,IAAWC,EAAIF,GAAiB;AAEtC,OAAO,iBAAiB,UAAU,MAAM;AACvC,EAAAC,EAAS,QAAQD,EAAiB;AACnC,CAAC;AAOM,SAASG,IAAc;AAC7B,SAAOC,EAASH,CAAQ;AACzB;AAOY,MAACI,IAAgBD,EAASH,CAAQ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const f = require("../chunks/GenColors-
|
|
2
|
+
const f = require("../chunks/GenColors-4314c256.cjs"), i = require("md5"), p = (t) => t && t.__esModule ? t : { default: t }, d = /* @__PURE__ */ p(i);
|
|
3
3
|
/**
|
|
4
4
|
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
|
|
5
5
|
*
|