false,
+ },
},
emits: [
"update:selection",
@@ -249,6 +257,23 @@ export default {
{ immediate: true }
);
+ const onDrop = (data, event) => {
+ if (props.canDragOverRow(data)) {
+ emit("row-drop", { data, event });
+ dragOveredRowKey.value = null;
+ }
+ };
+ const dragOveredRowKey = ref(null);
+ const onDragover = (key, data, event) => {
+ if (props.canDragOverRow(data)) {
+ event.preventDefault();
+ dragOveredRowKey.value = key;
+ }
+ };
+ const onDragleave = () => {
+ dragOveredRowKey.value = null;
+ };
+
return {
// References
computedRows,
@@ -257,7 +282,11 @@ export default {
pageIndexEnd,
pageIndexStart,
rowSelection,
+ dragOveredRowKey,
// Methods
+ onDrop,
+ onDragover,
+ onDragleave,
toggleAll,
toggleRow,
};
diff --git a/src/BIMDataSmartComponents/BIMDataFileManager/BIMDataFileManager.scss b/src/BIMDataSmartComponents/BIMDataFileManager/BIMDataFileManager.scss
index 2d152a20..9eb16695 100644
--- a/src/BIMDataSmartComponents/BIMDataFileManager/BIMDataFileManager.scss
+++ b/src/BIMDataSmartComponents/BIMDataFileManager/BIMDataFileManager.scss
@@ -68,6 +68,14 @@
}
}
+ &__pdf-page-selector {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ }
+
&__modal {
position: absolute;
top: 0px;
diff --git a/src/BIMDataSmartComponents/BIMDataFileManager/BIMDataFileManager.vue b/src/BIMDataSmartComponents/BIMDataFileManager/BIMDataFileManager.vue
index c91dfe3f..a468b123 100644
--- a/src/BIMDataSmartComponents/BIMDataFileManager/BIMDataFileManager.vue
+++ b/src/BIMDataSmartComponents/BIMDataFileManager/BIMDataFileManager.vue
@@ -119,6 +119,7 @@
@loaded="onFileLoaded(file, $event)"
:writeAccess="currentFolder.user_permission >= 100"
:viewPdf="viewPdf"
+ :pdfModelLoading="pdfModelLoading === file.id"
/>
@@ -130,6 +131,16 @@
+
selectedFile !== file
+ ({ document }) => document !== file
);
} else {
if (!this.multi) {
this.selectedFiles = [];
}
- this.selectedFiles.push(file);
+
+ let pdfPage = null;
+ if (this.pdfPageSelect && file.model_type === "PDF") {
+ // If 'pdfPageSelect' mode is on and the selected file is a PDF model
+ // fetch the corresponding model to check its children (pages)
+ this.pdfModelLoading = file.id;
+ const model = await this.apiClient.modelApi.getModel(
+ this.spaceId,
+ file.model_id,
+ this.projectId
+ );
+ this.pdfModelLoading = null;
+ if (model.children?.length > 0) {
+ // If this is a multipage PDF open the page selector
+ this.pdfModel = model;
+ this.pdfPageSelectorDisplayed = true;
+ pdfPage = await new Promise(res => (this.selectPdfPage = res));
+ this.pdfPageSelectorDisplayed = false;
+ this.pdfModel = null;
+ if (!pdfPage) return; // If no page has been selected then the file is not selected
+ }
+ }
+
+ this.selectedFiles.push({ document: file, pdfPage });
}
this.$emit("selection-change", this.selectedFiles);
},
isFileSelected(file) {
- return this.selectedFiles.includes(file);
+ return this.selectedFiles.some(({ document }) => file === document);
},
onBreadcrumClick(step) {
this.currentFolder = step;
diff --git a/src/BIMDataSmartComponents/BIMDataFileManager/components/FileCard.vue b/src/BIMDataSmartComponents/BIMDataFileManager/components/FileCard.vue
index cca78351..0fb5e93c 100644
--- a/src/BIMDataSmartComponents/BIMDataFileManager/components/FileCard.vue
+++ b/src/BIMDataSmartComponents/BIMDataFileManager/components/FileCard.vue
@@ -36,19 +36,24 @@
-
-
+
+
+
+
+
+
+
@@ -126,6 +131,7 @@ import BIMDataIcon from "../../../BIMDataComponents/BIMDataIcon/BIMDataIcon.vue"
import BIMDataRadio from "../../../BIMDataComponents/BIMDataRadio/BIMDataRadio.vue";
import BIMDataCheckbox from "../../../BIMDataComponents/BIMDataCheckbox/BIMDataCheckbox.vue";
import BIMDataFileIcon from "../../../BIMDataComponents/BIMDataFileIcon/BIMDataFileIcon.vue";
+import BIMDataSpinner from "../../../BIMDataComponents/BIMDataSpinner/BIMDataSpinner.vue";
import clickaway from "../../../BIMDataDirectives/click-away.js";
import PieProgressSpinner from "./PieProgressSpinner.vue";
@@ -138,6 +144,7 @@ export default {
BIMDataRadio,
BIMDataCheckbox,
BIMDataFileIcon,
+ BIMDataSpinner,
PieProgressSpinner,
MultiLineTextBox,
},
@@ -196,6 +203,10 @@ export default {
type: Boolean,
default: false,
},
+ pdfModelLoading: {
+ type: Boolean,
+ default: false,
+ },
},
emits: [
"rename",
diff --git a/src/BIMDataSmartComponents/BIMDataFileManager/components/PdfPageSelector.vue b/src/BIMDataSmartComponents/BIMDataFileManager/components/PdfPageSelector.vue
new file mode 100644
index 00000000..9225b157
--- /dev/null
+++ b/src/BIMDataSmartComponents/BIMDataFileManager/components/PdfPageSelector.vue
@@ -0,0 +1,161 @@
+
+
+
+
+
+
+ {{ $translate("back") }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ page.page_number }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BIMDataSmartComponents/BIMDataFileManager/i18n.js b/src/BIMDataSmartComponents/BIMDataFileManager/i18n.js
index 7c8dc01d..ab2564b3 100644
--- a/src/BIMDataSmartComponents/BIMDataFileManager/i18n.js
+++ b/src/BIMDataSmartComponents/BIMDataFileManager/i18n.js
@@ -22,6 +22,9 @@ const en = {
deleteDetail:
"You are about to permanently delete the following files / folders",
dmsRoot: "Root of the project's DMS",
+ validate: "Validate",
+ back: "Back",
+ pdfPageSelectorTitle: "Select a page",
};
const fr = {
@@ -48,6 +51,9 @@ const fr = {
deleteDetail:
"Vous êtes sur le point de supprimer définitivement les fichiers/dossiers suivants",
dmsRoot: "Racine de la GED du projet",
+ validate: "Valider",
+ back: "Retour",
+ pdfPageSelectorTitle: "Sélectionner une page",
};
const es = {
diff --git a/src/assets/scss/elements/_BIMDataScrollbar.scss b/src/assets/scss/elements/_BIMDataScrollbar.scss
index 7c25cc5f..27c38ddc 100644
--- a/src/assets/scss/elements/_BIMDataScrollbar.scss
+++ b/src/assets/scss/elements/_BIMDataScrollbar.scss
@@ -1,22 +1,24 @@
/* custom SCROLLBAR ------------------------ */
-/* width */
-::-webkit-scrollbar {
- width: 7px;
- height: 7px;
-}
+.bimdata-scrollbar {
+ /* width */
+ ::-webkit-scrollbar {
+ width: 7px;
+ height: 7px;
+ }
-/* Track */
-::-webkit-scrollbar-track {
- background-color: var(--color-silver);
-}
+ /* Track */
+ ::-webkit-scrollbar-track {
+ background-color: var(--color-silver);
+ }
-/* Handle */
-::-webkit-scrollbar-thumb {
- background: var(--color-primary);
- height: 48px;
-}
+ /* Handle */
+ ::-webkit-scrollbar-thumb {
+ background: var(--color-primary);
+ height: 48px;
+ }
-/* Handle on hover */
-::-webkit-scrollbar-thumb:hover {
- background: var(--color-granite-light);
+ /* Handle on hover */
+ ::-webkit-scrollbar-thumb:hover {
+ background: var(--color-granite-light);
+ }
}
diff --git a/src/web/App.vue b/src/web/App.vue
index 66a447a1..03e003e9 100644
--- a/src/web/App.vue
+++ b/src/web/App.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/src/web/views/Components/Checkbox/Checkbox.vue b/src/web/views/Components/Checkbox/Checkbox.vue
index ebdbb985..00e63df9 100644
--- a/src/web/views/Components/Checkbox/Checkbox.vue
+++ b/src/web/views/Components/Checkbox/Checkbox.vue
@@ -32,7 +32,7 @@
<BIMDataCheckbox
:disabled="{{ getCheckboxDisabled() }}"
- ext="Your label here"
+ text="Your label here"
v-model="checked"
/>
diff --git a/src/web/views/Components/DropdownList/DropdownList.vue b/src/web/views/Components/DropdownList/DropdownList.vue
index 1c5d3b50..3143c812 100644
--- a/src/web/views/Components/DropdownList/DropdownList.vue
+++ b/src/web/views/Components/DropdownList/DropdownList.vue
@@ -17,11 +17,15 @@
:loading="checkboxLoadingChecked"
:closeOnElementClick="checkboxCloseOnElementClickChecked"
@element-click="onItemClick"
+ :search="checkboxSearchChecked"
>
{{ item }}
dropdown list example
+
+ No result
+
hi
@@ -46,23 +50,29 @@
>
+
+
@@ -113,10 +124,18 @@
:list="list"
:perPage="{{ numberInput }}"
elementKey="dropdown"
- :disabled="{{ checkboxDisabledChecked }}"
- :closeOnElementClick="{{ checkboxCloseOnElementClickChecked }}"
+ {{ checkboxLoadingChecked ? ':loading="true"' : "" }}
+ {{ checkboxDisabledChecked ? ':disabled="true"' : "" }}
+ {{
+ checkboxCloseOnElementClickChecked
+ ? ':closeOnElementClick="true"'
+ : ""
+ }}
+ {{ checkboxSearchChecked ? ':search="true"' : "" }}
>
- {{ getHeader() }} {{ getContentAfterBtn() }} {{ getElement() }}
+ {{ getHeader() }} {{ getContentAfterBtn() }} {{ getElement() }} {{
+ getEmpty()
+ }}
</BIMDataDropdownList>
@@ -175,9 +194,11 @@ export default {
checkboxDisabledChecked: false,
checkboxLoadingChecked: false,
checkboxCloseOnElementClickChecked: false,
+ checkboxSearchChecked: false,
checkboxHeaderChecked: true,
checkboxAfterBtnChecked: false,
checkboxElementChecked: false,
+ checkboxEmptyChecked: false,
customListCheckbox: false,
dropdownOptions: {
transition: ["up", "down"],
@@ -305,6 +326,11 @@ export default {
`;
}
},
+ getEmpty() {
+ if (this.checkboxEmptyChecked) {
+ return "No result";
+ }
+ },
},
};
diff --git a/src/web/views/Components/DropdownMenu/DropdownMenu.vue b/src/web/views/Components/DropdownMenu/DropdownMenu.vue
index 75ae9e67..86617487 100644
--- a/src/web/views/Components/DropdownMenu/DropdownMenu.vue
+++ b/src/web/views/Components/DropdownMenu/DropdownMenu.vue
@@ -14,11 +14,13 @@
:menuItems="checkboxTwoLevelChecked ? multiLevelList : []"
:header="checkboxDisabledHeader"
>
-
+
dropdown menu example
-
-
- hi
+
@@ -102,7 +99,7 @@
:header="{{ getHeaderProp() }}"
{{ getMenuItems() }}
>
- {{ getHeader() }} {{ getContentAfterBtn() }} {{ getElement() }}
+ {{ getHeader() }} {{ getElement() }}
</BIMDataDropdownMenu>
@@ -132,6 +129,7 @@ import BIMDataCheckbox from "../../../../../src/BIMDataComponents/BIMDataCheckbo
import BIMDataRadio from "../../../../../src/BIMDataComponents/BIMDataRadio/BIMDataRadio.vue";
import BIMDataTable from "../../../../../src/BIMDataComponents/BIMDataTable/BIMDataTable.vue";
import BIMDataText from "../../../../../src/BIMDataComponents/BIMDataText/BIMDataText.vue";
+import BIMDataIcon from "../../../../../src/BIMDataComponents/BIMDataIcon/BIMDataIcon.vue";
import BIMDataDropdownMenu from "../../../../../src/BIMDataComponents/BIMDataDropdownMenu/BIMDataDropdownMenu.vue";
export default {
@@ -142,6 +140,7 @@ export default {
BIMDataTable,
BIMDataText,
BIMDataDropdownMenu,
+ BIMDataIcon,
},
data() {
return {
@@ -236,10 +235,9 @@ export default {
],
slotData: [
["Slot name", "Description"],
- ["header", "Use this slot for add content "],
[
- "contentAfterHeader",
- "Use this slot for add content after the header slot",
+ "header",
+ "Use this slot to add title content. Available slot props : isOpen (true when the menu is open)",
],
[
"element",
@@ -251,16 +249,13 @@ export default {
methods: {
getHeader() {
if (this.checkboxHeaderChecked) {
- return `
- dropdown menu example
-
- `;
- }
- },
- getContentAfterBtn() {
- if (this.checkboxAfterHeaderChecked) {
- return `
- hi
+ return `
+ dropdown menu example
+
`;
}
diff --git a/src/web/views/Components/Icons/Icons.vue b/src/web/views/Components/Icons/Icons.vue
index 76c69dd3..dd33c603 100644
--- a/src/web/views/Components/Icons/Icons.vue
+++ b/src/web/views/Components/Icons/Icons.vue
@@ -20,7 +20,7 @@
class="bimdata-search-bar__primary"
placeholder="Search an icon"
v-model="filter"
- width="95%"
+ width="94%"
/>
icons: {{ Object.keys(icons).length }} div {
- // margin: 3px;
padding: var(--spacing-unit);
flex: 14%;
+ flex-grow: 0;
display: flex;
flex-direction: column;
align-items: center;
diff --git a/src/web/views/Components/Menu/BasicMenu.vue b/src/web/views/Components/Menu/BasicMenu.vue
index 8270de4e..e999fc30 100644
--- a/src/web/views/Components/Menu/BasicMenu.vue
+++ b/src/web/views/Components/Menu/BasicMenu.vue
@@ -19,6 +19,30 @@
{{ item.text }}
+
+
+
+
+
+
+ {{ child.data }}
+
+
@@ -39,11 +63,13 @@
{{ formatMenuItem(item) }},
]"
@item-click="itemClick"
+ :childrenLeft="{{isChildrenLeft}}"
>
<template #item="{ item }">
{{ getIcons() }}
<span>{{ "{{ item.text }" + "}" }}</span>
</template>
+ {{getChildren()}}
</BIMDataMenu>
@@ -95,15 +121,17 @@ export default {
if (this.isChildren) {
opts[1] = {
...opts[1],
- children: {
- list: [
- {
- text: "Child item 1",
- action: () => console.log("child clicked"),
- },
- { text: "Child item 2" },
- ],
- },
+ children: [
+ {
+ text: "Child item 1",
+ action: () => console.log("child clicked"),
+ },
+ { text: "Child item 2" },
+ ],
+ };
+ opts[2] = {
+ ...opts[2],
+ children: [{ data: "Item 03 children" }],
};
}
return opts;
@@ -120,6 +148,30 @@ export default {
/>`;
}
},
+ getChildren() {
+ if (this.isChildren) {
+ return `
+
+
+
+
+ {{ child.data }}
+
+
+
+ `;
+ }
+ },
itemClick($event) {
console.log($event);
},
diff --git a/src/web/views/Components/Menu/props-basic-menu.js b/src/web/views/Components/Menu/props-basic-menu.js
index 24e487ba..ac93fe33 100644
--- a/src/web/views/Components/Menu/props-basic-menu.js
+++ b/src/web/views/Components/Menu/props-basic-menu.js
@@ -28,9 +28,9 @@ export default [
"Use this props to custom width of BIMDataMenu component.",
],
[
- "isClickAway",
+ "childrenLeft",
"Boolean",
- "true",
- "If false, the menu component does not close when you click outside.",
+ "false",
+ "If true, the child menu opens to the left of the menu.",
],
];
diff --git a/src/web/views/Components/Menu/slots-basic-menu.js b/src/web/views/Components/Menu/slots-basic-menu.js
index eeb15930..d97b67b9 100644
--- a/src/web/views/Components/Menu/slots-basic-menu.js
+++ b/src/web/views/Components/Menu/slots-basic-menu.js
@@ -3,7 +3,5 @@ export default [
["groupTitle", "Use this slot for custom group title."],
["item", "Use this slot for custom items menu."],
["children", "Use this slot for custom children of menu items."],
- ["child-header", "Use this slot for custom child header."],
- ["child-item", "Use this slot for custom child items."],
- ["child-footer", "Use this slot for custom child footer."],
+ ["child-item", "Use this slot for custom list elements of child items."],
];
diff --git a/src/web/views/Components/Pagination/Pagination.vue b/src/web/views/Components/Pagination/Pagination.vue
index 9d9f3eec..f2327206 100644
--- a/src/web/views/Components/Pagination/Pagination.vue
+++ b/src/web/views/Components/Pagination/Pagination.vue
@@ -7,10 +7,18 @@
+
+ {{ element }}
+
+
+ {{ element.text }}
+
@@ -20,9 +28,20 @@
placeholder="Number of items per page"
type="number"
>
-
+
+ complex pagination
+ basic pagination
+
+
@@ -34,9 +53,11 @@
- <BIMDataPaginatedList :list="paginatedListExample" :perPage="{{
+ <BIMDataPaginatedList :list="paginationList" :perPage="{{
numberInput
- }}"></BIMDataPaginatedList>
+ }}">
+ {{ getPagination() }}
+ </BIMDataPaginatedList>
@@ -66,12 +87,15 @@
+
+
diff --git a/src/web/views/Components/Pagination/option-sets.js b/src/web/views/Components/Pagination/option-sets.js
new file mode 100644
index 00000000..542b69a4
--- /dev/null
+++ b/src/web/views/Components/Pagination/option-sets.js
@@ -0,0 +1,72 @@
+const basicPagination = [
+ "item 01",
+ "item 02",
+ "item 03",
+ "item 04",
+ "item 05",
+ "item 06",
+ "item 07",
+ "item 08",
+ "item 09",
+ "item 10",
+ "item 11",
+ "item 12",
+];
+
+const complexPagination = [
+ { id: 1, text: "item 01" },
+ { id: 2, text: "item 02" },
+ { id: 3, text: "item 03" },
+ { id: 4, text: "item 04" },
+ { id: 5, text: "item 05" },
+ { id: 6, text: "item 06" },
+ { id: 7, text: "item 07" },
+ { id: 8, text: "item 08" },
+ { id: 9, text: "item 09" },
+ { id: 10, text: "item 10" },
+ { id: 11, text: "item 11" },
+ { id: 12, text: "item 12" },
+ { id: 13, text: "item 13" },
+ { id: 14, text: "item 14" },
+ { id: 15, text: "item 15" },
+ { id: 16, text: "item 16" },
+ { id: 17, text: "item 17" },
+ { id: 18, text: "item 18" },
+ { id: 19, text: "item 19" },
+ { id: 20, text: "item 20" },
+ { id: 21, text: "item 21" },
+ { id: 22, text: "item 22" },
+ { id: 23, text: "item 23" },
+ { id: 24, text: "item 24" },
+ { id: 25, text: "item 25" },
+ { id: 26, text: "item 26" },
+ { id: 27, text: "item 27" },
+ { id: 28, text: "item 28" },
+ { id: 29, text: "item 29" },
+ { id: 30, text: "item 30" },
+ { id: 31, text: "item 31" },
+ { id: 32, text: "item 32" },
+ { id: 33, text: "item 33" },
+ { id: 34, text: "item 34" },
+ { id: 35, text: "item 35" },
+ { id: 36, text: "item 36" },
+ { id: 37, text: "item 37" },
+ { id: 38, text: "item 38" },
+ { id: 39, text: "item 39" },
+ { id: 40, text: "item 40" },
+ { id: 41, text: "item 41" },
+ { id: 42, text: "item 42" },
+ { id: 43, text: "item 43" },
+ { id: 44, text: "item 44" },
+ { id: 45, text: "item 45" },
+ { id: 46, text: "item 46" },
+ { id: 47, text: "item 47" },
+ { id: 48, text: "item 48" },
+ { id: 49, text: "item 49" },
+ { id: 50, text: "item 50" },
+ { id: 51, text: "item 51" },
+ { id: 52, text: "item 52" },
+ { id: 53, text: "item 53" },
+];
+
+export { basicPagination, complexPagination };
diff --git a/src/web/views/Components/Table/props-data.js b/src/web/views/Components/Table/props-data.js
index 8cd555f5..9e250f4a 100644
--- a/src/web/views/Components/Table/props-data.js
+++ b/src/web/views/Components/Table/props-data.js
@@ -96,4 +96,12 @@ export default [
"Use this prop to set table-layout css property (e.g. 'auto' or 'fixed').",
"",
],
+ [
+ "canDragOverRow",
+ "Function",
+ "",
+ "row => false",
+ "If returns true, a 'bimdata-table__row--drag-overed' class is added on the row on drag over, and the `row-drop` event is emitted on drop.",
+ "",
+ ],
];
diff --git a/src/web/views/SmartComponents/FileManager/FileManager.vue b/src/web/views/SmartComponents/FileManager/FileManager.vue
index 9e31e399..123676f1 100644
--- a/src/web/views/SmartComponents/FileManager/FileManager.vue
+++ b/src/web/views/SmartComponents/FileManager/FileManager.vue
@@ -1,174 +1,157 @@
- {{
- $route.name
- }}
+
+ {{ $route.name }}
+
-
+
+
+
+
+
-
-
-
+
+
+
- import BIMDataCheckbox from
- "@bimdata/design-system/dist/js/BIMDataComponents/BIMDataCheckbox.js"
+ import BIMDataFileManager from
+ "@bimdata/design-system/dist/js/BIMDataSmartComponents/BIMDataFileManager.js"
- <BIMDataSmartFileManager
- :spaceId="515"
- :projectId="756"
- apiUrl="https://api-staging.bimdata.io"
- accessToken="fc83e49ca9444d3ea41d212599f39040"
- :select="{{ String(selectChecked) }}"
- :multi="{{ String(multiChecked) }}"
- :headerButtons="{{ headerButtons }}"
- :headerSearch="{{ headerSearch }}"
- :viewPdf="{{ isViewPdf }}"
- />
-
+ <BIMDataFileManager
+ locale="{{ locale }}"
+ :apiUrl="~ BIMData API URL ~"
+ :spaceId="~ your space id ~"
+ :projectId="~ your project id ~"
+ :accessToken="~ your access token ~"
+ :select="{{ select }}"
+ :multi="{{ multi }}"
+ searchColor="{{ searchColor }}"
+ :headerButtons="{{ headerButtons }}"
+ :headerSearch="{{ headerSearch }}"
+ :selectableFileTypes="{{
+ JSON.stringify(selectableFileTypes).replace(/"/g, "'")
+ }}"
+ :viewPdf="{{ viewPdf }}"
+ :pdfPageSelect="{{ pdfPageSelect }}"
+ />
+
- Props:
-
+
+ Props:
+
+
+
+ * : Required props.
+
- Events:
-
+
+ Events:
+
+
|