@brftech/filex-core 0.42.1 → 0.43.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/README.md +14 -2
- package/dist/ArchiveViewer-BqU761Wk.js +149 -0
- package/dist/ArchiveViewer-BqU761Wk.js.map +1 -0
- package/dist/CsvViewer-ByHVK5ga.js +172 -0
- package/dist/CsvViewer-ByHVK5ga.js.map +1 -0
- package/dist/{DrawioViewer-BuhZOAx6.js → DrawioViewer-Bgrj8-zG.js} +45 -44
- package/dist/DrawioViewer-Bgrj8-zG.js.map +1 -0
- package/dist/{EpubViewer-DS3mb3k8.js → EpubViewer-DJwUKlHW.js} +50 -50
- package/dist/EpubViewer-DJwUKlHW.js.map +1 -0
- package/dist/IpynbViewer-Bz0eJ4NS.js +184 -0
- package/dist/IpynbViewer-Bz0eJ4NS.js.map +1 -0
- package/dist/MermaidViewer-CEDTD_pp.js +136 -0
- package/dist/MermaidViewer-CEDTD_pp.js.map +1 -0
- package/dist/PsdViewer-CZcxUpZO.js +121 -0
- package/dist/PsdViewer-CZcxUpZO.js.map +1 -0
- package/dist/TiffViewer-BwI62CbQ.js +141 -0
- package/dist/TiffViewer-BwI62CbQ.js.map +1 -0
- package/dist/{Viewer3D-CIrOn63I.js → Viewer3D-DoeZcuMm.js} +16 -16
- package/dist/Viewer3D-DoeZcuMm.js.map +1 -0
- package/dist/filex-core.js +475 -219
- package/dist/filex-core.umd.cjs +165 -108
- package/dist/filex-core.umd.cjs.map +1 -1
- package/dist/fonts/caveat-latin-ext.woff2 +0 -0
- package/dist/fonts/caveat-latin.woff2 +0 -0
- package/dist/fonts/dancing-script-latin-ext.woff2 +0 -0
- package/dist/fonts/dancing-script-latin.woff2 +0 -0
- package/dist/fonts/homemade-apple-latin.woff2 +0 -0
- package/dist/fonts/source-serif-4-latin-ext.woff2 +0 -0
- package/dist/fonts/source-serif-4-latin.woff2 +0 -0
- package/dist/index-DuWnGuv5.js +35901 -0
- package/dist/index-DuWnGuv5.js.map +1 -0
- package/dist/index.d.ts +5241 -553
- package/dist/pdf-CaPYsOUo.js +21302 -0
- package/dist/pdf-CaPYsOUo.js.map +1 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/FileExplorer.vue +1207 -343
- package/src/assets/fonts/LICENSE-Apache-2.0.txt +202 -0
- package/src/assets/fonts/LICENSE-OFL-1.1.txt +93 -0
- package/src/assets/fonts/README.md +58 -0
- package/src/assets/fonts/caveat-latin-ext.woff2 +0 -0
- package/src/assets/fonts/caveat-latin.woff2 +0 -0
- package/src/assets/fonts/dancing-script-latin-ext.woff2 +0 -0
- package/src/assets/fonts/dancing-script-latin.woff2 +0 -0
- package/src/assets/fonts/homemade-apple-latin.woff2 +0 -0
- package/src/assets/fonts/source-serif-4-latin-ext.woff2 +0 -0
- package/src/assets/fonts/source-serif-4-latin.woff2 +0 -0
- package/src/components/AdvancedSearch.vue +49 -0
- package/src/components/Breadcrumb.vue +5 -5
- package/src/components/ChoiceButtons.vue +152 -0
- package/src/components/CommandPalette.vue +5 -5
- package/src/components/ConnectionGuideView.vue +1 -1
- package/src/components/ConnectionNotice.vue +59 -0
- package/src/components/ConnectionsPanel.vue +30 -568
- package/src/components/ContextMenu.vue +31 -5
- package/src/components/DataTable.vue +1331 -0
- package/src/components/FilePane.vue +3 -0
- package/src/components/FilterBar.vue +12 -5
- package/src/components/GalleryView.vue +50 -2
- package/src/components/GridView.vue +51 -3
- package/src/components/HomeView.vue +18 -6
- package/src/components/InspectorPanel.vue +134 -17
- package/src/components/ListView.vue +366 -900
- package/src/components/LogoMark.vue +57 -0
- package/src/components/NFSExportsPanel.vue +76 -28
- package/src/components/OnboardingTour.vue +19 -7
- package/src/components/OperationsCenter.vue +77 -1
- package/src/components/PendingOpsTray.vue +59 -5
- package/src/components/PresenceBar.vue +7 -7
- package/src/components/ProductVersion.vue +31 -0
- package/src/components/QuickLook.vue +10 -14
- package/src/components/RecentlyOpened.vue +47 -17
- package/src/components/RecoveryKeyModal.vue +1 -1
- package/src/components/RowActions.vue +134 -0
- package/src/components/S3KeysPanel.vue +98 -56
- package/src/components/SSHKeysPanel.vue +79 -26
- package/src/components/SideNav.vue +260 -96
- package/src/components/StarButton.vue +1 -0
- package/src/components/StorageFields.vue +74 -6
- package/src/components/StorageTags.vue +62 -0
- package/src/components/TabBar.vue +1 -1
- package/src/components/TagKindIcon.vue +56 -0
- package/src/components/TagPicker.vue +226 -40
- package/src/components/ThemePalette.vue +4 -4
- package/src/components/TimeZonePicker.vue +29 -10
- package/src/components/TokensPanel.vue +82 -27
- package/src/components/Toolbar.vue +28 -6
- package/src/components/plugin/PluginConfirmModal.vue +54 -0
- package/src/components/plugin/PluginInspectorSection.vue +149 -0
- package/src/components/plugin/PluginPageView.vue +339 -0
- package/src/components/plugin/PluginViewModal.vue +159 -0
- package/src/components/plugin/SurfaceConversation.vue +76 -0
- package/src/components/plugin/SurfaceFooterButtons.vue +73 -0
- package/src/components/plugin/SurfaceRenderer.vue +299 -0
- package/src/components/plugin/SurfaceSections.vue +91 -0
- package/src/components/plugin/nodes/PdfFieldEditor.vue +509 -0
- package/src/components/plugin/nodes/SurfaceFileChooser.vue +94 -0
- package/src/components/plugin/nodes/SurfaceForm.vue +82 -0
- package/src/components/plugin/nodes/SurfaceList.vue +127 -0
- package/src/components/plugin/nodes/SurfacePdfFields.vue +1285 -0
- package/src/components/plugin/nodes/SurfacePeoplePicker.vue +213 -0
- package/src/components/plugin/nodes/SurfacePinInput.vue +57 -0
- package/src/components/plugin/nodes/SurfacePreview.vue +119 -0
- package/src/components/plugin/nodes/SurfaceProgress.vue +48 -0
- package/src/components/plugin/nodes/SurfaceSignaturePad.vue +472 -0
- package/src/components/plugin/nodes/SurfaceSteps.vue +53 -0
- package/src/components/public/PublicLanguagePicker.vue +58 -0
- package/src/components/public/PublicLinkPage.vue +286 -0
- package/src/components/public/PublicLinkPreview.vue +85 -0
- package/src/components/public/PublicPinGate.vue +108 -0
- package/src/components/public/PublicRequestBody.vue +204 -0
- package/src/components/public/PublicShareBody.vue +188 -0
- package/src/components/public/PublicShell.vue +332 -0
- package/src/composables/useConnections.ts +8 -2
- package/src/composables/useFileApi.ts +183 -44
- package/src/composables/useLocale.ts +277 -41
- package/src/composables/useNFSExports.ts +8 -10
- package/src/composables/useOperations.ts +44 -3
- package/src/composables/usePendingOps.ts +59 -8
- package/src/composables/usePluginActions.ts +121 -0
- package/src/composables/usePluginSurface.ts +223 -0
- package/src/composables/usePublicBranding.ts +172 -0
- package/src/composables/usePublicLink.ts +573 -0
- package/src/composables/usePublicPage.ts +61 -0
- package/src/composables/useS3Keys.ts +17 -12
- package/src/composables/useSSHKeys.ts +8 -10
- package/src/composables/useTokens.ts +8 -12
- package/src/composables/useUploadChunked.ts +18 -8
- package/src/composables/useViewerFetch.ts +6 -3
- package/src/index.ts +404 -8
- package/src/lib/actionIcons.ts +46 -1
- package/src/lib/advSearch.ts +14 -7
- package/src/lib/appLock.ts +130 -0
- package/src/lib/connection.ts +110 -0
- package/src/lib/destinationTree.ts +19 -3
- package/src/lib/direction.ts +353 -0
- package/src/lib/dragGhost.ts +6 -0
- package/src/lib/dropLimits.ts +69 -0
- package/src/lib/errorWords.ts +394 -0
- package/src/lib/externalReach.ts +5 -1
- package/src/lib/fileFilters.ts +7 -2
- package/src/lib/fileIcons.ts +4 -0
- package/src/lib/internalPaths.ts +77 -0
- package/src/lib/listInput.ts +64 -0
- package/src/lib/listing.ts +58 -23
- package/src/lib/modalStack.ts +26 -0
- package/src/lib/nodeRow.ts +121 -0
- package/src/lib/pdfFieldRules.ts +126 -0
- package/src/lib/pdfFields.ts +589 -0
- package/src/lib/pdfFieldsGeom.ts +203 -0
- package/src/lib/pdfjsLoader.ts +51 -0
- package/src/lib/personName.ts +47 -0
- package/src/lib/pluginApplies.ts +123 -0
- package/src/lib/pluginLabel.ts +72 -0
- package/src/lib/pluginMenu.ts +253 -0
- package/src/lib/pluginPage.ts +58 -0
- package/src/lib/plural.ts +181 -0
- package/src/lib/popupLayer.ts +103 -0
- package/src/lib/prefs.ts +563 -0
- package/src/lib/productVersion.ts +35 -0
- package/src/lib/publicLayout.ts +39 -0
- package/src/lib/serviceGate.ts +104 -0
- package/src/lib/shareTtl.ts +25 -11
- package/src/lib/signFonts.ts +85 -0
- package/src/lib/signaturePad.ts +111 -0
- package/src/lib/sortOrder.ts +100 -38
- package/src/lib/star.ts +7 -1
- package/src/lib/surfaceCell.ts +41 -0
- package/src/lib/surfaceConditions.ts +156 -0
- package/src/lib/surfaceOpen.ts +106 -0
- package/src/lib/surfaceSteps.ts +68 -0
- package/src/lib/surfaceValues.ts +191 -0
- package/src/lib/symlink.ts +150 -0
- package/src/lib/tableColumns.ts +493 -0
- package/src/lib/tableEnv.ts +34 -0
- package/src/lib/tablePrefs.ts +84 -0
- package/src/lib/tags.ts +121 -12
- package/src/lib/themes.ts +286 -18
- package/src/lib/tour.ts +152 -0
- package/src/lib/trashEmpty.ts +111 -0
- package/src/lib/trashTimeLeft.ts +23 -0
- package/src/lib/uiLocales.ts +460 -0
- package/src/lib/viewPrefs.ts +696 -660
- package/src/lib/viewPrefsHttp.ts +78 -0
- package/src/locales/en.ts +522 -119
- package/src/locales/resolve.ts +17 -8
- package/src/locales/tr.ts +539 -155
- package/src/modals/ConvertModal.vue +62 -11
- package/src/modals/DestinationPickerModal.vue +59 -16
- package/src/modals/Modal.vue +113 -23
- package/src/modals/NewDocumentModal.vue +16 -6
- package/src/modals/NewFolderModal.vue +8 -0
- package/src/modals/PermissionsModal.vue +272 -163
- package/src/modals/PreviewModal.vue +119 -20
- package/src/modals/RenameModal.vue +37 -1
- package/src/styles/base.css +2895 -241
- package/src/styles/sign-fonts.css +118 -0
- package/src/styles/variables.css +60 -0
- package/src/types/Connections.ts +17 -0
- package/src/types/ExplorerConfig.ts +117 -1
- package/src/types/FileNode.ts +58 -0
- package/src/types/Plugins.ts +494 -0
- package/src/types/Public.ts +212 -0
- package/src/viewers/ArchiveViewer.vue +93 -48
- package/src/viewers/CsvViewer.vue +99 -53
- package/src/viewers/DrawioViewer.vue +35 -9
- package/src/viewers/EpubViewer.vue +7 -8
- package/src/viewers/IpynbViewer.vue +3 -1
- package/src/viewers/MermaidViewer.vue +4 -5
- package/src/viewers/PdfViewer.vue +8 -17
- package/src/viewers/PsdViewer.vue +2 -4
- package/src/viewers/TiffViewer.vue +4 -5
- package/src/viewers/Viewer3D.vue +1 -1
- package/LICENSE +0 -21
- package/dist/ArchiveViewer-CLNevfPE.js +0 -124
- package/dist/ArchiveViewer-CLNevfPE.js.map +0 -1
- package/dist/CsvViewer-K8XA3z7N.js +0 -141
- package/dist/CsvViewer-K8XA3z7N.js.map +0 -1
- package/dist/DrawioViewer-BuhZOAx6.js.map +0 -1
- package/dist/EpubViewer-DS3mb3k8.js.map +0 -1
- package/dist/IpynbViewer-BTk7p4Dn.js +0 -184
- package/dist/IpynbViewer-BTk7p4Dn.js.map +0 -1
- package/dist/MermaidViewer-DqucH_io.js +0 -137
- package/dist/MermaidViewer-DqucH_io.js.map +0 -1
- package/dist/PsdViewer-CwiVENmq.js +0 -122
- package/dist/PsdViewer-CwiVENmq.js.map +0 -1
- package/dist/TiffViewer-CpewSVmQ.js +0 -142
- package/dist/TiffViewer-CpewSVmQ.js.map +0 -1
- package/dist/Viewer3D-CIrOn63I.js.map +0 -1
- package/dist/index-Dx0IbBcI.js +0 -26831
- package/dist/index-Dx0IbBcI.js.map +0 -1
- package/dist/useViewerFetch-czqbd2Lj.js +0 -25
- package/dist/useViewerFetch-czqbd2Lj.js.map +0 -1
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2014 The Caveat Project Authors (https://github.com/googlefonts/caveat)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Signing fonts — self-hosted, no CDN
|
|
2
|
+
|
|
3
|
+
The five typefaces a `pdf-fields` text field and a `signature-pad` "type"
|
|
4
|
+
signature may be written in (docs/APP-PLUGINS-API.md → `pdf-fields` props).
|
|
5
|
+
|
|
6
|
+
⚠⚠ **Nothing here is fetched from a CDN at runtime.** A signature screen is
|
|
7
|
+
the one place in filex where a third party would learn, from the mere request
|
|
8
|
+
for a font file, that somebody is signing a document — and an air-gapped
|
|
9
|
+
install would simply render the signature in the wrong face. The `@font-face`
|
|
10
|
+
rules live in `packages/core/src/styles/sign-fonts.css`, which points at the
|
|
11
|
+
`.woff2` files in this folder; the bundler emits them next to `style.css`, so
|
|
12
|
+
every host of `@brftech/filex-core` (the admin SPA, fm.example.com, the desktop
|
|
13
|
+
app, the work.example.com / fishapp embeds) gets the same five faces without any
|
|
14
|
+
host-side wiring.
|
|
15
|
+
|
|
16
|
+
⚠ The browser fetches a `.woff2` only when text is actually drawn in it
|
|
17
|
+
(`@font-face` + `unicode-range` are lazy), so the folder costs nothing until
|
|
18
|
+
somebody opens a signing screen.
|
|
19
|
+
|
|
20
|
+
| Key (wire `font`) | Family | Kind | Subsets shipped | Licence |
|
|
21
|
+
|---|---|---|---|---|
|
|
22
|
+
| `caveat` | Caveat | handwriting | latin, latin-ext | OFL 1.1 |
|
|
23
|
+
| `dancing-script` | Dancing Script | handwriting | latin, latin-ext | OFL 1.1 |
|
|
24
|
+
| `homemade-apple` | Homemade Apple | handwriting | latin ⚠ | Apache 2.0 |
|
|
25
|
+
| `inter` | the interface face (`--fe-font`) | formal | — (no file) | — |
|
|
26
|
+
| `source-serif` | Source Serif 4 | formal | latin, latin-ext | OFL 1.1 |
|
|
27
|
+
|
|
28
|
+
⚠ **Homemade Apple ships latin only** — upstream publishes no latin-ext
|
|
29
|
+
subset, so `ş ğ İ` in a Turkish name fall back to the interface face inside
|
|
30
|
+
that one signature. It is listed anyway because it is the most
|
|
31
|
+
handwriting-looking of the three; `caveat` and `dancing-script` carry the full
|
|
32
|
+
Turkish alphabet and are the ones to prefer for a Turkish signer.
|
|
33
|
+
|
|
34
|
+
⚠ `inter` is deliberately **not** a file: `--fe-font` is already
|
|
35
|
+
`Inter, system-ui, …`, so the "formal, matches the rest of the app" choice is
|
|
36
|
+
the app's own face and follows an operator who rebrands it.
|
|
37
|
+
|
|
38
|
+
## Copyright
|
|
39
|
+
|
|
40
|
+
- Caveat — Copyright 2014 The Caveat Project Authors
|
|
41
|
+
(https://github.com/googlefonts/caveat)
|
|
42
|
+
- Dancing Script — Copyright 2016 The Dancing Script Project Authors
|
|
43
|
+
(https://github.com/googlefonts/DancingScript), with Reserved Font Name
|
|
44
|
+
'Dancing Script'
|
|
45
|
+
- Source Serif 4 — Copyright 2014 The Source Serif 4 Project Authors
|
|
46
|
+
(https://github.com/adobe-fonts/source-serif)
|
|
47
|
+
- Homemade Apple — Copyright (c) 2010 by Font Diner, Inc. All rights reserved.
|
|
48
|
+
|
|
49
|
+
`LICENSE-OFL-1.1.txt` covers the first three, `LICENSE-Apache-2.0.txt` the
|
|
50
|
+
fourth.
|
|
51
|
+
|
|
52
|
+
## Refreshing them
|
|
53
|
+
|
|
54
|
+
The `.woff2` files are the subsets Google Fonts serves (`css2?family=…`, a
|
|
55
|
+
desktop Chrome user agent, `latin` + `latin-ext` blocks). To refresh, fetch
|
|
56
|
+
the stylesheet for the family, take the `src: url(…)` of those two blocks and
|
|
57
|
+
save them here under the same names — then check the `unicode-range` values in
|
|
58
|
+
`sign-fonts.css` still match what the stylesheet declares.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -74,6 +74,8 @@ import type { LocaleCode } from '../types/ExplorerConfig';
|
|
|
74
74
|
import { useLocale } from '../composables/useLocale';
|
|
75
75
|
import Modal from '../modals/Modal.vue';
|
|
76
76
|
import { actionIconSvg } from '../lib/actionIcons';
|
|
77
|
+
import { tagKey, type TagItem, type TagKind } from '../lib/tags';
|
|
78
|
+
import TagKindIcon from './TagKindIcon.vue';
|
|
77
79
|
import {
|
|
78
80
|
EMPTY_FILTERS,
|
|
79
81
|
type AroundSpan,
|
|
@@ -129,6 +131,14 @@ const props = defineProps<{
|
|
|
129
131
|
/** Runs the real query and returns what it found. Owned by the explorer,
|
|
130
132
|
* which is the only thing holding the API client. */
|
|
131
133
|
count: (req: AdvSearchRequest) => Promise<AdvCountResult>;
|
|
134
|
+
/**
|
|
135
|
+
* etiket:k2 (v0.43) — the tags the person can see, with their kind, offered
|
|
136
|
+
* under the Tags box as one-click picks. The filter itself does not take a
|
|
137
|
+
* kind (`tag:x` matches your personal x and your team's x alike — both are
|
|
138
|
+
* yours to search), but a tag on screen always says which kind it is, here
|
|
139
|
+
* as everywhere else. Optional: an embed that passes none gets the box only.
|
|
140
|
+
*/
|
|
141
|
+
knownTags?: TagItem[];
|
|
132
142
|
}>();
|
|
133
143
|
|
|
134
144
|
const emit = defineEmits<{
|
|
@@ -156,6 +166,20 @@ const queryEl = ref<HTMLInputElement | null>(null);
|
|
|
156
166
|
const text = ref('');
|
|
157
167
|
const scope = ref<AdvScope>('name');
|
|
158
168
|
const tagsRaw = ref('');
|
|
169
|
+
|
|
170
|
+
/** The known tags, Personal then Team, for the picks under the Tags box. */
|
|
171
|
+
const knownTagGroups = computed(() =>
|
|
172
|
+
(['personal', 'team'] as TagKind[])
|
|
173
|
+
.map((kind) => ({ kind, list: (props.knownTags ?? []).filter((tag) => tag.kind === kind) }))
|
|
174
|
+
.filter((g) => g.list.length > 0),
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
/** A pick appends its name to the box, once (by the server's sameness). */
|
|
178
|
+
function pickTag(name: string) {
|
|
179
|
+
const current = parseTagList(tagsRaw.value);
|
|
180
|
+
if (current.some((c) => tagKey(c) === tagKey(name))) return;
|
|
181
|
+
tagsRaw.value = [...current, name].join(', ');
|
|
182
|
+
}
|
|
159
183
|
const excludeRaw = ref('');
|
|
160
184
|
const type = ref<TypeFilter>('any');
|
|
161
185
|
const modified = ref<ModifiedFilter>('any');
|
|
@@ -731,6 +755,31 @@ function submit() {
|
|
|
731
755
|
/>
|
|
732
756
|
</label>
|
|
733
757
|
<p class="fe-advsearch__hint fe-advsearch__hint--block">{{ t('advsearch.tags.hint') }}</p>
|
|
758
|
+
<div
|
|
759
|
+
v-if="knownTagGroups.length"
|
|
760
|
+
class="fe-advsearch__tagpicks"
|
|
761
|
+
data-testid="advsearch-known-tags"
|
|
762
|
+
>
|
|
763
|
+
<template v-for="g in knownTagGroups" :key="g.kind">
|
|
764
|
+
<span class="fe-advsearch__tagkind">
|
|
765
|
+
<TagKindIcon :kind="g.kind" />
|
|
766
|
+
{{ t(`tags.kind.${g.kind}`) }}
|
|
767
|
+
</span>
|
|
768
|
+
<button
|
|
769
|
+
v-for="tag in g.list"
|
|
770
|
+
:key="`${g.kind}:${tag.name}`"
|
|
771
|
+
type="button"
|
|
772
|
+
class="fe-advsearch__tagpick"
|
|
773
|
+
:data-tag-kind="g.kind"
|
|
774
|
+
:title="t(`tags.chip.${g.kind}`, { tag: tag.name })"
|
|
775
|
+
:aria-label="t(`tags.chip.${g.kind}`, { tag: tag.name })"
|
|
776
|
+
@click="pickTag(tag.name)"
|
|
777
|
+
>
|
|
778
|
+
<TagKindIcon :kind="g.kind" />
|
|
779
|
+
{{ tag.name }}
|
|
780
|
+
</button>
|
|
781
|
+
</template>
|
|
782
|
+
</div>
|
|
734
783
|
</div>
|
|
735
784
|
</div>
|
|
736
785
|
|
|
@@ -386,7 +386,7 @@ function cancelEdit() {
|
|
|
386
386
|
</script>
|
|
387
387
|
|
|
388
388
|
<template>
|
|
389
|
-
<nav class="fe-breadcrumb" aria-label="
|
|
389
|
+
<nav class="fe-breadcrumb" :aria-label="t('breadcrumb.aria')">
|
|
390
390
|
<template v-if="!editing">
|
|
391
391
|
<!-- gorunum:v2-topbar — the root crumb. It IS `crumbs[0]` (see the
|
|
392
392
|
script), drawn as a house instead of a "/" nobody reads as a
|
|
@@ -447,7 +447,7 @@ function cancelEdit() {
|
|
|
447
447
|
@dragover="onCrumbDragOver"
|
|
448
448
|
@drop="onCrumbDrop($event, c)"
|
|
449
449
|
>
|
|
450
|
-
<span>{{ c.label }}</span>
|
|
450
|
+
<span><bdi>{{ c.label }}</bdi></span>
|
|
451
451
|
<span v-if="collapsed || i < leadCrumbs.length - 1" class="fe-breadcrumb__sep" aria-hidden="true">›</span>
|
|
452
452
|
</button>
|
|
453
453
|
<span v-if="middleCrumbs.length" ref="moreWrapEl" class="fe-breadcrumb__more-wrap">
|
|
@@ -469,7 +469,7 @@ function cancelEdit() {
|
|
|
469
469
|
class="fe-breadcrumb__menu-item"
|
|
470
470
|
role="menuitem"
|
|
471
471
|
@click="onOverflowPick(c)"
|
|
472
|
-
>{{ c.label }}</button>
|
|
472
|
+
><bdi>{{ c.label }}</bdi></button>
|
|
473
473
|
</div>
|
|
474
474
|
</span>
|
|
475
475
|
<button
|
|
@@ -484,7 +484,7 @@ function cancelEdit() {
|
|
|
484
484
|
@dragover="onCrumbDragOver"
|
|
485
485
|
@drop="onCrumbDrop($event, c)"
|
|
486
486
|
>
|
|
487
|
-
<span>{{ c.label }}</span>
|
|
487
|
+
<span><bdi>{{ c.label }}</bdi></span>
|
|
488
488
|
<span v-if="i < tailCrumbs.length - 1" class="fe-breadcrumb__sep" aria-hidden="true">›</span>
|
|
489
489
|
</button>
|
|
490
490
|
<!-- gorunum:v2-topbar — "Subfolders": the chevron the reference shell
|
|
@@ -513,7 +513,7 @@ function cancelEdit() {
|
|
|
513
513
|
class="fe-breadcrumb__menu-item"
|
|
514
514
|
role="menuitem"
|
|
515
515
|
@click="onOverflowPick(c)"
|
|
516
|
-
>{{ c.label }}</button>
|
|
516
|
+
><bdi>{{ c.label }}</bdi></button>
|
|
517
517
|
<p v-if="!subfolders.length" class="fe-breadcrumb__menu-empty">
|
|
518
518
|
{{ t('breadcrumb.subfolders.empty') }}
|
|
519
519
|
</p>
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* ChoiceButtons — a choice the person can READ without clicking.
|
|
4
|
+
*
|
|
5
|
+
* ⚠⚠ This is the replacement for `<select>` in every plugin surface (v3
|
|
6
|
+
* §2): "no dropdowns anywhere in a surface". A dropdown hides its options
|
|
7
|
+
* until it is opened, so a wizard step asking "where does the signed
|
|
8
|
+
* document go?" showed one answer and concealed the other two — and the one
|
|
9
|
+
* it showed could contradict a field sitting right above it. Buttons put
|
|
10
|
+
* every option on the step, which is also why the renderer enforces this
|
|
11
|
+
* rather than each plugin choosing.
|
|
12
|
+
*
|
|
13
|
+
* One control, two behaviours, because they are the same question asked
|
|
14
|
+
* once or several times:
|
|
15
|
+
* - single (`multi: false`) — radio semantics: `role="radiogroup"`,
|
|
16
|
+
* arrow keys move the choice, exactly one is `aria-checked`;
|
|
17
|
+
* - several (`multi: true`) — toggle semantics: `role="group"`, each
|
|
18
|
+
* button its own `aria-pressed`, the value is a list.
|
|
19
|
+
*
|
|
20
|
+
* ⚠ Not "a nicer select". A `<select>` is still the right control for a
|
|
21
|
+
* long list (a time zone, a country), and this one is deliberately bad at
|
|
22
|
+
* that — it draws every option. The rule it serves is about SURFACES, where
|
|
23
|
+
* a choice has two to six answers and the person is being asked to decide.
|
|
24
|
+
*/
|
|
25
|
+
import { computed } from 'vue';
|
|
26
|
+
import { dirOfElement, inlineKeyStep } from '../lib/direction';
|
|
27
|
+
|
|
28
|
+
export interface ChoiceOption {
|
|
29
|
+
value: string;
|
|
30
|
+
label: string;
|
|
31
|
+
/** A second line under the label — what choosing this one means. */
|
|
32
|
+
help?: string;
|
|
33
|
+
/** This one answer is not available (the others are). The button stays on
|
|
34
|
+
* screen — a choice that vanishes cannot tell the person it exists — and
|
|
35
|
+
* `help` is where to say why. The tag picker's "Team" for a viewer is the
|
|
36
|
+
* first user. */
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const props = defineProps<{
|
|
41
|
+
options: ChoiceOption[];
|
|
42
|
+
/** A string (single) or a list of strings (several). */
|
|
43
|
+
modelValue: string | string[] | null | undefined;
|
|
44
|
+
multi?: boolean;
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
invalid?: boolean;
|
|
47
|
+
/** Ties the group to its own label for a screen reader. */
|
|
48
|
+
ariaLabelledby?: string;
|
|
49
|
+
ariaLabel?: string;
|
|
50
|
+
/** `surface-choice` → `data-testid="surface-choice-<value>"`. */
|
|
51
|
+
testidPrefix?: string;
|
|
52
|
+
}>();
|
|
53
|
+
|
|
54
|
+
const emit = defineEmits<{
|
|
55
|
+
(e: 'update:modelValue', v: string | string[]): void;
|
|
56
|
+
}>();
|
|
57
|
+
|
|
58
|
+
const picked = computed<string[]>(() => {
|
|
59
|
+
const v = props.modelValue;
|
|
60
|
+
if (Array.isArray(v)) return v.map((x) => String(x));
|
|
61
|
+
if (v === undefined || v === null || v === '') return [];
|
|
62
|
+
return [String(v)];
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
function isOn(value: string): boolean {
|
|
66
|
+
return picked.value.includes(value);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function optionOff(value: string): boolean {
|
|
70
|
+
return !!props.disabled || !!props.options.find((o) => o.value === value)?.disabled;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function choose(value: string): void {
|
|
74
|
+
if (optionOff(value)) return;
|
|
75
|
+
if (props.multi) {
|
|
76
|
+
const next = isOn(value) ? picked.value.filter((v) => v !== value) : [...picked.value, value];
|
|
77
|
+
// ⚠ The order the OPTIONS are declared in, not the order they were
|
|
78
|
+
// clicked in: a plugin that renders the answer back reads a stable list,
|
|
79
|
+
// and two people who picked the same two options send the same value.
|
|
80
|
+
const order = props.options.map((o) => o.value);
|
|
81
|
+
emit('update:modelValue', order.filter((v) => next.includes(v)));
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
emit('update:modelValue', value);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Arrow keys, for the single case only.
|
|
89
|
+
*
|
|
90
|
+
* A radio group is ONE tab stop: Tab reaches it, the arrows move inside it.
|
|
91
|
+
* With `multi` each button is its own control and the browser's own Tab
|
|
92
|
+
* order is already right, so nothing is intercepted there.
|
|
93
|
+
*/
|
|
94
|
+
function onKey(e: KeyboardEvent, index: number): void {
|
|
95
|
+
if (props.multi || props.disabled) return;
|
|
96
|
+
const keys = ['ArrowRight', 'ArrowDown', 'ArrowLeft', 'ArrowUp'];
|
|
97
|
+
if (!keys.includes(e.key)) return;
|
|
98
|
+
e.preventDefault();
|
|
99
|
+
// ⚠ RTL: ← / → move the way they point — in a right-to-left row the NEXT
|
|
100
|
+
// option is to the left (lib/direction, read from where the group is drawn).
|
|
101
|
+
const step =
|
|
102
|
+
e.key === 'ArrowDown' ? 1 : e.key === 'ArrowUp' ? -1 : inlineKeyStep(e.key, dirOfElement(e.currentTarget as Element));
|
|
103
|
+
const n = props.options.length;
|
|
104
|
+
if (!n) return;
|
|
105
|
+
const next = props.options[(index + step + n) % n];
|
|
106
|
+
if (next.disabled) return;
|
|
107
|
+
choose(next.value);
|
|
108
|
+
const el = e.currentTarget as HTMLElement;
|
|
109
|
+
const group = el.parentElement;
|
|
110
|
+
const buttons = group?.querySelectorAll<HTMLElement>('[data-choice]');
|
|
111
|
+
buttons?.[(index + step + n) % n]?.focus();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** The tab stop of a radio group: the chosen one, or the first. */
|
|
115
|
+
function tabIndexOf(value: string, index: number): number {
|
|
116
|
+
if (props.multi) return 0;
|
|
117
|
+
if (picked.value.length) return isOn(value) ? 0 : -1;
|
|
118
|
+
return index === 0 ? 0 : -1;
|
|
119
|
+
}
|
|
120
|
+
</script>
|
|
121
|
+
|
|
122
|
+
<template>
|
|
123
|
+
<div
|
|
124
|
+
class="fe-choice"
|
|
125
|
+
:class="{ 'is-invalid': invalid, 'is-disabled': disabled }"
|
|
126
|
+
:role="multi ? 'group' : 'radiogroup'"
|
|
127
|
+
:aria-labelledby="ariaLabelledby"
|
|
128
|
+
:aria-label="ariaLabel"
|
|
129
|
+
data-testid="choice-buttons"
|
|
130
|
+
>
|
|
131
|
+
<button
|
|
132
|
+
v-for="(o, i) in options"
|
|
133
|
+
:key="o.value"
|
|
134
|
+
type="button"
|
|
135
|
+
data-choice
|
|
136
|
+
class="fe-choice__btn"
|
|
137
|
+
:class="{ 'is-on': isOn(o.value) }"
|
|
138
|
+
:role="multi ? undefined : 'radio'"
|
|
139
|
+
:aria-checked="multi ? undefined : isOn(o.value) ? 'true' : 'false'"
|
|
140
|
+
:aria-pressed="multi ? (isOn(o.value) ? 'true' : 'false') : undefined"
|
|
141
|
+
:tabindex="tabIndexOf(o.value, i)"
|
|
142
|
+
:disabled="disabled || o.disabled"
|
|
143
|
+
:data-testid="testidPrefix ? `${testidPrefix}-${o.value}` : undefined"
|
|
144
|
+
@click="choose(o.value)"
|
|
145
|
+
@keydown="onKey($event, i)"
|
|
146
|
+
>
|
|
147
|
+
<span class="fe-choice__label">{{ o.label }}</span>
|
|
148
|
+
<span v-if="o.help" class="fe-choice__help">{{ o.help }}</span>
|
|
149
|
+
</button>
|
|
150
|
+
</div>
|
|
151
|
+
</template>
|
|
152
|
+
|