@internetarchive/ia-book-actions 0.0.5-alpha-02 → 0.0.6-2
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/demo/index.html +53 -55
- package/package.json +1 -1
- package/src/assets/data/archive-logo.js +32 -0
- package/src/assets/data/lending-get-status-service.js +2 -337
- package/src/assets/styles/collapsible-action-group.js +22 -2
- package/src/components/book-title-bar.js +93 -0
- package/src/components/collapsible-action-group.js +25 -8
- package/src/core/config/analytics-event-and-category.js +4 -3
- package/src/core/services/actions-config.js +22 -10
- package/src/core/services/actions-handler/actions-handler-service.js +10 -27
- package/src/core/services/actions-handler/actions-handler.js +59 -6
- package/src/core/services/get-lending-actions.js +22 -31
- package/src/ia-book-actions.js +81 -19
- package/test/components/book-title-bar.test.js +39 -0
- package/test/components/collapsible-action-group.test.js +16 -0
- package/test/core/services/get-lending-actions.test.js +1 -1
- package/test/ia-book-actions.test.js +71 -31
package/demo/index.html
CHANGED
|
@@ -83,12 +83,7 @@
|
|
|
83
83
|
import '../src/ia-book-actions.js';
|
|
84
84
|
import {
|
|
85
85
|
defaultLendingStatus,
|
|
86
|
-
canBrowse,
|
|
87
|
-
browsed,
|
|
88
86
|
canBrowseAndBorrow,
|
|
89
|
-
browsedAndBorrow,
|
|
90
|
-
canBrowseAndBorrowod,
|
|
91
|
-
canBrowseAndJoinWaitlistForBorrow,
|
|
92
87
|
} from '../src/assets/data/lending-get-status-service.js';
|
|
93
88
|
|
|
94
89
|
const userid = '@neeraj-archive';
|
|
@@ -100,62 +95,76 @@
|
|
|
100
95
|
// set defaultLendingStatus for unavailable (without borrowables) book
|
|
101
96
|
iaBookActions.userid = '';
|
|
102
97
|
iaBookActions.identifier = identifier;
|
|
103
|
-
iaBookActions.
|
|
104
|
-
iaBookActions.
|
|
98
|
+
iaBookActions.bookTitle = 'Contemporary Black biography. Volume 39 : profiles from the interContemporary Black biography. Volume 39';
|
|
99
|
+
iaBookActions.lendingStatus = defaultLendingStatus;
|
|
100
|
+
iaBookActions.bwbPurchaseUrl = '';
|
|
101
|
+
iaBookActions.barType = '';
|
|
102
|
+
|
|
103
|
+
let lendingStatus1 = iaBookActions.lendingStatus;
|
|
104
|
+
|
|
105
|
+
document.querySelectorAll('.titleBar input[type=checkbox]').forEach((item) => {
|
|
106
|
+
item.addEventListener('click', (e) => {
|
|
107
|
+
if (e.target.checked) {
|
|
108
|
+
iaBookActions.barType = 'title';
|
|
109
|
+
} else {
|
|
110
|
+
iaBookActions.barType = 'action';
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
});
|
|
105
114
|
|
|
106
115
|
document.querySelectorAll('.userState input[type=checkbox]').forEach((item) => {
|
|
107
116
|
item.addEventListener('click', (e) => {
|
|
108
|
-
let lendingStatus1 = defaultLendingStatus;
|
|
109
117
|
if (e.target.checked) {
|
|
110
118
|
if (e.target.value === 'isAdmin') lendingStatus1.isAdmin = true;
|
|
111
119
|
if (e.target.value === 'isLoggedIn') iaBookActions.userid = '@neeraj';
|
|
112
|
-
}
|
|
113
|
-
if (e.target.checked === false) {
|
|
120
|
+
} else {
|
|
114
121
|
if (e.target.value === 'isAdmin') lendingStatus1.isAdmin = false;
|
|
115
122
|
if (e.target.value === 'isLoggedIn') iaBookActions.userid = '';
|
|
116
123
|
}
|
|
117
|
-
|
|
124
|
+
let lending = {...defaultLendingStatus, ...lendingStatus1};
|
|
125
|
+
iaBookActions.lendingStatus = lending;
|
|
118
126
|
});
|
|
119
127
|
});
|
|
120
128
|
|
|
121
|
-
|
|
122
129
|
document.querySelectorAll('.printDisabled input[type=checkbox]').forEach((item) => {
|
|
123
|
-
const is_printdisabled = false;
|
|
124
|
-
const user_is_printdisabled = false;
|
|
125
130
|
item.addEventListener('click', (e) => {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
lendingStatus1.
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
lendingStatus1.user_is_printdisabled =
|
|
131
|
+
if (e.target.checked) {
|
|
132
|
+
if (e.target.value === 'is_printdisabled') lendingStatus1.is_printdisabled = true;
|
|
133
|
+
if (e.target.value === 'user_is_printdisabled') lendingStatus1.user_is_printdisabled = true;
|
|
134
|
+
} else {
|
|
135
|
+
if (e.target.value === 'is_printdisabled') lendingStatus1.is_printdisabled = false;
|
|
136
|
+
if (e.target.value === 'user_is_printdisabled') lendingStatus1.user_is_printdisabled = false;
|
|
132
137
|
}
|
|
133
138
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
139
|
+
let lending = {...defaultLendingStatus, ...lendingStatus1};
|
|
140
|
+
iaBookActions.lendingStatus = lending;
|
|
137
141
|
});
|
|
138
142
|
});
|
|
139
143
|
|
|
140
144
|
document.querySelectorAll('.availableToBrowse input[type=radio]').forEach((item) => {
|
|
141
145
|
item.addEventListener('click', (e) => {
|
|
142
|
-
let lendingStatus1 = defaultLendingStatus;
|
|
143
|
-
|
|
144
146
|
if (e.target.value === 'user_has_browsed') {
|
|
145
147
|
lendingStatus1.user_has_browsed = true;
|
|
146
148
|
lendingStatus1.available_to_browse = false;
|
|
149
|
+
lendingStatus1.secondsLeftOnLoan = 10;
|
|
150
|
+
lendingStatus1.browsingExpired = false;
|
|
151
|
+
} else if(e.target.value === 'browsingExpired') {
|
|
152
|
+
lendingStatus1.user_has_browsed = true;
|
|
153
|
+
lendingStatus1.available_to_browse = false;
|
|
154
|
+
lendingStatus1.secondsLeftOnLoan = 0;
|
|
155
|
+
lendingStatus1.browsingExpired = true;
|
|
147
156
|
} else if (e.target.value === 'available_to_browse') {
|
|
148
157
|
lendingStatus1.available_to_browse = true;
|
|
149
158
|
lendingStatus1.user_has_browsed = false;
|
|
150
159
|
}
|
|
151
|
-
|
|
160
|
+
|
|
161
|
+
let lending = {...defaultLendingStatus, ...lendingStatus1};
|
|
162
|
+
iaBookActions.lendingStatus = lending;
|
|
152
163
|
});
|
|
153
164
|
});
|
|
154
165
|
|
|
155
166
|
document.querySelectorAll('.availableToBorrow input[type=radio]').forEach((item) => {
|
|
156
167
|
item.addEventListener('click', (e) => {
|
|
157
|
-
let lendingStatus1 = defaultLendingStatus;
|
|
158
|
-
|
|
159
168
|
if (e.target.value === 'available_to_borrow') {
|
|
160
169
|
lendingStatus1.available_to_borrow = true;
|
|
161
170
|
lendingStatus1.user_on_waitlist = false;
|
|
@@ -178,7 +187,8 @@
|
|
|
178
187
|
lendingStatus1.user_has_borrowed = true;
|
|
179
188
|
}
|
|
180
189
|
|
|
181
|
-
|
|
190
|
+
let lending = {...defaultLendingStatus, ...lendingStatus1};
|
|
191
|
+
iaBookActions.lendingStatus = lending;
|
|
182
192
|
});
|
|
183
193
|
});
|
|
184
194
|
|
|
@@ -196,7 +206,18 @@
|
|
|
196
206
|
|
|
197
207
|
<div>
|
|
198
208
|
<fieldset>
|
|
199
|
-
<legend>Dev
|
|
209
|
+
<legend>Dev testing for book title bar</legend>
|
|
210
|
+
<table class="initial">
|
|
211
|
+
<tr>
|
|
212
|
+
<td class="titleBar">
|
|
213
|
+
<label><input type="checkbox" name="title" value="title" />Title Bar</label>
|
|
214
|
+
</td>
|
|
215
|
+
</tr>
|
|
216
|
+
</table>
|
|
217
|
+
</fieldset>
|
|
218
|
+
|
|
219
|
+
<fieldset>
|
|
220
|
+
<legend>Dev testing for book action bar</legend>
|
|
200
221
|
<table class="initial">
|
|
201
222
|
<tr>
|
|
202
223
|
<td class="userState">
|
|
@@ -210,6 +231,7 @@
|
|
|
210
231
|
<td class="availableToBrowse">
|
|
211
232
|
<label><input type="radio" name="browse" value="available_to_browse" />available_to_browse</label>
|
|
212
233
|
<label><input type="radio" name="browse" value="user_has_browsed" />user_has_browsed</label>
|
|
234
|
+
<label><input type="radio" name="browse" value="browsingExpired" />browsingExpired</label>
|
|
213
235
|
</td>
|
|
214
236
|
<td class="availableToBorrow">
|
|
215
237
|
<label><input type="radio" name="borrow" value="available_to_borrow" />available_to_borrow</label>
|
|
@@ -218,7 +240,7 @@
|
|
|
218
240
|
<label><input type="radio" name="borrow" value="user_has_borrowed" />user_has_borrowed</label>
|
|
219
241
|
</td>
|
|
220
242
|
<td class="purchase">
|
|
221
|
-
<label><input type="checkbox" name="purchase" value="purchase" />purchase
|
|
243
|
+
<label><input type="checkbox" name="purchase" value="purchase" />purchase</label>
|
|
222
244
|
</td>
|
|
223
245
|
|
|
224
246
|
<td class="reflect">
|
|
@@ -229,30 +251,6 @@
|
|
|
229
251
|
</td>
|
|
230
252
|
</tr>
|
|
231
253
|
</table>
|
|
232
|
-
|
|
233
|
-
<table class="mode" style="display: none;">
|
|
234
|
-
<tr>
|
|
235
|
-
<td>
|
|
236
|
-
<label><input type="radio" name="contact" value="canBrowse" />CanBrowse</label>
|
|
237
|
-
</td>
|
|
238
|
-
<td>
|
|
239
|
-
<label><input type="radio" name="contact" value="browsed" />browsed</label>
|
|
240
|
-
</td>
|
|
241
|
-
<td>
|
|
242
|
-
<label><input type="radio" name="contact" value="canBrowseAndBorrow" />canBrowseAndBorrow</label>
|
|
243
|
-
</td>
|
|
244
|
-
<td>
|
|
245
|
-
<label><input type="radio" name="contact" value="browsedAndBorrow" />browsedAndBorrow</label>
|
|
246
|
-
</td>
|
|
247
|
-
<td>
|
|
248
|
-
<label><input type="radio" name="contact" value="canBrowseAndBorrowod" />canBrowseAndBorrowod</label>
|
|
249
|
-
</td>
|
|
250
|
-
<td>
|
|
251
|
-
<label><input type="radio" name="contact"
|
|
252
|
-
id="canBrowseAndJoinWaitlistForBorrow" value="canBrowseAndJoinWaitlistForBorrow" />canBrowseAndJoinWaitlistForBorrow</label>
|
|
253
|
-
</td>
|
|
254
|
-
</tr>
|
|
255
|
-
</table>
|
|
256
254
|
</fieldset>
|
|
257
255
|
</div>
|
|
258
256
|
</body>
|
package/package.json
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { html } from 'lit-element';
|
|
2
|
+
|
|
3
|
+
export const archiveLogo = html`
|
|
4
|
+
<svg
|
|
5
|
+
class="ia-logo"
|
|
6
|
+
width="26"
|
|
7
|
+
height="26"
|
|
8
|
+
viewBox="0 0 27 30"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
aria-labelledby="logoTitleID logoDescID"
|
|
11
|
+
>
|
|
12
|
+
<title id="logoTitleID">Internet Archive logo</title>
|
|
13
|
+
<desc id="logoDescID">
|
|
14
|
+
A line drawing of the Internet Archive headquarters building façade.
|
|
15
|
+
</desc>
|
|
16
|
+
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
17
|
+
<mask id="mask-2" fill="white">
|
|
18
|
+
<path
|
|
19
|
+
d="M26.6666667,28.6046512 L26.6666667,30 L0,30 L0.000283687943,28.6046512 L26.6666667,28.6046512 Z M25.6140351,26.5116279 L25.6140351,28.255814 L1.05263158,28.255814 L1.05263158,26.5116279 L25.6140351,26.5116279 Z M3.62469203,7.6744186 L3.91746909,7.82153285 L4.0639977,10.1739544 L4.21052632,13.9963932 L4.21052632,17.6725617 L4.0639977,22.255044 L4.03962296,25.3421929 L3.62469203,25.4651163 L2.16024641,25.4651163 L1.72094074,25.3421929 L1.55031755,22.255044 L1.40350877,17.6970339 L1.40350877,14.0211467 L1.55031755,10.1739544 L1.68423854,7.80887484 L1.98962322,7.6744186 L3.62469203,7.6744186 Z M24.6774869,7.6744186 L24.9706026,7.82153285 L25.1168803,10.1739544 L25.2631579,13.9963932 L25.2631579,17.6725617 L25.1168803,22.255044 L25.0927809,25.3421929 L24.6774869,25.4651163 L23.2130291,25.4651163 L22.7736357,25.3421929 L22.602418,22.255044 L22.4561404,17.6970339 L22.4561404,14.0211467 L22.602418,10.1739544 L22.7369262,7.80887484 L23.0420916,7.6744186 L24.6774869,7.6744186 Z M9.94042303,7.6744186 L10.2332293,7.82153285 L10.3797725,10.1739544 L10.5263158,13.9963932 L10.5263158,17.6725617 L10.3797725,22.255044 L10.3556756,25.3421929 L9.94042303,25.4651163 L8.47583122,25.4651163 L8.0362015,25.3421929 L7.86556129,22.255044 L7.71929825,17.6970339 L7.71929825,14.0211467 L7.86556129,10.1739544 L8.00005604,7.80887484 L8.30491081,7.6744186 L9.94042303,7.6744186 Z M18.0105985,7.6744186 L18.3034047,7.82153285 L18.449948,10.1739544 L18.5964912,13.9963932 L18.5964912,17.6725617 L18.449948,22.255044 L18.425851,25.3421929 L18.0105985,25.4651163 L16.5460067,25.4651163 L16.1066571,25.3421929 L15.9357367,22.255044 L15.7894737,17.6970339 L15.7894737,14.0211467 L15.9357367,10.1739544 L16.0702315,7.80887484 L16.3753664,7.6744186 L18.0105985,7.6744186 Z M25.6140351,4.53488372 L25.6140351,6.97674419 L1.05263158,6.97674419 L1.05263158,4.53488372 L25.6140351,4.53488372 Z M13.0806755,0 L25.9649123,2.93331338 L25.4484139,3.8372093 L0.771925248,3.8372093 L0,3.1041615 L13.0806755,0 Z"
|
|
20
|
+
id="path-1"
|
|
21
|
+
></path>
|
|
22
|
+
</mask>
|
|
23
|
+
<use fill="#FFFFFF" xlink:href="#path-1"></use>
|
|
24
|
+
<g mask="url(#mask-2)" fill="#FFFFFF">
|
|
25
|
+
<path
|
|
26
|
+
d="M0,0 L26.6666667,0 L26.6666667,30 L0,30 L0,0 Z"
|
|
27
|
+
id="swatch"
|
|
28
|
+
></path>
|
|
29
|
+
</g>
|
|
30
|
+
</g>
|
|
31
|
+
</svg>
|
|
32
|
+
`;
|
|
@@ -34,6 +34,7 @@ export const defaultLendingStatus = {
|
|
|
34
34
|
users_on_waitlist: 0,
|
|
35
35
|
// userid: "",
|
|
36
36
|
bookUrl: '/details/practicalorganic00plim',
|
|
37
|
+
browsingExpired: false,
|
|
37
38
|
daysLeftOnLoan: 0,
|
|
38
39
|
isAdmin: false,
|
|
39
40
|
isArchiveOrgLending: true,
|
|
@@ -47,7 +48,7 @@ export const defaultLendingStatus = {
|
|
|
47
48
|
loanRecord: [],
|
|
48
49
|
loansUrl: '/details/@neeraj-archive?tab=loans#loans-on-loan',
|
|
49
50
|
maxLoans: 10,
|
|
50
|
-
secondsLeftOnLoan:
|
|
51
|
+
secondsLeftOnLoan: 10,
|
|
51
52
|
shouldProtectImages: true,
|
|
52
53
|
totalWaitlistCount: 0,
|
|
53
54
|
userHasBorrowed: false,
|
|
@@ -58,139 +59,6 @@ export const defaultLendingStatus = {
|
|
|
58
59
|
userWaitlistPosition: -1,
|
|
59
60
|
userid: '@neeraj-archive',
|
|
60
61
|
};
|
|
61
|
-
|
|
62
|
-
export const canBrowse = {
|
|
63
|
-
active_borrows: 0,
|
|
64
|
-
active_browses: 0,
|
|
65
|
-
available_borrowable_copies: 0,
|
|
66
|
-
available_browsable_copies: 1,
|
|
67
|
-
available_lendable_copies: 1,
|
|
68
|
-
available_to_borrow: false,
|
|
69
|
-
available_to_browse: true,
|
|
70
|
-
available_to_waitlist: false,
|
|
71
|
-
copies_reserved_for_waitlist: 0,
|
|
72
|
-
is_lendable: true,
|
|
73
|
-
is_login_required: false,
|
|
74
|
-
is_printdisabled: true,
|
|
75
|
-
is_readable: false,
|
|
76
|
-
last_borrow: null,
|
|
77
|
-
last_browse: null,
|
|
78
|
-
last_waitlist: null,
|
|
79
|
-
max_borrowable_copies: 0,
|
|
80
|
-
max_browsable_copies: 1,
|
|
81
|
-
max_lendable_copies: 1,
|
|
82
|
-
next_borrow_expiration: null,
|
|
83
|
-
next_browse_expiration: null,
|
|
84
|
-
orphaned_acs_loans: 0,
|
|
85
|
-
upgradable_browses: 0,
|
|
86
|
-
user_at_max_loans: false,
|
|
87
|
-
user_can_claim_waitlist: false,
|
|
88
|
-
user_has_acs_borrowed: false,
|
|
89
|
-
user_has_borrowed: false,
|
|
90
|
-
user_has_browsed: false,
|
|
91
|
-
user_is_printdisabled: false,
|
|
92
|
-
user_loan_count: 0,
|
|
93
|
-
user_loan_record: [],
|
|
94
|
-
user_on_waitlist: false,
|
|
95
|
-
users_on_waitlist: 0,
|
|
96
|
-
// userid: "",
|
|
97
|
-
bookUrl: '/details/practicalorganic00plim',
|
|
98
|
-
daysLeftOnLoan: 0,
|
|
99
|
-
isAdmin: false,
|
|
100
|
-
isArchiveOrgLending: true,
|
|
101
|
-
isAvailable: false,
|
|
102
|
-
isAvailableForBrowsing: true,
|
|
103
|
-
isBrowserBorrowable: true,
|
|
104
|
-
isLendingRequired: true,
|
|
105
|
-
isOpenLibraryLending: false,
|
|
106
|
-
isPrintDisabledOnly: false,
|
|
107
|
-
loanCount: 0,
|
|
108
|
-
loanRecord: [],
|
|
109
|
-
loansUrl: '/details/@neeraj-archive?tab=loans#loans-on-loan',
|
|
110
|
-
maxLoans: 10,
|
|
111
|
-
secondsLeftOnLoan: 0,
|
|
112
|
-
shouldProtectImages: true,
|
|
113
|
-
totalWaitlistCount: 0,
|
|
114
|
-
userHasBorrowed: false,
|
|
115
|
-
userHasBrowsed: false,
|
|
116
|
-
userHoldIsReady: false,
|
|
117
|
-
userIsPrintDisabled: false,
|
|
118
|
-
userOnWaitingList: false,
|
|
119
|
-
userWaitlistPosition: -1,
|
|
120
|
-
userid: '@neeraj-archive',
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
export const browsed = {
|
|
124
|
-
active_borrows: 0,
|
|
125
|
-
active_browses: 1,
|
|
126
|
-
available_borrowable_copies: 0,
|
|
127
|
-
available_browsable_copies: 0,
|
|
128
|
-
available_lendable_copies: 0,
|
|
129
|
-
available_to_borrow: false,
|
|
130
|
-
available_to_browse: false,
|
|
131
|
-
available_to_waitlist: false,
|
|
132
|
-
copies_reserved_for_waitlist: 0,
|
|
133
|
-
is_lendable: true,
|
|
134
|
-
is_login_required: false,
|
|
135
|
-
is_printdisabled: true,
|
|
136
|
-
is_readable: false,
|
|
137
|
-
last_borrow: null,
|
|
138
|
-
last_browse: '2021-07-30 09:57:40',
|
|
139
|
-
last_waitlist: null,
|
|
140
|
-
max_borrowable_copies: 0,
|
|
141
|
-
max_browsable_copies: 1,
|
|
142
|
-
max_lendable_copies: 1,
|
|
143
|
-
next_borrow_expiration: null,
|
|
144
|
-
next_browse_expiration: '2021-07-30 10:57:40',
|
|
145
|
-
orphaned_acs_loans: 0,
|
|
146
|
-
upgradable_browses: 0,
|
|
147
|
-
user_at_max_loans: false,
|
|
148
|
-
user_can_claim_waitlist: false,
|
|
149
|
-
user_has_acs_borrowed: false,
|
|
150
|
-
user_has_borrowed: false,
|
|
151
|
-
user_has_browsed: true,
|
|
152
|
-
user_is_printdisabled: false,
|
|
153
|
-
user_loan_count: 1,
|
|
154
|
-
user_loan_record: {
|
|
155
|
-
userid: '@neeraj-archive',
|
|
156
|
-
listname: 'loan',
|
|
157
|
-
identifier: 'practicalorganic00plim',
|
|
158
|
-
},
|
|
159
|
-
user_on_waitlist: false,
|
|
160
|
-
users_on_waitlist: 0,
|
|
161
|
-
// userid: "",
|
|
162
|
-
bookUrl: '/details/practicalorganic00plim',
|
|
163
|
-
daysLeftOnLoan: 0,
|
|
164
|
-
isAdmin: false,
|
|
165
|
-
isArchiveOrgLending: true,
|
|
166
|
-
isAvailable: false,
|
|
167
|
-
isAvailableForBrowsing: false,
|
|
168
|
-
isBrowserBorrowable: true,
|
|
169
|
-
isLendingRequired: true,
|
|
170
|
-
isOpenLibraryLending: false,
|
|
171
|
-
isPrintDisabledOnly: false,
|
|
172
|
-
loanCount: 1,
|
|
173
|
-
loanId: '1ca15f92d07dfdae3f7b1516084aec5d603800b8',
|
|
174
|
-
loanRecord: {
|
|
175
|
-
userid: '@neeraj-archive',
|
|
176
|
-
listname: 'loan',
|
|
177
|
-
identifier: 'practicalorganic00plim',
|
|
178
|
-
},
|
|
179
|
-
loanStartDate: '2021-07-30 09:57:40',
|
|
180
|
-
loansUrl: '/details/@neeraj-archive?tab=loans#loans-on-loan',
|
|
181
|
-
maxLoans: 10,
|
|
182
|
-
secondsLeftOnLoan: 3591,
|
|
183
|
-
shouldProtectImages: true,
|
|
184
|
-
totalWaitlistCount: 0,
|
|
185
|
-
userHasBorrowed: false,
|
|
186
|
-
userHasBrowsed: true,
|
|
187
|
-
userHoldIsReady: false,
|
|
188
|
-
userIsPrintDisabled: false,
|
|
189
|
-
userOnWaitingList: false,
|
|
190
|
-
userWaitlistPosition: -1,
|
|
191
|
-
userid: '@neeraj-archive',
|
|
192
|
-
};
|
|
193
|
-
|
|
194
62
|
export const canBrowseAndBorrow = {
|
|
195
63
|
active_borrows: 0,
|
|
196
64
|
active_browses: 1,
|
|
@@ -261,206 +129,3 @@ export const canBrowseAndBorrow = {
|
|
|
261
129
|
userWaitlistPosition: -1,
|
|
262
130
|
userid: '@neeraj-archive',
|
|
263
131
|
};
|
|
264
|
-
|
|
265
|
-
export const browsedAndBorrow = {
|
|
266
|
-
active_borrows: 0,
|
|
267
|
-
active_browses: 1,
|
|
268
|
-
available_borrowable_copies: 0,
|
|
269
|
-
available_browsable_copies: 0,
|
|
270
|
-
available_lendable_copies: 0,
|
|
271
|
-
available_to_borrow: true,
|
|
272
|
-
available_to_browse: true,
|
|
273
|
-
available_to_waitlist: false,
|
|
274
|
-
copies_reserved_for_waitlist: 0,
|
|
275
|
-
is_lendable: true,
|
|
276
|
-
is_login_required: false,
|
|
277
|
-
is_printdisabled: true,
|
|
278
|
-
is_readable: false,
|
|
279
|
-
last_borrow: null,
|
|
280
|
-
last_browse: '2021-07-30 09:57:40',
|
|
281
|
-
last_waitlist: null,
|
|
282
|
-
max_borrowable_copies: 0,
|
|
283
|
-
max_browsable_copies: 1,
|
|
284
|
-
max_lendable_copies: 1,
|
|
285
|
-
next_borrow_expiration: null,
|
|
286
|
-
next_browse_expiration: '2021-07-30 10:57:40',
|
|
287
|
-
orphaned_acs_loans: 0,
|
|
288
|
-
upgradable_browses: 0,
|
|
289
|
-
user_at_max_loans: false,
|
|
290
|
-
user_can_claim_waitlist: false,
|
|
291
|
-
user_has_acs_borrowed: false,
|
|
292
|
-
user_has_borrowed: false,
|
|
293
|
-
user_has_browsed: true,
|
|
294
|
-
user_is_printdisabled: false,
|
|
295
|
-
user_loan_count: 1,
|
|
296
|
-
user_loan_record: {
|
|
297
|
-
userid: '@neeraj-archive',
|
|
298
|
-
listname: 'loan',
|
|
299
|
-
identifier: 'practicalorganic00plim',
|
|
300
|
-
},
|
|
301
|
-
user_on_waitlist: false,
|
|
302
|
-
users_on_waitlist: 0,
|
|
303
|
-
// userid: "",
|
|
304
|
-
bookUrl: '/details/practicalorganic00plim',
|
|
305
|
-
daysLeftOnLoan: 0,
|
|
306
|
-
isAdmin: false,
|
|
307
|
-
isArchiveOrgLending: true,
|
|
308
|
-
isAvailable: false,
|
|
309
|
-
isAvailableForBrowsing: false,
|
|
310
|
-
isBrowserBorrowable: true,
|
|
311
|
-
isLendingRequired: true,
|
|
312
|
-
isOpenLibraryLending: false,
|
|
313
|
-
isPrintDisabledOnly: false,
|
|
314
|
-
loanCount: 1,
|
|
315
|
-
loanId: '1ca15f92d07dfdae3f7b1516084aec5d603800b8',
|
|
316
|
-
loanRecord: {
|
|
317
|
-
userid: '@neeraj-archive',
|
|
318
|
-
listname: 'loan',
|
|
319
|
-
identifier: 'practicalorganic00plim',
|
|
320
|
-
},
|
|
321
|
-
loanStartDate: '2021-07-30 09:57:40',
|
|
322
|
-
loansUrl: '/details/@neeraj-archive?tab=loans#loans-on-loan',
|
|
323
|
-
maxLoans: 10,
|
|
324
|
-
secondsLeftOnLoan: 3591,
|
|
325
|
-
shouldProtectImages: true,
|
|
326
|
-
totalWaitlistCount: 0,
|
|
327
|
-
userHasBorrowed: false,
|
|
328
|
-
userHasBrowsed: true,
|
|
329
|
-
userHoldIsReady: false,
|
|
330
|
-
userIsPrintDisabled: false,
|
|
331
|
-
userOnWaitingList: false,
|
|
332
|
-
userWaitlistPosition: -1,
|
|
333
|
-
userid: '@neeraj-archive',
|
|
334
|
-
};
|
|
335
|
-
|
|
336
|
-
export const canBrowseAndBorrowod = {
|
|
337
|
-
active_borrows: 0,
|
|
338
|
-
active_browses: 1,
|
|
339
|
-
available_borrowable_copies: 0,
|
|
340
|
-
available_browsable_copies: 0,
|
|
341
|
-
available_lendable_copies: 0,
|
|
342
|
-
available_to_borrow: true,
|
|
343
|
-
available_to_browse: true,
|
|
344
|
-
available_to_waitlist: false,
|
|
345
|
-
copies_reserved_for_waitlist: 0,
|
|
346
|
-
is_lendable: true,
|
|
347
|
-
is_login_required: false,
|
|
348
|
-
is_printdisabled: true,
|
|
349
|
-
is_readable: false,
|
|
350
|
-
last_borrow: null,
|
|
351
|
-
last_browse: '2021-07-30 09:57:40',
|
|
352
|
-
last_waitlist: null,
|
|
353
|
-
max_borrowable_copies: 0,
|
|
354
|
-
max_browsable_copies: 1,
|
|
355
|
-
max_lendable_copies: 1,
|
|
356
|
-
next_borrow_expiration: null,
|
|
357
|
-
next_browse_expiration: '2021-07-30 10:57:40',
|
|
358
|
-
orphaned_acs_loans: 0,
|
|
359
|
-
upgradable_browses: 0,
|
|
360
|
-
user_at_max_loans: false,
|
|
361
|
-
user_can_claim_waitlist: false,
|
|
362
|
-
user_has_acs_borrowed: false,
|
|
363
|
-
user_has_borrowed: true,
|
|
364
|
-
user_has_browsed: false,
|
|
365
|
-
user_is_printdisabled: false,
|
|
366
|
-
user_loan_count: 1,
|
|
367
|
-
user_loan_record: {
|
|
368
|
-
userid: '@neeraj-archive',
|
|
369
|
-
listname: 'loan',
|
|
370
|
-
identifier: 'practicalorganic00plim',
|
|
371
|
-
},
|
|
372
|
-
user_on_waitlist: false,
|
|
373
|
-
users_on_waitlist: 0,
|
|
374
|
-
// userid: "",
|
|
375
|
-
bookUrl: '/details/practicalorganic00plim',
|
|
376
|
-
daysLeftOnLoan: 0,
|
|
377
|
-
isAdmin: false,
|
|
378
|
-
isArchiveOrgLending: true,
|
|
379
|
-
isAvailable: false,
|
|
380
|
-
isAvailableForBrowsing: false,
|
|
381
|
-
isBrowserBorrowable: true,
|
|
382
|
-
isLendingRequired: true,
|
|
383
|
-
isOpenLibraryLending: false,
|
|
384
|
-
isPrintDisabledOnly: false,
|
|
385
|
-
loanCount: 1,
|
|
386
|
-
loanId: '1ca15f92d07dfdae3f7b1516084aec5d603800b8',
|
|
387
|
-
loanRecord: {
|
|
388
|
-
userid: '@neeraj-archive',
|
|
389
|
-
listname: 'loan',
|
|
390
|
-
identifier: 'practicalorganic00plim',
|
|
391
|
-
},
|
|
392
|
-
loanStartDate: '2021-07-30 09:57:40',
|
|
393
|
-
loansUrl: '/details/@neeraj-archive?tab=loans#loans-on-loan',
|
|
394
|
-
maxLoans: 10,
|
|
395
|
-
secondsLeftOnLoan: 3591,
|
|
396
|
-
shouldProtectImages: true,
|
|
397
|
-
totalWaitlistCount: 0,
|
|
398
|
-
userHasBorrowed: false,
|
|
399
|
-
userHasBrowsed: true,
|
|
400
|
-
userHoldIsReady: false,
|
|
401
|
-
userIsPrintDisabled: false,
|
|
402
|
-
userOnWaitingList: false,
|
|
403
|
-
userWaitlistPosition: -1,
|
|
404
|
-
userid: '@neeraj-archive',
|
|
405
|
-
};
|
|
406
|
-
|
|
407
|
-
export const canBrowseAndJoinWaitlistForBorrow = {
|
|
408
|
-
active_borrows: 1,
|
|
409
|
-
active_browses: 0,
|
|
410
|
-
available_borrowable_copies: 0,
|
|
411
|
-
available_browsable_copies: 1,
|
|
412
|
-
available_lendable_copies: 1,
|
|
413
|
-
available_to_borrow: false,
|
|
414
|
-
available_to_browse: true,
|
|
415
|
-
available_to_waitlist: true,
|
|
416
|
-
copies_reserved_for_waitlist: 0,
|
|
417
|
-
is_lendable: true,
|
|
418
|
-
is_login_required: false,
|
|
419
|
-
is_printdisabled: true,
|
|
420
|
-
is_readable: false,
|
|
421
|
-
last_borrow: '2021-07-24 18:17:46',
|
|
422
|
-
last_browse: null,
|
|
423
|
-
last_waitlist: '2021-07-27 11:03:23',
|
|
424
|
-
max_borrowable_copies: 1,
|
|
425
|
-
max_browsable_copies: 2,
|
|
426
|
-
max_lendable_copies: 2,
|
|
427
|
-
next_borrow_expiration: '2021-08-02 18:29:41',
|
|
428
|
-
next_browse_expiration: null,
|
|
429
|
-
orphaned_acs_loans: 0,
|
|
430
|
-
upgradable_browses: 0,
|
|
431
|
-
user_at_max_loans: false,
|
|
432
|
-
user_can_claim_waitlist: false,
|
|
433
|
-
user_has_acs_borrowed: false,
|
|
434
|
-
user_has_borrowed: false,
|
|
435
|
-
user_has_browsed: false,
|
|
436
|
-
user_is_printdisabled: false,
|
|
437
|
-
user_loan_count: 0,
|
|
438
|
-
user_loan_record: [],
|
|
439
|
-
user_on_waitlist: false,
|
|
440
|
-
users_on_waitlist: 2,
|
|
441
|
-
// userid: "",
|
|
442
|
-
bookUrl: '/details/worldletitutio0000vish',
|
|
443
|
-
daysLeftOnLoan: 0,
|
|
444
|
-
isAdmin: false,
|
|
445
|
-
isArchiveOrgLending: true,
|
|
446
|
-
isAvailable: false,
|
|
447
|
-
isAvailableForBrowsing: true,
|
|
448
|
-
isBrowserBorrowable: true,
|
|
449
|
-
isLendingRequired: true,
|
|
450
|
-
isOpenLibraryLending: false,
|
|
451
|
-
isPrintDisabledOnly: false,
|
|
452
|
-
loanCount: 0,
|
|
453
|
-
loanRecord: [],
|
|
454
|
-
loansUrl: '/details/@neeraj-archive?tab=loans#loans-on-loan',
|
|
455
|
-
maxLoans: 10,
|
|
456
|
-
secondsLeftOnLoan: 0,
|
|
457
|
-
shouldProtectImages: true,
|
|
458
|
-
totalWaitlistCount: 2,
|
|
459
|
-
userHasBorrowed: false,
|
|
460
|
-
userHasBrowsed: false,
|
|
461
|
-
userHoldIsReady: false,
|
|
462
|
-
userIsPrintDisabled: false,
|
|
463
|
-
userOnWaitingList: false,
|
|
464
|
-
userWaitlistPosition: -1,
|
|
465
|
-
userid: '@neeraj-archive',
|
|
466
|
-
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { css } from 'lit-element';
|
|
2
2
|
|
|
3
3
|
export default css`
|
|
4
|
+
:host {
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
height: 3.5rem;
|
|
7
|
+
padding: 1rem 0;
|
|
8
|
+
}
|
|
4
9
|
.action-buttons {
|
|
5
10
|
display: inline-flex;
|
|
6
11
|
align-items: center;
|
|
@@ -53,10 +58,20 @@ export default css`
|
|
|
53
58
|
padding: 0.6rem 1.2rem;
|
|
54
59
|
margin: 0;
|
|
55
60
|
}
|
|
61
|
+
.dropdown-content li .ia-button {
|
|
62
|
+
border-radius: 0;
|
|
63
|
+
}
|
|
56
64
|
.dropdown-content li .ia-button:hover {
|
|
57
65
|
background: var(--primaryTextColor);
|
|
58
66
|
color: rgb(45, 45, 45);
|
|
59
67
|
}
|
|
68
|
+
.dropdown-content li:first-child .ia-button {
|
|
69
|
+
border-radius: 0.3rem 0.3rem 0 0;
|
|
70
|
+
}
|
|
71
|
+
.dropdown-content li:last-child .ia-button {
|
|
72
|
+
border-radius: 0;
|
|
73
|
+
border-radius: 0 0 0.3rem 0.3rem;
|
|
74
|
+
}
|
|
60
75
|
.dropdown-content .purchase:hover svg g {
|
|
61
76
|
fill: black;
|
|
62
77
|
}
|
|
@@ -65,7 +80,7 @@ export default css`
|
|
|
65
80
|
padding: 0 0.6rem;
|
|
66
81
|
margin-left: 0;
|
|
67
82
|
}
|
|
68
|
-
.
|
|
83
|
+
.actionloader {
|
|
69
84
|
vertical-align: middle;
|
|
70
85
|
visibility: hidden;
|
|
71
86
|
padding: 0.9rem 0.2rem;
|
|
@@ -114,9 +129,14 @@ export default css`
|
|
|
114
129
|
display: initial;
|
|
115
130
|
font-size: 1.4rem;
|
|
116
131
|
}
|
|
117
|
-
|
|
118
132
|
.unavailable {
|
|
119
133
|
opacity: 0.7;
|
|
120
134
|
pointer-events: none;
|
|
121
135
|
}
|
|
136
|
+
|
|
137
|
+
.disabled {
|
|
138
|
+
opacity: 0.8;
|
|
139
|
+
pointer-events: none;
|
|
140
|
+
visibility: visible;
|
|
141
|
+
}
|
|
122
142
|
`;
|