@leavittsoftware/web 1.0.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/leavitt/api-service/HttpError.d.ts +10 -0
- package/leavitt/api-service/HttpError.js +2 -0
- package/leavitt/api-service/HttpError.js.map +1 -0
- package/leavitt/api-service/api-service.d.ts +27 -0
- package/leavitt/api-service/api-service.js +332 -0
- package/leavitt/api-service/api-service.js.map +1 -0
- package/leavitt/api-service/api2-service.d.ts +338 -0
- package/leavitt/api-service/api2-service.js +17 -0
- package/leavitt/api-service/api2-service.js.map +1 -0
- package/leavitt/api-service/authenticated-token-provider.d.ts +5 -0
- package/leavitt/api-service/authenticated-token-provider.js +7 -0
- package/leavitt/api-service/authenticated-token-provider.js.map +1 -0
- package/leavitt/api-service/bearer-token-provider.d.ts +4 -0
- package/leavitt/api-service/bearer-token-provider.js +2 -0
- package/leavitt/api-service/bearer-token-provider.js.map +1 -0
- package/leavitt/api-service/mapi-service.d.ts +338 -0
- package/leavitt/api-service/mapi-service.js +17 -0
- package/leavitt/api-service/mapi-service.js.map +1 -0
- package/leavitt/api-service/no-authentication-token-provider.d.ts +5 -0
- package/leavitt/api-service/no-authentication-token-provider.js +6 -0
- package/leavitt/api-service/no-authentication-token-provider.js.map +1 -0
- package/leavitt/api-service/odata-dto.d.ts +6 -0
- package/leavitt/api-service/odata-dto.js +7 -0
- package/leavitt/api-service/odata-dto.js.map +1 -0
- package/leavitt/api-service/odata-model-info.d.ts +5 -0
- package/leavitt/api-service/odata-model-info.js +7 -0
- package/leavitt/api-service/odata-model-info.js.map +1 -0
- package/leavitt/api-service/odata-response.d.ts +15 -0
- package/leavitt/api-service/odata-response.js +50 -0
- package/leavitt/api-service/odata-response.js.map +1 -0
- package/leavitt/api-service/status-codes.d.ts +2 -0
- package/leavitt/api-service/status-codes.js +44 -0
- package/leavitt/api-service/status-codes.js.map +1 -0
- package/leavitt/company-select/company-select.d.ts +50 -0
- package/leavitt/company-select/company-select.js +157 -0
- package/leavitt/company-select/company-select.js.map +1 -0
- package/leavitt/person-company-select/person-company-select.d.ts +41 -0
- package/leavitt/person-company-select/person-company-select.js +180 -0
- package/leavitt/person-company-select/person-company-select.js.map +1 -0
- package/leavitt/person-group-select/people-group-icons.d.ts +5 -0
- package/leavitt/person-group-select/people-group-icons.js +66 -0
- package/leavitt/person-group-select/people-group-icons.js.map +1 -0
- package/leavitt/person-group-select/person-group-select.d.ts +41 -0
- package/leavitt/person-group-select/person-group-select.js +186 -0
- package/leavitt/person-group-select/person-group-select.js.map +1 -0
- package/leavitt/person-select/person-select.d.ts +33 -0
- package/leavitt/person-select/person-select.js +128 -0
- package/leavitt/person-select/person-select.js.map +1 -0
- package/leavitt/profile-picture/profile-picture-menu.d.ts +44 -0
- package/leavitt/profile-picture/profile-picture-menu.js +197 -0
- package/leavitt/profile-picture/profile-picture-menu.js.map +1 -0
- package/leavitt/profile-picture/profile-picture.d.ts +39 -0
- package/leavitt/profile-picture/profile-picture.js +151 -0
- package/leavitt/profile-picture/profile-picture.js.map +1 -0
- package/leavitt/user-feedback/user-feedback.d.ts +357 -0
- package/leavitt/user-feedback/user-feedback.js +207 -0
- package/leavitt/user-feedback/user-feedback.js.map +1 -0
- package/leavitt/user-manager/LssJwtToken.d.ts +21 -0
- package/leavitt/user-manager/LssJwtToken.js +2 -0
- package/leavitt/user-manager/LssJwtToken.js.map +1 -0
- package/leavitt/user-manager/user-manager-events.d.ts +5 -0
- package/leavitt/user-manager/user-manager-events.js +7 -0
- package/leavitt/user-manager/user-manager-events.js.map +1 -0
- package/leavitt/user-manager/user-manager.d.ts +37 -0
- package/leavitt/user-manager/user-manager.js +364 -0
- package/leavitt/user-manager/user-manager.js.map +1 -0
- package/package.json +36 -0
- package/titanium/access-denied-page/access-denied-page.d.ts +16 -0
- package/titanium/access-denied-page/access-denied-page.js +360 -0
- package/titanium/access-denied-page/access-denied-page.js.map +1 -0
- package/titanium/address-input/Address.js.map +1 -0
- package/titanium/address-input/address-input.d.ts +29 -0
- package/titanium/address-input/address-input.js +77 -0
- package/titanium/address-input/address-input.js.map +1 -0
- package/titanium/address-input/google-address-input.d.ts +30 -0
- package/titanium/address-input/google-address-input.js +202 -0
- package/titanium/address-input/google-address-input.js.map +1 -0
- package/titanium/address-input/manual-address-dialog.d.ts +30 -0
- package/titanium/address-input/manual-address-dialog.js +250 -0
- package/titanium/address-input/manual-address-dialog.js.map +1 -0
- package/titanium/address-input/types/address-input-address.d.ts +17 -0
- package/titanium/address-input/types/address-input-address.js +2 -0
- package/titanium/address-input/types/address-input-address.js.map +1 -0
- package/titanium/address-input/types/address.js.map +1 -0
- package/titanium/address-input/types/autocomplete-prediction-suggestion.js.map +1 -0
- package/titanium/address-input/utils/address-to-string.d.ts +3 -0
- package/titanium/address-input/utils/address-to-string.js +13 -0
- package/titanium/address-input/utils/address-to-string.js.map +1 -0
- package/titanium/address-input/utils/place-result-to-address.d.ts +4 -0
- package/titanium/address-input/utils/place-result-to-address.js +33 -0
- package/titanium/address-input/utils/place-result-to-address.js.map +1 -0
- package/titanium/address-input/utils/validate-street.d.ts +2 -0
- package/titanium/address-input/utils/validate-street.js +8 -0
- package/titanium/address-input/utils/validate-street.js.map +1 -0
- package/titanium/card/card.d.ts +23 -0
- package/titanium/card/card.js +160 -0
- package/titanium/card/card.js.map +1 -0
- package/titanium/chip-multi-select/chip-multi-select.d.ts +55 -0
- package/titanium/chip-multi-select/chip-multi-select.js +119 -0
- package/titanium/chip-multi-select/chip-multi-select.js.map +1 -0
- package/titanium/data-table/data-table-header.d.ts +67 -0
- package/titanium/data-table/data-table-header.js +207 -0
- package/titanium/data-table/data-table-header.js.map +1 -0
- package/titanium/data-table/data-table-item.d.ts +100 -0
- package/titanium/data-table/data-table-item.js +511 -0
- package/titanium/data-table/data-table-item.js.map +1 -0
- package/titanium/data-table/data-table.d.ts +146 -0
- package/titanium/data-table/data-table.js +605 -0
- package/titanium/data-table/data-table.js.map +1 -0
- package/titanium/data-table/filter-controller.d.ts +23 -0
- package/titanium/data-table/filter-controller.js +119 -0
- package/titanium/data-table/filter-controller.js.map +1 -0
- package/titanium/data-table/filter.d.ts +8 -0
- package/titanium/data-table/filter.js +11 -0
- package/titanium/data-table/filter.js.map +1 -0
- package/titanium/data-table/page-control.d.ts +54 -0
- package/titanium/data-table/page-control.js +196 -0
- package/titanium/data-table/page-control.js.map +1 -0
- package/titanium/date-range-selector/date-range-change-event.d.ts +8 -0
- package/titanium/date-range-selector/date-range-change-event.js +10 -0
- package/titanium/date-range-selector/date-range-change-event.js.map +1 -0
- package/titanium/date-range-selector/date-range-selector.d.ts +65 -0
- package/titanium/date-range-selector/date-range-selector.js +423 -0
- package/titanium/date-range-selector/date-range-selector.js.map +1 -0
- package/titanium/date-range-selector/range-label.d.ts +4 -0
- package/titanium/date-range-selector/range-label.js +25 -0
- package/titanium/date-range-selector/range-label.js.map +1 -0
- package/titanium/drawer/drawer.d.ts +39 -0
- package/titanium/drawer/drawer.js +233 -0
- package/titanium/drawer/drawer.js.map +1 -0
- package/titanium/duration-input/duration-input.d.ts +26 -0
- package/titanium/duration-input/duration-input.js +86 -0
- package/titanium/duration-input/duration-input.js.map +1 -0
- package/titanium/duration-input/human-interval.d.ts +19 -0
- package/titanium/duration-input/human-interval.js +74 -0
- package/titanium/duration-input/human-interval.js.map +1 -0
- package/titanium/error-page/error-page.d.ts +16 -0
- package/titanium/error-page/error-page.js +96 -0
- package/titanium/error-page/error-page.js.map +1 -0
- package/titanium/event-bus/event-bus.d.ts +10 -0
- package/titanium/event-bus/event-bus.js +52 -0
- package/titanium/event-bus/event-bus.js.map +1 -0
- package/titanium/extendable-outlined-text-field/extendable-outlined-text-field.d.ts +160 -0
- package/titanium/extendable-outlined-text-field/extendable-outlined-text-field.js +295 -0
- package/titanium/extendable-outlined-text-field/extendable-outlined-text-field.js.map +1 -0
- package/titanium/extendable-outlined-text-field/extensible-outlined-text-field.d.ts +45 -0
- package/titanium/extendable-outlined-text-field/extensible-outlined-text-field.js.map +1 -0
- package/titanium/full-page-loading-indicator/full-page-loading-indicator.d.ts +19 -0
- package/titanium/full-page-loading-indicator/full-page-loading-indicator.js +170 -0
- package/titanium/full-page-loading-indicator/full-page-loading-indicator.js.map +1 -0
- package/titanium/hacks/dialog-overflow-hacks.d.ts +4 -0
- package/titanium/hacks/dialog-overflow-hacks.js +21 -0
- package/titanium/hacks/dialog-overflow-hacks.js.map +1 -0
- package/titanium/header/header.d.ts +39 -0
- package/titanium/header/header.js +148 -0
- package/titanium/header/header.js.map +1 -0
- package/titanium/helpers/csv-download.d.ts +3 -0
- package/titanium/helpers/csv-download.js +78 -0
- package/titanium/helpers/csv-download.js.map +1 -0
- package/titanium/helpers/debouncer.d.ts +13 -0
- package/titanium/helpers/debouncer.js +33 -0
- package/titanium/helpers/debouncer.js.map +1 -0
- package/titanium/helpers/delay.d.ts +2 -0
- package/titanium/helpers/delay.js +6 -0
- package/titanium/helpers/delay.js.map +1 -0
- package/titanium/helpers/dev-detection.d.ts +3 -0
- package/titanium/helpers/dev-detection.js +12 -0
- package/titanium/helpers/dev-detection.js.map +1 -0
- package/titanium/helpers/helpers.d.ts +14 -0
- package/titanium/helpers/helpers.js +14 -0
- package/titanium/helpers/helpers.js.map +1 -0
- package/titanium/helpers/join.d.ts +2 -0
- package/titanium/helpers/join.js +5 -0
- package/titanium/helpers/join.js.map +1 -0
- package/titanium/helpers/leavitt-cdn.d.ts +5 -0
- package/titanium/helpers/leavitt-cdn.js +38 -0
- package/titanium/helpers/leavitt-cdn.js.map +1 -0
- package/titanium/helpers/load-while.d.ts +343 -0
- package/titanium/helpers/load-while.js +27 -0
- package/titanium/helpers/load-while.js.map +1 -0
- package/titanium/helpers/media-query.d.ts +2 -0
- package/titanium/helpers/media-query.js +6 -0
- package/titanium/helpers/media-query.js.map +1 -0
- package/titanium/helpers/middle-ellipsis.d.ts +2 -0
- package/titanium/helpers/middle-ellipsis.js +7 -0
- package/titanium/helpers/middle-ellipsis.js.map +1 -0
- package/titanium/helpers/not-null-or-undefined.d.ts +2 -0
- package/titanium/helpers/not-null-or-undefined.js +4 -0
- package/titanium/helpers/not-null-or-undefined.js.map +1 -0
- package/titanium/helpers/not-null.d.ts +2 -0
- package/titanium/helpers/not-null.js +4 -0
- package/titanium/helpers/not-null.js.map +1 -0
- package/titanium/helpers/not-undefined.d.ts +2 -0
- package/titanium/helpers/not-undefined.js +4 -0
- package/titanium/helpers/not-undefined.js.map +1 -0
- package/titanium/helpers/odata-helpers.d.ts +2 -0
- package/titanium/helpers/odata-helpers.js +2 -0
- package/titanium/helpers/odata-helpers.js.map +1 -0
- package/titanium/helpers/search-token.d.ts +2 -0
- package/titanium/helpers/search-token.js +17 -0
- package/titanium/helpers/search-token.js.map +1 -0
- package/titanium/icon-picker/icon-picker.d.ts +23 -0
- package/titanium/icon-picker/icon-picker.js +75 -0
- package/titanium/icon-picker/icon-picker.js.map +1 -0
- package/titanium/icon-picker/material-symbols.d.ts +3 -0
- package/titanium/icon-picker/material-symbols.js +3297 -0
- package/titanium/icon-picker/material-symbols.js.map +1 -0
- package/titanium/input-validator/input-validator.d.ts +20 -0
- package/titanium/input-validator/input-validator.js +45 -0
- package/titanium/input-validator/input-validator.js.map +1 -0
- package/titanium/search-input/search-input.d.ts +47 -0
- package/titanium/search-input/search-input.js +237 -0
- package/titanium/search-input/search-input.js.map +1 -0
- package/titanium/service-worker-notifier/service-worker-notifier.d.ts +9 -0
- package/titanium/service-worker-notifier/service-worker-notifier.js +57 -0
- package/titanium/service-worker-notifier/service-worker-notifier.js.map +1 -0
- package/titanium/show-hide/show-hide.d.ts +36 -0
- package/titanium/show-hide/show-hide.js +144 -0
- package/titanium/show-hide/show-hide.js.map +1 -0
- package/titanium/single-select-base/single-select-base.d.ts +449 -0
- package/titanium/single-select-base/single-select-base.js +411 -0
- package/titanium/single-select-base/single-select-base.js.map +1 -0
- package/titanium/smart-attachment-input/crop-and-save-image-dialog.d.ts +370 -0
- package/titanium/smart-attachment-input/crop-and-save-image-dialog.js +270 -0
- package/titanium/smart-attachment-input/crop-and-save-image-dialog.js.map +1 -0
- package/titanium/smart-attachment-input/cropper-styles.d.ts +3 -0
- package/titanium/smart-attachment-input/cropper-styles.js +311 -0
- package/titanium/smart-attachment-input/cropper-styles.js.map +1 -0
- package/titanium/smart-attachment-input/image-formats.d.ts +5 -0
- package/titanium/smart-attachment-input/image-formats.js +37 -0
- package/titanium/smart-attachment-input/image-formats.js.map +1 -0
- package/titanium/smart-attachment-input/image-preview-dialog.d.ts +21 -0
- package/titanium/smart-attachment-input/image-preview-dialog.js +83 -0
- package/titanium/smart-attachment-input/image-preview-dialog.js.map +1 -0
- package/titanium/smart-attachment-input/smart-attachment-input.d.ts +126 -0
- package/titanium/smart-attachment-input/smart-attachment-input.js +422 -0
- package/titanium/smart-attachment-input/smart-attachment-input.js.map +1 -0
- package/titanium/smart-attachment-input/type/smart-attachment.d.ts +7 -0
- package/titanium/smart-attachment-input/type/smart-attachment.js +2 -0
- package/titanium/smart-attachment-input/type/smart-attachment.js.map +1 -0
- package/titanium/snackbar/snackbar.d.ts +79 -0
- package/titanium/snackbar/snackbar.js +302 -0
- package/titanium/snackbar/snackbar.js.map +1 -0
- package/titanium/styles/a.d.ts +2 -0
- package/titanium/styles/a.js +18 -0
- package/titanium/styles/a.js.map +1 -0
- package/titanium/styles/data-row.d.ts +2 -0
- package/titanium/styles/data-row.js +52 -0
- package/titanium/styles/data-row.js.map +1 -0
- package/titanium/styles/ellipsis.d.ts +2 -0
- package/titanium/styles/ellipsis.js +9 -0
- package/titanium/styles/ellipsis.js.map +1 -0
- package/titanium/styles/h1.d.ts +2 -0
- package/titanium/styles/h1.js +17 -0
- package/titanium/styles/h1.js.map +1 -0
- package/titanium/styles/h2.d.ts +2 -0
- package/titanium/styles/h2.js +17 -0
- package/titanium/styles/h2.js.map +1 -0
- package/titanium/styles/h3.d.ts +2 -0
- package/titanium/styles/h3.js +17 -0
- package/titanium/styles/h3.js.map +1 -0
- package/titanium/styles/h4.d.ts +2 -0
- package/titanium/styles/h4.js +17 -0
- package/titanium/styles/h4.js.map +1 -0
- package/titanium/styles/h5.d.ts +2 -0
- package/titanium/styles/h5.js +19 -0
- package/titanium/styles/h5.js.map +1 -0
- package/titanium/styles/p.d.ts +2 -0
- package/titanium/styles/p.js +17 -0
- package/titanium/styles/p.js.map +1 -0
- package/titanium/styles/styles.d.ts +17 -0
- package/titanium/styles/styles.js +17 -0
- package/titanium/styles/styles.js.map +1 -0
- package/titanium/toolbar/toolbar.d.ts +34 -0
- package/titanium/toolbar/toolbar.js +104 -0
- package/titanium/toolbar/toolbar.js.map +1 -0
- package/titanium/types/any-function.d.ts +5 -0
- package/titanium/types/any-function.js +2 -0
- package/titanium/types/any-function.js.map +1 -0
- package/titanium/types/dom-event.d.ts +4 -0
- package/titanium/types/dom-event.js +2 -0
- package/titanium/types/dom-event.js.map +1 -0
- package/titanium/types/identifier-interface.d.ts +4 -0
- package/titanium/types/identifier-interface.js +2 -0
- package/titanium/types/identifier-interface.js.map +1 -0
- package/titanium/types/pending-state-event.d.ts +7 -0
- package/titanium/types/pending-state-event.js +7 -0
- package/titanium/types/pending-state-event.js.map +1 -0
- package/titanium/types/string-map.d.ts +7 -0
- package/titanium/types/string-map.js +5 -0
- package/titanium/types/string-map.js.map +1 -0
- package/titanium/youtube-input/youtube-input.d.ts +17 -0
- package/titanium/youtube-input/youtube-input.js +52 -0
- package/titanium/youtube-input/youtube-input.js.map +1 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
|
+
import { css, html } from 'lit';
|
|
4
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
5
|
+
import { TitaniumSingleSelectBase } from '../../titanium/single-select-base/single-select-base';
|
|
6
|
+
import '../profile-picture/profile-picture';
|
|
7
|
+
import { Debouncer, getSearchTokens } from '../../titanium/helpers/helpers';
|
|
8
|
+
import { TitaniumSnackbarSingleton } from '../../titanium/snackbar/snackbar';
|
|
9
|
+
import Fuse from 'fuse.js';
|
|
10
|
+
import { peopleGroupIcons } from './people-group-icons';
|
|
11
|
+
/**
|
|
12
|
+
* Single select input that searches Leavitt Group users and user groups
|
|
13
|
+
*
|
|
14
|
+
* @element leavitt-person-select
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
let LeavittPersonGroupSelect = class LeavittPersonGroupSelect extends TitaniumSingleSelectBase {
|
|
18
|
+
#label_accessor_storage = 'Person or group';
|
|
19
|
+
get label() { return this.#label_accessor_storage; }
|
|
20
|
+
set label(value) { this.#label_accessor_storage = value; }
|
|
21
|
+
#placeholder_accessor_storage = 'Search for a person or group';
|
|
22
|
+
get placeholder() { return this.#placeholder_accessor_storage; }
|
|
23
|
+
set placeholder(value) { this.#placeholder_accessor_storage = value; }
|
|
24
|
+
#peopleApiControllerName_accessor_storage = 'People';
|
|
25
|
+
/**
|
|
26
|
+
* Set the name of the API controller to use
|
|
27
|
+
*/
|
|
28
|
+
get peopleApiControllerName() { return this.#peopleApiControllerName_accessor_storage; }
|
|
29
|
+
set peopleApiControllerName(value) { this.#peopleApiControllerName_accessor_storage = value; }
|
|
30
|
+
#groupApiControllerName_accessor_storage = 'PeopleGroups';
|
|
31
|
+
/**
|
|
32
|
+
* Set the name of the API controller to use
|
|
33
|
+
*/
|
|
34
|
+
get groupApiControllerName() { return this.#groupApiControllerName_accessor_storage; }
|
|
35
|
+
set groupApiControllerName(value) { this.#groupApiControllerName_accessor_storage = value; }
|
|
36
|
+
#pathToSelectedText_accessor_storage = 'Name';
|
|
37
|
+
get pathToSelectedText() { return this.#pathToSelectedText_accessor_storage; }
|
|
38
|
+
set pathToSelectedText(value) { this.#pathToSelectedText_accessor_storage = value; }
|
|
39
|
+
#doSearchDebouncer = new Debouncer((searchTerm) => this.#doSearch(searchTerm));
|
|
40
|
+
#abortController = new AbortController();
|
|
41
|
+
searchTermToOData(searchTerm) {
|
|
42
|
+
const searchTokens = getSearchTokens(searchTerm);
|
|
43
|
+
if (searchTokens.length < 1) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return searchTokens.map((token) => `contains(tolower(Name), '${token.toLowerCase()}')`).join(' and ');
|
|
47
|
+
}
|
|
48
|
+
async #doSearch(searchTerm) {
|
|
49
|
+
if (!searchTerm) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
this.#abortController.abort();
|
|
53
|
+
this.#abortController = new AbortController();
|
|
54
|
+
const all = Promise.all([this.#doPersonSearch(searchTerm), this.#doGroupSearch(searchTerm)]);
|
|
55
|
+
this.loadWhile(all);
|
|
56
|
+
const results = await all;
|
|
57
|
+
const entities = [...(results[0]?.entities ?? []), ...(results[1]?.entities ?? [])];
|
|
58
|
+
const odataCount = (results[0]?.odataCount ?? 0) + (results[1]?.odataCount ?? 0);
|
|
59
|
+
const options = {
|
|
60
|
+
includeScore: true,
|
|
61
|
+
keys: ['Name'],
|
|
62
|
+
};
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
|
+
const fuse = new Fuse(entities, options);
|
|
65
|
+
const fuseResults = fuse.search(searchTerm).sort((a, b) => (b?.score ?? 0) - (a?.score ?? 0));
|
|
66
|
+
this.suggestions = fuseResults.map((o) => o.item) ?? [];
|
|
67
|
+
this.count = odataCount ?? 0;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* @ignore
|
|
71
|
+
*/
|
|
72
|
+
async #doPersonSearch(searchTerm) {
|
|
73
|
+
if (!searchTerm) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
const odataParts = ['top=100', 'count=true', 'compute=FullName as Name', 'select=Name,Id,CompanyName,ProfilePictureCdnFileName'];
|
|
78
|
+
const searchTokens = getSearchTokens(searchTerm);
|
|
79
|
+
if (searchTokens.length > 0) {
|
|
80
|
+
const searchFilter = searchTokens.map((token) => `contains(tolower(Name), '${token.toLowerCase()}')`).join(' and ');
|
|
81
|
+
odataParts.push(`filter=${searchFilter}`);
|
|
82
|
+
}
|
|
83
|
+
const results = await this.apiService?.getAsync(`${this.peopleApiControllerName}?${odataParts.join('&')}`, {
|
|
84
|
+
abortController: this.#abortController,
|
|
85
|
+
});
|
|
86
|
+
results?.entities.forEach((p) => (p.type = 'Person'));
|
|
87
|
+
return results;
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
if (!error?.message?.includes('Abort error')) {
|
|
91
|
+
TitaniumSnackbarSingleton.open(error);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* @ignore
|
|
98
|
+
*/
|
|
99
|
+
async #doGroupSearch(searchTerm) {
|
|
100
|
+
if (!searchTerm) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
const filterParts = ['not IsExpired'];
|
|
104
|
+
try {
|
|
105
|
+
const odataParts = ['top=100', 'count=true', 'select=Name,Id,Description'];
|
|
106
|
+
const searchTokens = getSearchTokens(searchTerm);
|
|
107
|
+
if (searchTokens.length > 0) {
|
|
108
|
+
filterParts.push(searchTokens.map((token) => `contains(tolower(Name), '${token.toLowerCase()}')`).join(' and '));
|
|
109
|
+
}
|
|
110
|
+
odataParts.push(`filter=${filterParts.join(' and ')}`);
|
|
111
|
+
const results = await this.apiService?.getAsync(`${this.groupApiControllerName}?${odataParts.join('&')}`, {
|
|
112
|
+
abortController: this.#abortController,
|
|
113
|
+
});
|
|
114
|
+
results?.entities.forEach((p) => (p.type = 'PeopleGroup'));
|
|
115
|
+
return results;
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
if (!error?.message?.includes('Abort error')) {
|
|
119
|
+
TitaniumSnackbarSingleton.open(error);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
static { this.styles = [
|
|
125
|
+
...TitaniumSingleSelectBase.styles,
|
|
126
|
+
css `
|
|
127
|
+
md-menu-item md-icon[group] {
|
|
128
|
+
width: 40px;
|
|
129
|
+
height: 40px;
|
|
130
|
+
font-size: 40px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
md-icon[group] {
|
|
134
|
+
color: var(--md-sys-color-primary);
|
|
135
|
+
}
|
|
136
|
+
`,
|
|
137
|
+
]; }
|
|
138
|
+
// Overloaded base
|
|
139
|
+
onInputChanged(searchTerm) {
|
|
140
|
+
this.isLoading = true;
|
|
141
|
+
this.#doSearchDebouncer.debounce(searchTerm);
|
|
142
|
+
}
|
|
143
|
+
renderSelectedLeadingInputSlot(entity) {
|
|
144
|
+
return entity.type === 'Person'
|
|
145
|
+
? html `<profile-picture slot="leading-icon" .fileName=${entity?.ProfilePictureCdnFileName || null} shape="circle" size="24"></profile-picture>`
|
|
146
|
+
: html `<md-icon group slot="leading-icon">${peopleGroupIcons.get(entity['@odata.type'])?.icon ?? 'task_alt'}</md-icon>`;
|
|
147
|
+
}
|
|
148
|
+
renderSuggestion(entity) {
|
|
149
|
+
return entity.type === 'Person'
|
|
150
|
+
? html `<md-menu-item .item=${entity} ?selected=${this.selected?.Id === entity.Id}>
|
|
151
|
+
<profile-picture slot="start" .fileName=${entity?.ProfilePictureCdnFileName ?? null} shape="circle" size="40"></profile-picture>
|
|
152
|
+
<span slot="headline">${entity.Name}</span>
|
|
153
|
+
<span slot="supporting-text">${entity.CompanyName}</span>
|
|
154
|
+
</md-menu-item>`
|
|
155
|
+
: entity.type === 'PeopleGroup'
|
|
156
|
+
? html `<md-menu-item .item=${entity} ?selected=${this.selected?.Id === entity.Id}>
|
|
157
|
+
<md-icon group slot="start">${peopleGroupIcons.get(entity['@odata.type'])?.icon ?? 'task_alt'}</md-icon>
|
|
158
|
+
<span slot="headline">${entity.Name}</span>
|
|
159
|
+
<span slot="supporting-text">${entity.Description || (peopleGroupIcons.get(entity['@odata.type'])?.displayName ?? 'People group')}</span>
|
|
160
|
+
</md-menu-item>`
|
|
161
|
+
: html ``;
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
__decorate([
|
|
165
|
+
property({ type: String })
|
|
166
|
+
], LeavittPersonGroupSelect.prototype, "label", null);
|
|
167
|
+
__decorate([
|
|
168
|
+
property({ type: String })
|
|
169
|
+
], LeavittPersonGroupSelect.prototype, "placeholder", null);
|
|
170
|
+
__decorate([
|
|
171
|
+
property({ type: String })
|
|
172
|
+
], LeavittPersonGroupSelect.prototype, "peopleApiControllerName", null);
|
|
173
|
+
__decorate([
|
|
174
|
+
property({ type: String })
|
|
175
|
+
], LeavittPersonGroupSelect.prototype, "groupApiControllerName", null);
|
|
176
|
+
__decorate([
|
|
177
|
+
property({ type: String })
|
|
178
|
+
], LeavittPersonGroupSelect.prototype, "pathToSelectedText", null);
|
|
179
|
+
__decorate([
|
|
180
|
+
property({ attribute: false })
|
|
181
|
+
], LeavittPersonGroupSelect.prototype, "apiService", void 0);
|
|
182
|
+
LeavittPersonGroupSelect = __decorate([
|
|
183
|
+
customElement('leavitt-person-group-select')
|
|
184
|
+
], LeavittPersonGroupSelect);
|
|
185
|
+
export { LeavittPersonGroupSelect };
|
|
186
|
+
//# sourceMappingURL=person-group-select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"person-group-select.js","sourceRoot":"","sources":["person-group-select.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAEhG,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAE5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,IAAI,MAAM,SAAS,CAAC;A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,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uEAAqD;AAK3C;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sEAA0D;AAEhD;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kEAA8C;AAKzC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;4DAAwB;AApB5C,wBAAwB;IADpC,aAAa,CAAC,6BAA6B,CAAC;GAChC,wBAAwB,CAgKpC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Person } from '@leavittsoftware/lg-core-typescript';
|
|
2
|
+
import { TitaniumSingleSelectBase } from '../../titanium/single-select-base/single-select-base';
|
|
3
|
+
import '../profile-picture/profile-picture';
|
|
4
|
+
import ApiService from '../api-service/api-service';
|
|
5
|
+
/**
|
|
6
|
+
* Single select input that searches Leavitt Group users
|
|
7
|
+
*
|
|
8
|
+
* @element leavitt-person-select
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export declare class LeavittPersonSelect extends TitaniumSingleSelectBase<Partial<Person>> {
|
|
12
|
+
#private;
|
|
13
|
+
accessor label: string;
|
|
14
|
+
accessor placeholder: string;
|
|
15
|
+
/**
|
|
16
|
+
* Set the name of the API controller to use
|
|
17
|
+
*/
|
|
18
|
+
accessor apiControllerName: string;
|
|
19
|
+
accessor pathToSelectedText: string;
|
|
20
|
+
/**
|
|
21
|
+
* Required
|
|
22
|
+
*/
|
|
23
|
+
apiService: ApiService;
|
|
24
|
+
/**
|
|
25
|
+
* Odata parts for the Person API call
|
|
26
|
+
*/
|
|
27
|
+
odataParts: Array<string>;
|
|
28
|
+
searchTermToOData(searchTerm: string): string | null;
|
|
29
|
+
protected onInputChanged(searchTerm: string): void;
|
|
30
|
+
protected renderSelectedLeadingInputSlot(entity: Partial<Person>): import("lit-html").TemplateResult<1>;
|
|
31
|
+
protected renderSuggestion(person: Partial<Person>): import("lit-html").TemplateResult<1>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=person-select.d.ts.map
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
|
+
import { html } from 'lit';
|
|
4
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
5
|
+
import { TitaniumSingleSelectBase } from '../../titanium/single-select-base/single-select-base';
|
|
6
|
+
import '../profile-picture/profile-picture';
|
|
7
|
+
import { Debouncer, getSearchTokens } from '../../titanium/helpers/helpers';
|
|
8
|
+
import { TitaniumSnackbarSingleton } from '../../titanium/snackbar/snackbar';
|
|
9
|
+
/**
|
|
10
|
+
* Single select input that searches Leavitt Group users
|
|
11
|
+
*
|
|
12
|
+
* @element leavitt-person-select
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
let LeavittPersonSelect = class LeavittPersonSelect extends TitaniumSingleSelectBase {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.#label_accessor_storage = 'Person';
|
|
19
|
+
this.#placeholder_accessor_storage = 'Search for a person';
|
|
20
|
+
this.#apiControllerName_accessor_storage = 'People';
|
|
21
|
+
this.#pathToSelectedText_accessor_storage = 'FullName';
|
|
22
|
+
/**
|
|
23
|
+
* Odata parts for the Person API call
|
|
24
|
+
*/
|
|
25
|
+
this.odataParts = [
|
|
26
|
+
'top=15',
|
|
27
|
+
'orderby=FullName',
|
|
28
|
+
'select=FullName,CompanyName,Id,ProfilePictureCdnFileName',
|
|
29
|
+
'count=true',
|
|
30
|
+
];
|
|
31
|
+
this.#doSearchDebouncer = new Debouncer((searchTerm) => this.#doSearch(searchTerm));
|
|
32
|
+
this.#abortController = new AbortController();
|
|
33
|
+
}
|
|
34
|
+
#label_accessor_storage;
|
|
35
|
+
get label() { return this.#label_accessor_storage; }
|
|
36
|
+
set label(value) { this.#label_accessor_storage = value; }
|
|
37
|
+
#placeholder_accessor_storage;
|
|
38
|
+
get placeholder() { return this.#placeholder_accessor_storage; }
|
|
39
|
+
set placeholder(value) { this.#placeholder_accessor_storage = value; }
|
|
40
|
+
#apiControllerName_accessor_storage;
|
|
41
|
+
/**
|
|
42
|
+
* Set the name of the API controller to use
|
|
43
|
+
*/
|
|
44
|
+
get apiControllerName() { return this.#apiControllerName_accessor_storage; }
|
|
45
|
+
set apiControllerName(value) { this.#apiControllerName_accessor_storage = value; }
|
|
46
|
+
#pathToSelectedText_accessor_storage;
|
|
47
|
+
get pathToSelectedText() { return this.#pathToSelectedText_accessor_storage; }
|
|
48
|
+
set pathToSelectedText(value) { this.#pathToSelectedText_accessor_storage = value; }
|
|
49
|
+
#doSearchDebouncer;
|
|
50
|
+
#abortController;
|
|
51
|
+
searchTermToOData(searchTerm) {
|
|
52
|
+
const searchTokens = getSearchTokens(searchTerm);
|
|
53
|
+
if (searchTokens.length < 1) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
return searchTokens.map((token) => `contains(tolower(FullName), '${token.toLowerCase()}')`).join(' and ');
|
|
57
|
+
}
|
|
58
|
+
async #doSearch(searchTerm) {
|
|
59
|
+
if (!searchTerm) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
this.#abortController.abort();
|
|
63
|
+
this.#abortController = new AbortController();
|
|
64
|
+
try {
|
|
65
|
+
const searchOData = this.searchTermToOData(searchTerm);
|
|
66
|
+
const oDataParts = structuredClone(this.odataParts);
|
|
67
|
+
if (searchOData) {
|
|
68
|
+
const existingFilterIndex = oDataParts.findIndex((o) => o.startsWith('filter=') || o.startsWith('$filter='));
|
|
69
|
+
if (existingFilterIndex > -1) {
|
|
70
|
+
oDataParts[existingFilterIndex] = [oDataParts[existingFilterIndex], searchOData].join(' and ');
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
oDataParts.push(`filter=${searchOData}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const get = this.apiService.getAsync(`${this.apiControllerName}?${oDataParts.join('&')}`, { abortController: this.#abortController });
|
|
77
|
+
this.loadWhile(get);
|
|
78
|
+
const result = await get;
|
|
79
|
+
this.suggestions = result?.entities ?? [];
|
|
80
|
+
this.count = result?.odataCount ?? 0;
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
if (!error?.message?.includes('Abort error')) {
|
|
85
|
+
TitaniumSnackbarSingleton.open(error);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
this.suggestions = [];
|
|
89
|
+
this.count = 0;
|
|
90
|
+
}
|
|
91
|
+
// Overloaded base
|
|
92
|
+
onInputChanged(searchTerm) {
|
|
93
|
+
this.#doSearchDebouncer.debounce(searchTerm);
|
|
94
|
+
}
|
|
95
|
+
renderSelectedLeadingInputSlot(entity) {
|
|
96
|
+
return html ` <profile-picture slot="leading-icon" .fileName=${entity?.ProfilePictureCdnFileName || null} shape="circle" size="24"></profile-picture>`;
|
|
97
|
+
}
|
|
98
|
+
renderSuggestion(person) {
|
|
99
|
+
return html `<md-menu-item .item=${person} ?selected=${this.selected?.Id === person.Id}>
|
|
100
|
+
<profile-picture slot="start" .fileName=${person?.ProfilePictureCdnFileName ?? null} shape="circle" size="40"></profile-picture>
|
|
101
|
+
<span slot="headline">${person.FullName}</span>
|
|
102
|
+
<span slot="supporting-text">${person.CompanyName}</span>
|
|
103
|
+
</md-menu-item>`;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
__decorate([
|
|
107
|
+
property({ type: String })
|
|
108
|
+
], LeavittPersonSelect.prototype, "label", null);
|
|
109
|
+
__decorate([
|
|
110
|
+
property({ type: String })
|
|
111
|
+
], LeavittPersonSelect.prototype, "placeholder", null);
|
|
112
|
+
__decorate([
|
|
113
|
+
property({ type: String })
|
|
114
|
+
], LeavittPersonSelect.prototype, "apiControllerName", null);
|
|
115
|
+
__decorate([
|
|
116
|
+
property({ type: String })
|
|
117
|
+
], LeavittPersonSelect.prototype, "pathToSelectedText", null);
|
|
118
|
+
__decorate([
|
|
119
|
+
property({ attribute: false })
|
|
120
|
+
], LeavittPersonSelect.prototype, "apiService", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
property({ type: Array })
|
|
123
|
+
], LeavittPersonSelect.prototype, "odataParts", void 0);
|
|
124
|
+
LeavittPersonSelect = __decorate([
|
|
125
|
+
customElement('leavitt-person-select')
|
|
126
|
+
], LeavittPersonSelect);
|
|
127
|
+
export { LeavittPersonSelect };
|
|
128
|
+
//# sourceMappingURL=person-select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"person-select.js","sourceRoot":"","sources":["person-select.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAEhG,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAE5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAE7E;;;;;GAKG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,wBAAyC;IAA3E;;QACgC,+BAAgB,QAAQ,CAAC;QAEzB,qCAAsB,qBAAqB,CAAC;QAK5C,2CAA4B,QAAQ,CAAC;QAErC,4CAA6B,UAAU,CAAC;QAO7E;;WAEG;QACwB,eAAU,GAAkB;YACrD,QAAQ;YACR,kBAAkB;YAClB,0DAA0D;YAC1D,YAAY;SACb,CAAC;QAEF,uBAAkB,GAAG,IAAI,SAAS,CAAC,CAAC,UAAkB,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;QACvF,qBAAgB,GAAoB,IAAI,eAAe,EAAE,CAAC;IA4D5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,MAAM,cAAc,IAAI,CAAC,QAAQ,EAAE,EAAE,KAAK,MAAM,CAAC,EAAE;gDACzC,MAAM,EAAE,yBAAyB,IAAI,IAAI;8BAC3D,MAAM,CAAC,QAAQ;qCACR,MAAM,CAAC,WAAW;oBACnC,CAAC;IACnB,CAAC;CACF,CAAA;AAvFsC;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAmC;AAEzB;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAAsD;AAK5C;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DAA+C;AAErC;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DAAkD;AAK7C;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;uDAAwB;AAK5B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;uDAKxB;AAzBS,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CAwF/B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import './profile-picture';
|
|
2
|
+
import '@material/web/menu/menu';
|
|
3
|
+
import '@material/web/button/outlined-button';
|
|
4
|
+
import '@material/web/button/text-button';
|
|
5
|
+
import { LitElement } from 'lit';
|
|
6
|
+
/**
|
|
7
|
+
* Profile picture menu for the Leavitt Group
|
|
8
|
+
*
|
|
9
|
+
* @element profile-picture-menu
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export declare class ProfilePictureMenuElement extends LitElement {
|
|
13
|
+
/**
|
|
14
|
+
* Size in pixels of profile picture button
|
|
15
|
+
*/
|
|
16
|
+
size: number;
|
|
17
|
+
profilePictureFileName: string | null;
|
|
18
|
+
/**
|
|
19
|
+
* Person id of user
|
|
20
|
+
*/
|
|
21
|
+
personId: number;
|
|
22
|
+
/**
|
|
23
|
+
* Email address of user
|
|
24
|
+
*/
|
|
25
|
+
email: string;
|
|
26
|
+
/**
|
|
27
|
+
* Company of user
|
|
28
|
+
*/
|
|
29
|
+
company: string;
|
|
30
|
+
/**
|
|
31
|
+
* Full name of user
|
|
32
|
+
*/
|
|
33
|
+
name: string;
|
|
34
|
+
private menu;
|
|
35
|
+
firstUpdated(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Sets properties based on user manager instance
|
|
38
|
+
*/
|
|
39
|
+
setUserProps(): void;
|
|
40
|
+
updated(changedProps: any): void;
|
|
41
|
+
static styles: import("lit").CSSResult;
|
|
42
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=profile-picture-menu.d.ts.map
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import './profile-picture';
|
|
3
|
+
import '@material/web/menu/menu';
|
|
4
|
+
import '@material/web/button/outlined-button';
|
|
5
|
+
import '@material/web/button/text-button';
|
|
6
|
+
import { GetUserManagerInstance } from '../user-manager/user-manager';
|
|
7
|
+
import { UserManagerUpdatedEvent } from '../user-manager/user-manager-events';
|
|
8
|
+
import { css, html, LitElement } from 'lit';
|
|
9
|
+
import { property, customElement, query } from 'lit/decorators.js';
|
|
10
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
11
|
+
/**
|
|
12
|
+
* Profile picture menu for the Leavitt Group
|
|
13
|
+
*
|
|
14
|
+
* @element profile-picture-menu
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
let ProfilePictureMenuElement = class ProfilePictureMenuElement extends LitElement {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
/**
|
|
21
|
+
* Size in pixels of profile picture button
|
|
22
|
+
*/
|
|
23
|
+
this.size = 40;
|
|
24
|
+
/**
|
|
25
|
+
* Person id of user
|
|
26
|
+
*/
|
|
27
|
+
this.personId = 0;
|
|
28
|
+
/**
|
|
29
|
+
* Email address of user
|
|
30
|
+
*/
|
|
31
|
+
this.email = '';
|
|
32
|
+
/**
|
|
33
|
+
* Company of user
|
|
34
|
+
*/
|
|
35
|
+
this.company = '';
|
|
36
|
+
/**
|
|
37
|
+
* Full name of user
|
|
38
|
+
*/
|
|
39
|
+
this.name = '';
|
|
40
|
+
}
|
|
41
|
+
firstUpdated() {
|
|
42
|
+
GetUserManagerInstance().addEventListener(UserManagerUpdatedEvent.eventName, () => this.setUserProps());
|
|
43
|
+
this.setUserProps();
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Sets properties based on user manager instance
|
|
47
|
+
*/
|
|
48
|
+
setUserProps() {
|
|
49
|
+
this.personId = GetUserManagerInstance().personId;
|
|
50
|
+
this.profilePictureFileName = GetUserManagerInstance().profilePictureFileName;
|
|
51
|
+
this.email = GetUserManagerInstance().email;
|
|
52
|
+
this.company = GetUserManagerInstance().company;
|
|
53
|
+
this.name = GetUserManagerInstance().fullname;
|
|
54
|
+
}
|
|
55
|
+
updated(changedProps) {
|
|
56
|
+
if (changedProps.has('size') && changedProps.get('size') !== this.size) {
|
|
57
|
+
this.style.width = this.size + 'px';
|
|
58
|
+
this.style.height = this.size + 'px';
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
static { this.styles = css `
|
|
62
|
+
:host {
|
|
63
|
+
display: block;
|
|
64
|
+
/* --md-menu-container-color: var(--md-sys-color-surface-variant); */
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
div {
|
|
68
|
+
display: inline-block;
|
|
69
|
+
position: relative;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
profile-picture {
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
md-menu main {
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
align-items: center;
|
|
80
|
+
width: 300px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
md-menu main profile-picture {
|
|
84
|
+
margin: 24px 24px 20px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
md-menu h1 {
|
|
88
|
+
display: block;
|
|
89
|
+
font-family: Metropolis, 'Roboto', 'Noto', sans-serif;
|
|
90
|
+
font-size: 18px;
|
|
91
|
+
font-weight: 400;
|
|
92
|
+
line-height: 24px;
|
|
93
|
+
letter-spacing: 0.25px;
|
|
94
|
+
margin: 0;
|
|
95
|
+
padding: 0 24px 0 24px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
md-menu h2 {
|
|
99
|
+
display: flex;
|
|
100
|
+
font-family: Roboto, sans-serif;
|
|
101
|
+
|
|
102
|
+
font-size: 14px;
|
|
103
|
+
font-weight: 400;
|
|
104
|
+
letter-spacing: 0.25px;
|
|
105
|
+
margin: 0;
|
|
106
|
+
padding: 0 24px 12px 24px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
md-menu h2[company] {
|
|
110
|
+
padding-bottom: 12px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
md-menu slot-container {
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
md-outlined-button {
|
|
119
|
+
margin: 12px 24px 24px 24px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
md-menu footer {
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-direction: column;
|
|
125
|
+
align-items: end;
|
|
126
|
+
padding: 0 8px;
|
|
127
|
+
width: 300px;
|
|
128
|
+
}
|
|
129
|
+
`; }
|
|
130
|
+
render() {
|
|
131
|
+
return html `
|
|
132
|
+
<div
|
|
133
|
+
style=${styleMap({
|
|
134
|
+
height: `${this.size}px`,
|
|
135
|
+
width: `${this.size}px`,
|
|
136
|
+
})}
|
|
137
|
+
>
|
|
138
|
+
<profile-picture
|
|
139
|
+
id="profile-picture"
|
|
140
|
+
shape="circle"
|
|
141
|
+
.fileName=${this.profilePictureFileName}
|
|
142
|
+
.size=${this.size}
|
|
143
|
+
@click=${() => {
|
|
144
|
+
if (this.personId) {
|
|
145
|
+
this.menu.show();
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
GetUserManagerInstance().authenticateAsync();
|
|
149
|
+
}
|
|
150
|
+
}}
|
|
151
|
+
></profile-picture>
|
|
152
|
+
<md-menu y-offset="4" anchor="profile-picture" menu-corner="start-end" anchor-corner="end-end">
|
|
153
|
+
<main>
|
|
154
|
+
<profile-picture shape="circle" .fileName=${this.profilePictureFileName} size="90"></profile-picture>
|
|
155
|
+
<h1>${this.name}</h1>
|
|
156
|
+
${this.company ? html `<h2 company>${this.company}</h2>` : ''}
|
|
157
|
+
<h2>${this.email}</h2>
|
|
158
|
+
<slot-container>
|
|
159
|
+
<slot name="content"></slot>
|
|
160
|
+
</slot-container>
|
|
161
|
+
<md-outlined-button account href="https://accounts.leavitt.com/" target="_blank">Manage your Leavitt account</md-outlined-button>
|
|
162
|
+
</main>
|
|
163
|
+
<md-divider role="separator" tabindex="-1"></md-divider>
|
|
164
|
+
<footer>
|
|
165
|
+
<md-text-button @click=${() => GetUserManagerInstance().logout()}>Sign out</md-text-button>
|
|
166
|
+
</footer>
|
|
167
|
+
</md-menu>
|
|
168
|
+
</div>
|
|
169
|
+
`;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
__decorate([
|
|
173
|
+
property({ type: Number })
|
|
174
|
+
], ProfilePictureMenuElement.prototype, "size", void 0);
|
|
175
|
+
__decorate([
|
|
176
|
+
property({ type: String })
|
|
177
|
+
], ProfilePictureMenuElement.prototype, "profilePictureFileName", void 0);
|
|
178
|
+
__decorate([
|
|
179
|
+
property({ type: Number })
|
|
180
|
+
], ProfilePictureMenuElement.prototype, "personId", void 0);
|
|
181
|
+
__decorate([
|
|
182
|
+
property({ type: String })
|
|
183
|
+
], ProfilePictureMenuElement.prototype, "email", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
property({ type: String })
|
|
186
|
+
], ProfilePictureMenuElement.prototype, "company", void 0);
|
|
187
|
+
__decorate([
|
|
188
|
+
property({ type: String })
|
|
189
|
+
], ProfilePictureMenuElement.prototype, "name", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
query('md-menu')
|
|
192
|
+
], ProfilePictureMenuElement.prototype, "menu", void 0);
|
|
193
|
+
ProfilePictureMenuElement = __decorate([
|
|
194
|
+
customElement('profile-picture-menu')
|
|
195
|
+
], ProfilePictureMenuElement);
|
|
196
|
+
export { ProfilePictureMenuElement };
|
|
197
|
+
//# sourceMappingURL=profile-picture-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-picture-menu.js","sourceRoot":"","sources":["profile-picture-menu.ts"],"names":[],"mappings":";AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,yBAAyB,CAAC;AACjC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,kCAAkC,CAAC;AAE1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGvD;;;;;GAKG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,UAAU;IAAlD;;QACL;;WAEG;QACyB,SAAI,GAAW,EAAE,CAAC;QAI9C;;WAEG;QACyB,aAAQ,GAAW,CAAC,CAAC;QAEjD;;WAEG;QACyB,UAAK,GAAW,EAAE,CAAC;QAE/C;;WAEG;QACyB,YAAO,GAAW,EAAE,CAAC;QAEjD;;WAEG;QACyB,SAAI,GAAW,EAAE,CAAC;IAyIhD,CAAC;IArIC,YAAY;QACV,sBAAsB,EAAE,CAAC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jB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;aAClB;iBAAM;gBACL,sBAAsB,EAAE,CAAC,iBAAiB,EAAE,CAAC;aAC9C;QACH,CAAC;;;;wDAI6C,IAAI,CAAC,sBAAsB;kBACjE,IAAI,CAAC,IAAI;cACb,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAA,eAAe,IAAI,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,EAAE;kBACtD,IAAI,CAAC,KAAK;;;;;;;;qCAQS,GAAG,EAAE,CAAC,sBAAsB,EAAE,CAAC,MAAM,EAAE;;;;KAIvE,CAAC;IACJ,CAAC;;AA9J2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAAmB;AAElB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yEAAuC;AAKtC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2DAAsB;AAKrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAAoB;AAKnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0DAAsB;AAKrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAAmB;AAEpB;IAAzB,KAAK,CAAC,SAAS,CAAC;uDAAsB;AA5B5B,yBAAyB;IADrC,aAAa,CAAC,sBAAsB,CAAC;GACzB,yBAAyB,CAmKrC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Displays a Leavitt Group users profile picture
|
|
4
|
+
*
|
|
5
|
+
* @element profile-picture
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export declare class ProfilePictureElement extends LitElement {
|
|
9
|
+
#private;
|
|
10
|
+
/**
|
|
11
|
+
* File name of the profile picture on CDN, no extension
|
|
12
|
+
*/
|
|
13
|
+
fileName: string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Shape of profile picture
|
|
16
|
+
*/
|
|
17
|
+
shape: 'circle' | 'square';
|
|
18
|
+
/**
|
|
19
|
+
* Shows a colored ring around the picture
|
|
20
|
+
*/
|
|
21
|
+
showRing: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Makes the image a link to the respective profile page
|
|
24
|
+
*/
|
|
25
|
+
profilePictureLinkPersonId: number | null;
|
|
26
|
+
/**
|
|
27
|
+
* Size in pixels of profile picture
|
|
28
|
+
*/
|
|
29
|
+
size: number;
|
|
30
|
+
/**
|
|
31
|
+
* Setting true will cause the size attribute to only determine what size image to fetch from CDN and not set any CSS size styles on the image. Therefore the image will be displayed at its intrinsic size unless further overridden by the consumer.
|
|
32
|
+
*/
|
|
33
|
+
useIntrinsicImageSize: boolean;
|
|
34
|
+
updated(changedProps: any): void;
|
|
35
|
+
static styles: import("lit").CSSResult;
|
|
36
|
+
renderProfilePicture(): import("lit-html").TemplateResult<1>;
|
|
37
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=profile-picture.d.ts.map
|