@esri/solutions-components 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (314) hide show
  1. package/dist/cjs/deduct-calculator.cjs.entry.js +1 -1
  2. package/dist/cjs/pci-calculator.cjs.entry.js +1 -1
  3. package/dist/cjs/{pciUtils-6a806ba4.js → pciUtils-423cfc68.js} +25 -7
  4. package/dist/collection/demos/deduct-calculator.html +2 -5
  5. package/dist/collection/demos/new-public-notification.html +6 -4
  6. package/dist/collection/utils/pciUtils.js +25 -7
  7. package/dist/collection/utils/pciUtils.ts +30 -7
  8. package/dist/components/ExpandToggle.js +110 -0
  9. package/dist/components/Heading.js +22 -0
  10. package/dist/components/_commonjsHelpers.js +22 -0
  11. package/dist/components/action-bar.js +276 -0
  12. package/dist/components/action-group.js +149 -0
  13. package/dist/components/action-menu.js +356 -0
  14. package/dist/components/action.js +214 -0
  15. package/dist/components/add-record-modal.d.ts +11 -0
  16. package/dist/components/add-record-modal.js +171 -0
  17. package/dist/components/array.js +15 -0
  18. package/dist/components/block.js +272 -0
  19. package/dist/components/buffer-tools.d.ts +11 -0
  20. package/dist/components/buffer-tools.js +11 -0
  21. package/dist/components/buffer-tools2.js +262 -0
  22. package/dist/components/button.js +263 -0
  23. package/dist/components/calcite-accordion-item.js +244 -0
  24. package/dist/components/calcite-accordion.js +180 -0
  25. package/dist/components/calcite-action-bar.js +11 -0
  26. package/dist/components/calcite-action-group.js +11 -0
  27. package/dist/components/calcite-action-menu.js +11 -0
  28. package/dist/components/calcite-action-pad.js +197 -0
  29. package/dist/components/calcite-action.js +11 -0
  30. package/dist/components/calcite-alert.js +297 -0
  31. package/dist/components/calcite-avatar.js +182 -0
  32. package/dist/components/calcite-block-section.js +155 -0
  33. package/dist/components/calcite-block.js +11 -0
  34. package/dist/components/calcite-button.js +11 -0
  35. package/dist/components/calcite-card.js +187 -0
  36. package/dist/components/calcite-checkbox.js +11 -0
  37. package/dist/components/calcite-chip.js +11 -0
  38. package/dist/components/calcite-color-picker-hex-input.js +11 -0
  39. package/dist/components/calcite-color-picker-swatch.js +11 -0
  40. package/dist/components/calcite-color-picker.js +1036 -0
  41. package/dist/components/calcite-combobox-item-group.js +75 -0
  42. package/dist/components/calcite-combobox-item.js +11 -0
  43. package/dist/components/calcite-combobox.js +11 -0
  44. package/dist/components/calcite-date-picker-day.js +11 -0
  45. package/dist/components/calcite-date-picker-month-header.js +11 -0
  46. package/dist/components/calcite-date-picker-month.js +11 -0
  47. package/dist/components/calcite-date-picker.js +11 -0
  48. package/dist/components/calcite-dropdown-group.js +11 -0
  49. package/dist/components/calcite-dropdown-item.js +11 -0
  50. package/dist/components/calcite-dropdown.js +11 -0
  51. package/dist/components/calcite-fab.js +144 -0
  52. package/dist/components/calcite-filter.js +195 -0
  53. package/dist/components/calcite-flow-item.js +243 -0
  54. package/dist/components/calcite-flow.js +147 -0
  55. package/dist/components/calcite-graph.js +11 -0
  56. package/dist/components/calcite-handle.js +11 -0
  57. package/dist/components/calcite-icon.js +11 -0
  58. package/dist/components/calcite-inline-editable.js +294 -0
  59. package/dist/components/calcite-input-date-picker.js +713 -0
  60. package/dist/components/calcite-input-message.js +11 -0
  61. package/dist/components/calcite-input-number.js +637 -0
  62. package/dist/components/calcite-input-text.js +400 -0
  63. package/dist/components/calcite-input-time-picker.js +434 -0
  64. package/dist/components/calcite-input.js +11 -0
  65. package/dist/components/calcite-label.js +11 -0
  66. package/dist/components/calcite-link.js +11 -0
  67. package/dist/components/calcite-list-item-group.js +65 -0
  68. package/dist/components/calcite-list-item.js +11 -0
  69. package/dist/components/calcite-list.js +11 -0
  70. package/dist/components/calcite-loader.js +11 -0
  71. package/dist/components/calcite-modal.js +11 -0
  72. package/dist/components/calcite-notice.js +11 -0
  73. package/dist/components/calcite-option-group.js +64 -0
  74. package/dist/components/calcite-option.js +11 -0
  75. package/dist/components/calcite-pagination.js +258 -0
  76. package/dist/components/calcite-panel.js +11 -0
  77. package/dist/components/calcite-pick-list-group.js +74 -0
  78. package/dist/components/calcite-pick-list-item.js +11 -0
  79. package/dist/components/calcite-pick-list.js +11 -0
  80. package/dist/components/calcite-popover-manager.js +94 -0
  81. package/dist/components/calcite-popover.js +11 -0
  82. package/dist/components/calcite-progress.js +11 -0
  83. package/dist/components/calcite-radio-button-group.js +132 -0
  84. package/dist/components/calcite-radio-button.js +310 -0
  85. package/dist/components/calcite-radio-group-item.js +11 -0
  86. package/dist/components/calcite-radio-group.js +11 -0
  87. package/dist/components/calcite-rating.js +201 -0
  88. package/dist/components/calcite-scrim.js +11 -0
  89. package/dist/components/calcite-select.js +11 -0
  90. package/dist/components/calcite-shell-center-row.js +100 -0
  91. package/dist/components/calcite-shell-panel.js +11 -0
  92. package/dist/components/calcite-shell.js +11 -0
  93. package/dist/components/calcite-slider.js +11 -0
  94. package/dist/components/calcite-sortable-list.js +202 -0
  95. package/dist/components/calcite-split-button.js +11 -0
  96. package/dist/components/calcite-stepper-item.js +271 -0
  97. package/dist/components/calcite-stepper.js +256 -0
  98. package/dist/components/calcite-switch.js +11 -0
  99. package/dist/components/calcite-tab-nav.js +11 -0
  100. package/dist/components/calcite-tab-title.js +11 -0
  101. package/dist/components/calcite-tab.js +11 -0
  102. package/dist/components/calcite-tabs.js +11 -0
  103. package/dist/components/calcite-tile-select-group.js +65 -0
  104. package/dist/components/calcite-tile-select.js +266 -0
  105. package/dist/components/calcite-tile.js +11 -0
  106. package/dist/components/calcite-time-picker.js +11 -0
  107. package/dist/components/calcite-tip-group.js +41 -0
  108. package/dist/components/calcite-tip-manager.js +223 -0
  109. package/dist/components/calcite-tip.js +162 -0
  110. package/dist/components/calcite-tooltip-manager.js +57 -0
  111. package/dist/components/calcite-tooltip.js +11 -0
  112. package/dist/components/calcite-tree-item.js +11 -0
  113. package/dist/components/calcite-tree.js +11 -0
  114. package/dist/components/calcite-value-list-item.js +11 -0
  115. package/dist/components/calcite-value-list.js +11 -0
  116. package/dist/components/card-manager.d.ts +11 -0
  117. package/dist/components/card-manager.js +143 -0
  118. package/dist/components/check-list.d.ts +11 -0
  119. package/dist/components/check-list.js +11 -0
  120. package/dist/components/check-list2.js +131 -0
  121. package/dist/components/checkbox.js +165 -0
  122. package/dist/components/chip.js +170 -0
  123. package/dist/components/color-picker-hex-input.js +363 -0
  124. package/dist/components/color-picker-swatch.js +2034 -0
  125. package/dist/components/combobox-item.js +182 -0
  126. package/dist/components/combobox.js +912 -0
  127. package/dist/components/comment-card.d.ts +11 -0
  128. package/dist/components/comment-card.js +90 -0
  129. package/dist/components/conditionalSlot.js +50 -0
  130. package/dist/components/config-buffer-tools.d.ts +11 -0
  131. package/dist/components/config-buffer-tools.js +187 -0
  132. package/dist/components/config-draw-tools.d.ts +11 -0
  133. package/dist/components/config-draw-tools.js +121 -0
  134. package/dist/components/config-layer-picker.d.ts +11 -0
  135. package/dist/components/config-layer-picker.js +163 -0
  136. package/dist/components/config-pdf-download.d.ts +11 -0
  137. package/dist/components/config-pdf-download.js +154 -0
  138. package/dist/components/crowdsource-manager.d.ts +11 -0
  139. package/dist/components/crowdsource-manager.js +90 -0
  140. package/dist/components/crowdsource-reporter.d.ts +11 -0
  141. package/dist/components/crowdsource-reporter.js +90 -0
  142. package/dist/components/csvUtils.js +74 -0
  143. package/dist/components/date-picker-day.js +111 -0
  144. package/dist/components/date-picker-month-header.js +224 -0
  145. package/dist/components/date-picker-month.js +344 -0
  146. package/dist/components/date-picker.js +575 -0
  147. package/dist/components/date.js +180 -0
  148. package/dist/components/debounce.js +487 -0
  149. package/dist/components/deduct-calculator.d.ts +11 -0
  150. package/dist/components/deduct-calculator.js +11 -0
  151. package/dist/components/deduct-calculator2.js +1002 -0
  152. package/dist/components/dom.js +231 -0
  153. package/dist/components/dropdown-group.js +96 -0
  154. package/dist/components/dropdown-item.js +232 -0
  155. package/dist/components/dropdown.js +505 -0
  156. package/dist/components/edit-record-modal.d.ts +11 -0
  157. package/dist/components/edit-record-modal.js +11 -0
  158. package/dist/components/edit-record-modal2.js +161 -0
  159. package/dist/components/filter.js +763 -0
  160. package/dist/components/floating-ui.js +1768 -0
  161. package/dist/components/form.js +228 -0
  162. package/dist/components/graph.js +254 -0
  163. package/dist/components/guid.js +24 -0
  164. package/dist/components/handle.js +119 -0
  165. package/dist/components/icon.js +202 -0
  166. package/dist/components/index.d.ts +61 -0
  167. package/dist/components/index.js +196 -0
  168. package/dist/components/index2.js +199 -0
  169. package/dist/components/info-card.d.ts +11 -0
  170. package/dist/components/info-card.js +11 -0
  171. package/dist/components/info-card2.js +97 -0
  172. package/dist/components/input-message.js +101 -0
  173. package/dist/components/input.js +740 -0
  174. package/dist/components/interactive.js +51 -0
  175. package/dist/components/interfaces.js +19 -0
  176. package/dist/components/interfaces2.js +21 -0
  177. package/dist/components/interfaces3.js +80 -0
  178. package/dist/components/json-editor.d.ts +11 -0
  179. package/dist/components/json-editor.js +11 -0
  180. package/dist/components/json-editor2.js +441 -0
  181. package/dist/components/key.js +16 -0
  182. package/dist/components/label.js +106 -0
  183. package/dist/components/label2.js +131 -0
  184. package/dist/components/labelFormats.js +210 -0
  185. package/dist/components/layer-table.d.ts +11 -0
  186. package/dist/components/layer-table.js +453 -0
  187. package/dist/components/link.js +123 -0
  188. package/dist/components/list-item.d.ts +11 -0
  189. package/dist/components/list-item.js +90 -0
  190. package/dist/components/list-item2.js +149 -0
  191. package/dist/components/list.js +83 -0
  192. package/dist/components/loadModules.js +28 -0
  193. package/dist/components/loader.js +116 -0
  194. package/dist/components/locale.js +412 -0
  195. package/dist/components/locale2.js +413 -0
  196. package/dist/components/map-card.d.ts +11 -0
  197. package/dist/components/map-card.js +354 -0
  198. package/dist/components/map-draw-tools.d.ts +11 -0
  199. package/dist/components/map-draw-tools.js +11 -0
  200. package/dist/components/map-draw-tools2.js +228 -0
  201. package/dist/components/map-layer-picker.d.ts +11 -0
  202. package/dist/components/map-layer-picker.js +11 -0
  203. package/dist/components/map-layer-picker2.js +188 -0
  204. package/dist/components/map-search.d.ts +11 -0
  205. package/dist/components/map-search.js +155 -0
  206. package/dist/components/map-select-tools.d.ts +11 -0
  207. package/dist/components/map-select-tools.js +11 -0
  208. package/dist/components/map-select-tools2.js +588 -0
  209. package/dist/components/mapViewUtils.js +129 -0
  210. package/dist/components/math.js +24 -0
  211. package/dist/components/media-card.d.ts +11 -0
  212. package/dist/components/media-card.js +11 -0
  213. package/dist/components/media-card2.js +177 -0
  214. package/dist/components/modal.js +495 -0
  215. package/dist/components/nonChromiumPlatformUtils.js +503 -0
  216. package/dist/components/notice.js +192 -0
  217. package/dist/components/observers.js +56 -0
  218. package/dist/components/openCloseComponent.js +56 -0
  219. package/dist/components/option.js +109 -0
  220. package/dist/components/panel.js +459 -0
  221. package/dist/components/pci-calculator.d.ts +11 -0
  222. package/dist/components/pci-calculator.js +193 -0
  223. package/dist/components/pdf-download.d.ts +11 -0
  224. package/dist/components/pdf-download.js +11 -0
  225. package/dist/components/pdf-download2.js +189 -0
  226. package/dist/components/pick-list-item.js +255 -0
  227. package/dist/components/pick-list.js +170 -0
  228. package/dist/components/popover.js +500 -0
  229. package/dist/components/progress.js +60 -0
  230. package/dist/components/public-notification.d.ts +11 -0
  231. package/dist/components/public-notification.js +825 -0
  232. package/dist/components/publicNotificationStore.js +38 -0
  233. package/dist/components/queryUtils.js +187 -0
  234. package/dist/components/radio-group-item.js +101 -0
  235. package/dist/components/radio-group.js +235 -0
  236. package/dist/components/refine-selection-tools.d.ts +11 -0
  237. package/dist/components/refine-selection-tools.js +11 -0
  238. package/dist/components/refine-selection-tools2.js +492 -0
  239. package/dist/components/refine-selection.d.ts +11 -0
  240. package/dist/components/refine-selection.js +11 -0
  241. package/dist/components/refine-selection2.js +376 -0
  242. package/dist/components/resources.js +24 -0
  243. package/dist/components/resources2.js +21 -0
  244. package/dist/components/resources3.js +38 -0
  245. package/dist/components/scrim.js +83 -0
  246. package/dist/components/select.js +259 -0
  247. package/dist/components/shared-list-render.js +319 -0
  248. package/dist/components/shell-panel.js +281 -0
  249. package/dist/components/shell.js +121 -0
  250. package/dist/components/slider.js +896 -0
  251. package/dist/components/solution-configuration.d.ts +11 -0
  252. package/dist/components/solution-configuration.js +2233 -0
  253. package/dist/components/solution-contents.d.ts +11 -0
  254. package/dist/components/solution-contents.js +11 -0
  255. package/dist/components/solution-contents2.js +128 -0
  256. package/dist/components/solution-item-details.d.ts +11 -0
  257. package/dist/components/solution-item-details.js +11 -0
  258. package/dist/components/solution-item-details2.js +234 -0
  259. package/dist/components/solution-item-icon.d.ts +11 -0
  260. package/dist/components/solution-item-icon.js +11 -0
  261. package/dist/components/solution-item-icon2.js +342 -0
  262. package/dist/components/solution-item-sharing.d.ts +11 -0
  263. package/dist/components/solution-item-sharing.js +11 -0
  264. package/dist/components/solution-item-sharing2.js +167 -0
  265. package/dist/components/solution-item.d.ts +11 -0
  266. package/dist/components/solution-item.js +11 -0
  267. package/dist/components/solution-item2.js +315 -0
  268. package/dist/components/solution-organization-variables.d.ts +11 -0
  269. package/dist/components/solution-organization-variables.js +11 -0
  270. package/dist/components/solution-organization-variables2.js +132 -0
  271. package/dist/components/solution-resource-item.d.ts +11 -0
  272. package/dist/components/solution-resource-item.js +11 -0
  273. package/dist/components/solution-resource-item2.js +356 -0
  274. package/dist/components/solution-spatial-ref.d.ts +11 -0
  275. package/dist/components/solution-spatial-ref.js +11 -0
  276. package/dist/components/solution-spatial-ref2.js +21446 -0
  277. package/dist/components/solution-store.js +4092 -0
  278. package/dist/components/solution-template-data.d.ts +11 -0
  279. package/dist/components/solution-template-data.js +11 -0
  280. package/dist/components/solution-template-data2.js +233 -0
  281. package/dist/components/solution-variables.d.ts +11 -0
  282. package/dist/components/solution-variables.js +11 -0
  283. package/dist/components/solution-variables2.js +150 -0
  284. package/dist/components/sortable.esm.js +3026 -0
  285. package/dist/components/split-button.js +165 -0
  286. package/dist/components/store-manager.d.ts +11 -0
  287. package/dist/components/store-manager.js +83 -0
  288. package/dist/components/switch.js +139 -0
  289. package/dist/components/tab-nav.js +241 -0
  290. package/dist/components/tab-title.js +276 -0
  291. package/dist/components/tab.js +154 -0
  292. package/dist/components/tabs.js +188 -0
  293. package/dist/components/tile.js +129 -0
  294. package/dist/components/time-picker.js +943 -0
  295. package/dist/components/tooltip.js +399 -0
  296. package/dist/components/tree-item.js +294 -0
  297. package/dist/components/tree.js +327 -0
  298. package/dist/components/utils.js +119 -0
  299. package/dist/components/utils2.js +51 -0
  300. package/dist/components/value-list-item.js +204 -0
  301. package/dist/components/value-list.js +333 -0
  302. package/dist/esm/deduct-calculator.entry.js +1 -1
  303. package/dist/esm/pci-calculator.entry.js +1 -1
  304. package/dist/esm/{pciUtils-e3007a1c.js → pciUtils-ecda46e5.js} +25 -7
  305. package/dist/solutions-components/demos/deduct-calculator.html +2 -5
  306. package/dist/solutions-components/demos/new-public-notification.html +6 -4
  307. package/dist/solutions-components/{p-ff80ffbb.entry.js → p-0512635b.entry.js} +1 -1
  308. package/dist/solutions-components/{p-5ec407c2.entry.js → p-0c088725.entry.js} +1 -1
  309. package/dist/solutions-components/p-cc815aca.js +21 -0
  310. package/dist/solutions-components/solutions-components.esm.js +1 -1
  311. package/dist/solutions-components/utils/pciUtils.ts +30 -7
  312. package/dist/types/utils/pciUtils.d.ts +2 -1
  313. package/package.json +4 -3
  314. package/dist/solutions-components/p-647bbd18.js +0 -21
@@ -0,0 +1,333 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
7
+ import { S as Sortable } from './sortable.esm.js';
8
+ import { o as getItemIndex, m as mutationObserverCallback, d as deselectRemovedItems, a as deselectSiblingItems, s as selectSiblings, h as handleFilter, g as getItemData, k as keyDownHandler, p as moveItemIndex, i as initialize, b as initializeObserver, c as cleanUpObserver, j as calciteListFocusOutHandler, r as removeItem, e as calciteListItemChangeHandler, f as calciteInternalListItemValueChangeHandler, l as setUpItems, n as setFocus, L as List } from './shared-list-render.js';
9
+ import { c as createObserver } from './observers.js';
10
+ import { u as updateHostInteraction } from './interactive.js';
11
+
12
+ /*!
13
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
14
+ * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
15
+ * v1.0.0-beta.97
16
+ */
17
+ const CSS = {
18
+ container: "container",
19
+ handle: "handle"
20
+ };
21
+ var ICON_TYPES;
22
+ (function (ICON_TYPES) {
23
+ ICON_TYPES["grip"] = "grip";
24
+ })(ICON_TYPES || (ICON_TYPES = {}));
25
+
26
+ /*!
27
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
28
+ * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
29
+ * v1.0.0-beta.97
30
+ */
31
+ function getScreenReaderText(item, status, valueList) {
32
+ const { items, intlDragHandleIdle, intlDragHandleActive, intlDragHandleChange, intlDragHandleCommit } = valueList;
33
+ const total = items.length;
34
+ const position = getItemIndex(valueList, item) + 1;
35
+ if (status === "idle") {
36
+ const idleText = intlDragHandleIdle
37
+ ? replacePlaceholders(intlDragHandleIdle, item.label, position, total)
38
+ : `${item.label}, press space and use arrow keys to reorder content. Current position ${position} of ${total}.`;
39
+ return idleText;
40
+ }
41
+ else if (status === "active") {
42
+ const activeText = intlDragHandleActive
43
+ ? replacePlaceholders(intlDragHandleActive, item.label, position, total)
44
+ : `Reordering ${item.label}, current position ${position} of ${total}.`;
45
+ return activeText;
46
+ }
47
+ else if (status === "change") {
48
+ const changeText = intlDragHandleChange
49
+ ? replacePlaceholders(intlDragHandleChange, item.label, position, total)
50
+ : `${item.label}, new position ${position} of ${total}. Press space to confirm.`;
51
+ return changeText;
52
+ }
53
+ else {
54
+ const commitText = intlDragHandleCommit
55
+ ? replacePlaceholders(intlDragHandleCommit, item.label, position, total)
56
+ : `${item.label}, current position ${position} of ${total}.`;
57
+ return commitText;
58
+ }
59
+ }
60
+ function getHandleAndItemElement(event) {
61
+ const handle = event
62
+ .composedPath()
63
+ .find((item) => { var _a; return ((_a = item.dataset) === null || _a === void 0 ? void 0 : _a.jsHandle) !== undefined; });
64
+ const item = event
65
+ .composedPath()
66
+ .find((item) => { var _a; return ((_a = item.tagName) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "calcite-value-list-item"; });
67
+ return { handle, item };
68
+ }
69
+ function replacePlaceholders(text, label, position, total) {
70
+ const replacePosition = text.replace("${position}", position.toString());
71
+ const replaceLabel = replacePosition.replace("${item.label}", label);
72
+ return replaceLabel.replace("${total}", total.toString());
73
+ }
74
+
75
+ const valueListCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{position:relative;box-sizing:border-box;display:flex;flex-shrink:0;flex-grow:0;flex-direction:column;align-items:stretch;background-color:transparent;font-size:var(--calcite-font-size--1);color:var(--calcite-ui-text-2)}:host *{box-sizing:border-box}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}calcite-value-list-item:last-of-type{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([filter-enabled]) header{-webkit-margin-after:0.25rem;margin-block-end:0.25rem;display:flex;align-items:center;justify-content:flex-end;background-color:var(--calcite-ui-foreground-1);--tw-shadow:0 1px 0 var(--calcite-ui-border-3);--tw-shadow-colored:0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([filter-enabled]) header.sticky-pos{position:sticky;inset-block-start:0px;z-index:300}calcite-filter{-webkit-margin-after:1px;margin-block-end:1px}";
76
+
77
+ const ValueList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
78
+ constructor() {
79
+ super();
80
+ this.__registerHost();
81
+ this.__attachShadow();
82
+ this.calciteListChange = createEvent(this, "calciteListChange", 6);
83
+ this.calciteListOrderChange = createEvent(this, "calciteListOrderChange", 6);
84
+ // --------------------------------------------------------------------------
85
+ //
86
+ // Properties
87
+ //
88
+ // --------------------------------------------------------------------------
89
+ /**
90
+ * When `true`, interaction is prevented and the component is displayed with lower opacity.
91
+ */
92
+ this.disabled = false;
93
+ /**
94
+ * When `true`, `calcite-value-list-item`s are sortable via a draggable button.
95
+ */
96
+ this.dragEnabled = false;
97
+ /**
98
+ * When `true`, an input appears at the top of the component that can be used by end users to filter list items.
99
+ */
100
+ this.filterEnabled = false;
101
+ /**
102
+ * When `true`, a busy indicator is displayed.
103
+ */
104
+ this.loading = false;
105
+ /**
106
+ * Similar to standard radio buttons and checkboxes.
107
+ * When `true`, a user can select multiple `calcite-value-list-item`s at a time.
108
+ * When `false`, only a single `calcite-value-list-item` can be selected at a time,
109
+ * and a new selection will deselect previous selections.
110
+ */
111
+ this.multiple = false;
112
+ /**
113
+ * When `true` and single-selection is enabled, the selection changes when navigating `calcite-value-list-item`s via keyboard.
114
+ */
115
+ this.selectionFollowsFocus = false;
116
+ // --------------------------------------------------------------------------
117
+ //
118
+ // Private Properties
119
+ //
120
+ // --------------------------------------------------------------------------
121
+ this.selectedValues = new Map();
122
+ this.dataForFilter = [];
123
+ this.lastSelectedItem = null;
124
+ this.mutationObserver = createObserver("mutation", mutationObserverCallback.bind(this));
125
+ this.setFilterEl = (el) => {
126
+ this.filterEl = el;
127
+ };
128
+ this.deselectRemovedItems = deselectRemovedItems.bind(this);
129
+ this.deselectSiblingItems = deselectSiblingItems.bind(this);
130
+ this.selectSiblings = selectSiblings.bind(this);
131
+ this.handleFilter = handleFilter.bind(this);
132
+ this.getItemData = getItemData.bind(this);
133
+ this.keyDownHandler = (event) => {
134
+ if (event.defaultPrevented) {
135
+ return;
136
+ }
137
+ const { handle, item } = getHandleAndItemElement(event);
138
+ if (handle && !item.handleActivated && event.key === " ") {
139
+ this.updateScreenReaderText(getScreenReaderText(item, "commit", this));
140
+ }
141
+ if (!handle || !item.handleActivated) {
142
+ keyDownHandler.call(this, event);
143
+ return;
144
+ }
145
+ const { items } = this;
146
+ if (event.key === " ") {
147
+ this.updateScreenReaderText(getScreenReaderText(item, "active", this));
148
+ }
149
+ if ((event.key !== "ArrowUp" && event.key !== "ArrowDown") || items.length <= 1) {
150
+ return;
151
+ }
152
+ event.preventDefault();
153
+ const { el } = this;
154
+ const nextIndex = moveItemIndex(this, item, event.key === "ArrowUp" ? "up" : "down");
155
+ if (nextIndex === items.length - 1) {
156
+ el.appendChild(item);
157
+ }
158
+ else {
159
+ const itemAtNextIndex = el.children[nextIndex];
160
+ const insertionReferenceItem = itemAtNextIndex === item.nextElementSibling
161
+ ? itemAtNextIndex.nextElementSibling
162
+ : itemAtNextIndex;
163
+ el.insertBefore(item, insertionReferenceItem);
164
+ }
165
+ this.items = this.getItems();
166
+ this.calciteListOrderChange.emit(this.items.map(({ value }) => value));
167
+ requestAnimationFrame(() => handle === null || handle === void 0 ? void 0 : handle.focus());
168
+ item.handleActivated = true;
169
+ this.updateHandleAriaLabel(handle, getScreenReaderText(item, "change", this));
170
+ };
171
+ this.storeAssistiveEl = (el) => {
172
+ this.assistiveTextEl = el;
173
+ };
174
+ this.handleFocusIn = (event) => {
175
+ const { handle, item } = getHandleAndItemElement(event);
176
+ if (!(item === null || item === void 0 ? void 0 : item.handleActivated) && item && handle) {
177
+ this.updateHandleAriaLabel(handle, getScreenReaderText(item, "idle", this));
178
+ }
179
+ };
180
+ }
181
+ // --------------------------------------------------------------------------
182
+ //
183
+ // Lifecycle
184
+ //
185
+ // --------------------------------------------------------------------------
186
+ connectedCallback() {
187
+ initialize.call(this);
188
+ initializeObserver.call(this);
189
+ }
190
+ componentDidLoad() {
191
+ this.setUpDragAndDrop();
192
+ }
193
+ componentDidRender() {
194
+ updateHostInteraction(this);
195
+ }
196
+ disconnectedCallback() {
197
+ cleanUpObserver.call(this);
198
+ this.cleanUpDragAndDrop();
199
+ }
200
+ calciteListFocusOutHandler(event) {
201
+ calciteListFocusOutHandler.call(this, event);
202
+ }
203
+ calciteListItemRemoveHandler(event) {
204
+ removeItem.call(this, event);
205
+ }
206
+ calciteListItemChangeHandler(event) {
207
+ calciteListItemChangeHandler.call(this, event);
208
+ }
209
+ calciteInternalListItemPropsChangeHandler(event) {
210
+ event.stopPropagation();
211
+ this.setUpFilter();
212
+ }
213
+ calciteInternalListItemValueChangeHandler(event) {
214
+ calciteInternalListItemValueChangeHandler.call(this, event);
215
+ event.stopPropagation();
216
+ }
217
+ // --------------------------------------------------------------------------
218
+ //
219
+ // Private Methods
220
+ //
221
+ // --------------------------------------------------------------------------
222
+ getItems() {
223
+ return Array.from(this.el.querySelectorAll("calcite-value-list-item"));
224
+ }
225
+ setUpItems() {
226
+ setUpItems.call(this, "calcite-value-list-item");
227
+ }
228
+ setUpFilter() {
229
+ if (this.filterEnabled) {
230
+ this.dataForFilter = this.getItemData();
231
+ }
232
+ }
233
+ setUpDragAndDrop() {
234
+ this.cleanUpDragAndDrop();
235
+ if (!this.dragEnabled) {
236
+ return;
237
+ }
238
+ this.sortable = Sortable.create(this.el, {
239
+ dataIdAttr: "id",
240
+ handle: `.${CSS.handle}`,
241
+ draggable: "calcite-value-list-item",
242
+ group: this.group,
243
+ onSort: () => {
244
+ this.items = Array.from(this.el.querySelectorAll("calcite-value-list-item"));
245
+ const values = this.items.map((item) => item.value);
246
+ this.calciteListOrderChange.emit(values);
247
+ }
248
+ });
249
+ }
250
+ cleanUpDragAndDrop() {
251
+ var _a;
252
+ (_a = this.sortable) === null || _a === void 0 ? void 0 : _a.destroy();
253
+ this.sortable = null;
254
+ }
255
+ handleBlur() {
256
+ if (this.dragEnabled) {
257
+ this.updateScreenReaderText("");
258
+ }
259
+ }
260
+ // --------------------------------------------------------------------------
261
+ //
262
+ // Public Methods
263
+ //
264
+ // --------------------------------------------------------------------------
265
+ /** Returns the currently selected items */
266
+ async getSelectedItems() {
267
+ return this.selectedValues;
268
+ }
269
+ /**
270
+ * Sets focus on the component.
271
+ *
272
+ * @param focusId
273
+ */
274
+ async setFocus(focusId) {
275
+ return setFocus.call(this, focusId);
276
+ }
277
+ // --------------------------------------------------------------------------
278
+ //
279
+ // Render Methods
280
+ //
281
+ // --------------------------------------------------------------------------
282
+ getIconType() {
283
+ let type = null;
284
+ if (this.dragEnabled) {
285
+ type = ICON_TYPES.grip;
286
+ }
287
+ return type;
288
+ }
289
+ updateScreenReaderText(text) {
290
+ this.assistiveTextEl.textContent = text;
291
+ }
292
+ updateHandleAriaLabel(handleElement, text) {
293
+ handleElement.ariaLabel = text;
294
+ }
295
+ render() {
296
+ return (h(List, { onBlur: this.handleBlur, onFocusin: this.handleFocusIn, onKeyDown: this.keyDownHandler, props: this }));
297
+ }
298
+ get el() { return this; }
299
+ static get style() { return valueListCss; }
300
+ }, [1, "calcite-value-list", {
301
+ "disabled": [516],
302
+ "dragEnabled": [516, "drag-enabled"],
303
+ "filterEnabled": [516, "filter-enabled"],
304
+ "filterPlaceholder": [513, "filter-placeholder"],
305
+ "group": [513],
306
+ "loading": [516],
307
+ "multiple": [516],
308
+ "selectionFollowsFocus": [516, "selection-follows-focus"],
309
+ "intlDragHandleIdle": [1, "intl-drag-handle-idle"],
310
+ "intlDragHandleActive": [1, "intl-drag-handle-active"],
311
+ "intlDragHandleChange": [1, "intl-drag-handle-change"],
312
+ "intlDragHandleCommit": [1, "intl-drag-handle-commit"],
313
+ "selectedValues": [32],
314
+ "dataForFilter": [32],
315
+ "getSelectedItems": [64],
316
+ "setFocus": [64]
317
+ }, [[0, "focusout", "calciteListFocusOutHandler"], [0, "calciteListItemRemove", "calciteListItemRemoveHandler"], [0, "calciteListItemChange", "calciteListItemChangeHandler"], [0, "calciteInternalListItemPropsChange", "calciteInternalListItemPropsChangeHandler"], [0, "calciteInternalListItemValueChange", "calciteInternalListItemValueChangeHandler"]]]);
318
+ function defineCustomElement() {
319
+ if (typeof customElements === "undefined") {
320
+ return;
321
+ }
322
+ const components = ["calcite-value-list"];
323
+ components.forEach(tagName => { switch (tagName) {
324
+ case "calcite-value-list":
325
+ if (!customElements.get(tagName)) {
326
+ customElements.define(tagName, ValueList);
327
+ }
328
+ break;
329
+ } });
330
+ }
331
+ defineCustomElement();
332
+
333
+ export { ValueList as V, defineCustomElement as d };
@@ -4,7 +4,7 @@
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
6
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-09deaa39.js';
7
- import { E as EDistressType, a as ESeverity, b as calculateDeductValue } from './pciUtils-e3007a1c.js';
7
+ import { E as EDistressType, a as ESeverity, b as calculateDeductValue } from './pciUtils-ecda46e5.js';
8
8
 
9
9
  const deductCalculatorCss = ":host{display:block;--calcite-label-margin-bottom:0}.label-display{display:block;padding-bottom:1rem}";
10
10
 
@@ -4,7 +4,7 @@
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
6
  import { r as registerInstance, h, H as Host, g as getElement } from './index-09deaa39.js';
7
- import { c as calculatePCI } from './pciUtils-e3007a1c.js';
7
+ import { c as calculatePCI } from './pciUtils-ecda46e5.js';
8
8
 
9
9
  const pciCalculatorCss = ":host{display:block;--calcite-label-margin-bottom:0}.label-display{display:block;padding-bottom:1rem}.display-flex{display:flex}.display-grid{display:grid}.display-table{display:table}.display-inline-table{display:inline-table}.display-none{display:none}.display-inherit{display:inherit}.padding-top-1{padding-top:1rem}.main-input{width:300px;-webkit-padding-end:1rem;padding-inline-end:1rem}.float-end{float:inline-end}.position-relative{position:relative}.position-right{position:absolute;right:0px}";
10
10
 
@@ -63,7 +63,8 @@ var EDistressType;
63
63
  EDistressType[EDistressType["SHOVING"] = 16] = "SHOVING";
64
64
  EDistressType[EDistressType["SLIPPAGE_CRACKING"] = 17] = "SLIPPAGE_CRACKING";
65
65
  EDistressType[EDistressType["SWELL"] = 18] = "SWELL";
66
- EDistressType[EDistressType["WEATHERING_RAVELING"] = 19] = "WEATHERING_RAVELING";
66
+ EDistressType[EDistressType["RAVELING"] = 19] = "RAVELING";
67
+ EDistressType[EDistressType["WEATHERING"] = 20] = "WEATHERING";
67
68
  })(EDistressType || (EDistressType = {}));
68
69
  /**
69
70
  * Calculate the deduct value for the given distress.
@@ -147,8 +148,11 @@ function calculateDeductValue(type, severity, density, showDebugging = false) {
147
148
  case EDistressType.SWELL:
148
149
  calc = _calcSwell;
149
150
  break;
150
- case EDistressType.WEATHERING_RAVELING:
151
- calc = _calcWeatheringReveling;
151
+ case EDistressType.RAVELING:
152
+ calc = _calcRaveling;
153
+ break;
154
+ case EDistressType.WEATHERING:
155
+ calc = _calcWeathering;
152
156
  break;
153
157
  }
154
158
  const dv = calc(_severity, Math.log10(_density));
@@ -671,10 +675,24 @@ function _calcSwell(severity, density) {
671
675
  *
672
676
  * @returns the calculated deduct value
673
677
  */
674
- function _calcWeatheringReveling(severity, density) {
675
- const vals = severity === ESeverity.H ? [16.67, 10.94, 5.897, 13.38, -0.2589, -6.328, 1.806] :
676
- severity === ESeverity.M ? [8.335, 4.022, 1.032, 6.267, 1.154, -3.004, 0.7874] :
677
- [1.761, 0.3251, -1.586, 5.783, 1.365, -3.576, 1.05];
678
+ function _calcRaveling(severity, density) {
679
+ const vals = severity === ESeverity.H ? [16.77, 10.67, 5.758, 12.9, -0.0633, -5.659, 1.48] :
680
+ severity === ESeverity.M ? [8.512, 5.106, 1.63, 3.469, 1.028, -1.211, 0.1938] :
681
+ [];
682
+ return _calc(density, vals);
683
+ }
684
+ /**
685
+ * Execute the deduct value calculation for the distress type
686
+ *
687
+ * @param severity The severity of the distress type
688
+ * @param density percent density of the distress type
689
+ *
690
+ * @returns the calculated deduct value
691
+ */
692
+ function _calcWeathering(severity, density) {
693
+ const vals = severity === ESeverity.H ? [3.673, 3.349, 2.598, -1.233, 2.754, 2.434, -1.485] :
694
+ severity === ESeverity.M ? [1.12, 0.9769, 0.93, -0.5955, 1.041, 1.111, -0.614] :
695
+ [-0.0386, -0.0736, 0.834, 1.63, -0.0287, -0.639, 0.1515];
678
696
  return _calc(density, vals);
679
697
  }
680
698
  /**
@@ -23,9 +23,9 @@
23
23
  -->
24
24
  <style>
25
25
  .main {
26
- position: absolute;
27
- right: 0px;
28
26
  background-color: var(--calcite-ui-foreground-1);
27
+ display: grid;
28
+ align-self: center;
29
29
  }
30
30
  .column {
31
31
  min-width: 300px;
@@ -33,9 +33,6 @@
33
33
  padding: 1rem;
34
34
  border: 1px solid;
35
35
  }
36
- .column[dir="rtl"] {
37
- float: left;
38
- }
39
36
  </style>
40
37
 
41
38
  <link rel="stylesheet" href="https://unpkg.com/@esri/calcite-components@1.0.0-beta.94/dist/calcite/calcite.css" type="text/css" />
@@ -55,14 +55,16 @@
55
55
 
56
56
  <link
57
57
  rel="stylesheet"
58
- href="https://js.arcgis.com/4.23/esri/themes/light/main.css"
58
+ href="https://js.arcgis.com/4.25/esri/themes/light/main.css"
59
59
  />
60
- <link rel="stylesheet" href="https://unpkg.com/@esri/calcite-components@1.0.0-beta.94/dist/calcite/calcite.css" type="text/css" />
60
+ <link rel="stylesheet" href="../../node_modules/@esri/calcite-components/dist/calcite/calcite.css" type="text/css" />
61
61
  <link rel="stylesheet" href="https://webapps-cdn.esri.com/CDN/fonts/v1.4.1/fonts.css" />
62
62
  <link rel="stylesheet" href="../solutions-components.css" type="text/css">
63
63
 
64
- <script src="https://js.arcgis.com/4.23/"></script>
65
- <script type="module" src="https://unpkg.com/@esri/calcite-components@1.0.0-beta.94/dist/calcite/calcite.esm.js"></script>
64
+ <script src="https://js.arcgis.com/4.25/"></script>
65
+ <!-- <script type="module" src="https://unpkg.com/@esri/calcite-components@1.0.0-beta.97/dist/calcite/calcite.esm.js"></script> -->
66
+ <script type="module" src="../../node_modules/@esri/calcite-components/dist/calcite/calcite.esm.js"></script>
67
+
66
68
  <script type="module" src="../solutions-components.esm.js"></script>
67
69
 
68
70
  <script>
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as e,c as t,h as l,H as a,g as i}from"./p-c023e6a1.js";import{E as s,a as c,b as r}from"./p-647bbd18.js";const u=class{constructor(l){e(this,l),this.deductValueComplete=t(this,"deductValueComplete",7),this._types=Object.keys(s).filter((e=>!isNaN(Number(s[e]))))}render(){return l(a,null,l("div",{class:"label-display"},l("calcite-label",{class:"label-display"},"Density %",this._getDensityInput()),l("calcite-label",{class:"label-display"},"Type",this._getTypeInput()),l("calcite-label",{class:"label-display"},"Severity",this._getSeverityInput())),l("div",null,this._getCalculateInput()))}_getDensityInput(){return l("calcite-input",{max:100,min:0,ref:e=>{this._densityElement=e},type:"number"})}_getTypeInput(){return l("calcite-select",{label:"",ref:e=>{this._typeElement=e}},this._types.map(((e,t)=>l("calcite-option",{value:s[e].toString()},`${e} (${t+1})`))))}_getSeverityInput(){return l("calcite-select",{label:"",ref:e=>{this._severityElement=e}},l("calcite-option",{value:c.H},"High"),l("calcite-option",{value:c.M},"Medium"),l("calcite-option",{value:c.L},"Low"))}_getCalculateInput(){return l("calcite-button",{onClick:()=>this._calculateDeduct(parseFloat(this._typeElement.value),this._severityElement.value,parseFloat(this._densityElement.value))},"Calculate Deduct Value")}_calculateDeduct(e,t,l){if(e&&t&&!isNaN(l)){const a=r(e.toString(),t.toString(),l.toString(),!0);this.deductValueComplete.emit(a),alert(a)}else alert("Type, severity, and a density number are required")}get el(){return i(this)}};u.style=":host{display:block;--calcite-label-margin-bottom:0}.label-display{display:block;padding-bottom:1rem}";export{u as deduct_calculator}
6
+ import{r as e,c as t,h as l,H as a,g as i}from"./p-c023e6a1.js";import{E as s,a as c,b as r}from"./p-cc815aca.js";const u=class{constructor(l){e(this,l),this.deductValueComplete=t(this,"deductValueComplete",7),this._types=Object.keys(s).filter((e=>!isNaN(Number(s[e]))))}render(){return l(a,null,l("div",{class:"label-display"},l("calcite-label",{class:"label-display"},"Density %",this._getDensityInput()),l("calcite-label",{class:"label-display"},"Type",this._getTypeInput()),l("calcite-label",{class:"label-display"},"Severity",this._getSeverityInput())),l("div",null,this._getCalculateInput()))}_getDensityInput(){return l("calcite-input",{max:100,min:0,ref:e=>{this._densityElement=e},type:"number"})}_getTypeInput(){return l("calcite-select",{label:"",ref:e=>{this._typeElement=e}},this._types.map(((e,t)=>l("calcite-option",{value:s[e].toString()},`${e} (${t+1})`))))}_getSeverityInput(){return l("calcite-select",{label:"",ref:e=>{this._severityElement=e}},l("calcite-option",{value:c.H},"High"),l("calcite-option",{value:c.M},"Medium"),l("calcite-option",{value:c.L},"Low"))}_getCalculateInput(){return l("calcite-button",{onClick:()=>this._calculateDeduct(parseFloat(this._typeElement.value),this._severityElement.value,parseFloat(this._densityElement.value))},"Calculate Deduct Value")}_calculateDeduct(e,t,l){if(e&&t&&!isNaN(l)){const a=r(e.toString(),t.toString(),l.toString(),!0);this.deductValueComplete.emit(a),alert(a)}else alert("Type, severity, and a density number are required")}get el(){return i(this)}};u.style=":host{display:block;--calcite-label-margin-bottom:0}.label-display{display:block;padding-bottom:1rem}";export{u as deduct_calculator}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as i,h as t,H as a,g as l}from"./p-c023e6a1.js";import{c as e}from"./p-647bbd18.js";const s=class{constructor(t){i(this,t),this.showAddDeduct=!1}render(){const i=this.showAddDeduct?"position-relative":"display-none";return t(a,null,t("div",{class:this.showAddDeduct?"display-none":"display-grid"},t("div",{class:"label-display"},t("calcite-label",{class:"label-display"},"Enter comma delimited deduct values",this._getDeductValuesInput())),t("div",null,this._getCalculateButton())),t("div",{class:i},t("div",{class:"position-right"},t("calcite-action",{appearance:"clear",class:"float-end",icon:"x",onClick:()=>this._toggleShowAddDeduct(),scale:"s",text:""})),t("deduct-calculator",{class:"display-grid padding-top-1",onDeductValueComplete:i=>this._addDeductValue(i)})))}_getDeductValuesInput(){return t("div",{class:"display-flex"},t("calcite-input",{class:"main-input",ref:i=>{this._deductValuesElement=i}}),t("calcite-action",{appearance:"clear",icon:"plus-circle",onClick:()=>this._toggleShowAddDeduct(),scale:"s",text:""}))}_getCalculateButton(){return t("calcite-button",{onClick:()=>this._calculatePCI(this._deductValuesElement.value)},"Calculate PCI")}_toggleShowAddDeduct(){this.showAddDeduct=!this.showAddDeduct}_addDeductValue(i){this._toggleShowAddDeduct(),this._deductValuesElement.value+=Math.abs(parseFloat(this._deductValuesElement.value))>0?`,${i.detail}`:i.detail}_calculatePCI(i){const t=e(i,!0),a=t<=10?"Failed":t<=25?"Serious":t<=40?"Very Poor":t<=55?"Poor":t<=70?"Fair":t<=85?"Satisfactory":"Good";console.log(`PCI: ${t}`),console.log(`Rating: ${a}`),alert("See debug console for results")}get el(){return l(this)}};s.style=":host{display:block;--calcite-label-margin-bottom:0}.label-display{display:block;padding-bottom:1rem}.display-flex{display:flex}.display-grid{display:grid}.display-table{display:table}.display-inline-table{display:inline-table}.display-none{display:none}.display-inherit{display:inherit}.padding-top-1{padding-top:1rem}.main-input{width:300px;-webkit-padding-end:1rem;padding-inline-end:1rem}.float-end{float:inline-end}.position-relative{position:relative}.position-right{position:absolute;right:0px}";export{s as pci_calculator}
6
+ import{r as i,h as a,H as t,g as l}from"./p-c023e6a1.js";import{c as e}from"./p-cc815aca.js";const s=class{constructor(a){i(this,a),this.showAddDeduct=!1}render(){const i=this.showAddDeduct?"position-relative":"display-none";return a(t,null,a("div",{class:this.showAddDeduct?"display-none":"display-grid"},a("div",{class:"label-display"},a("calcite-label",{class:"label-display"},"Enter comma delimited deduct values",this._getDeductValuesInput())),a("div",null,this._getCalculateButton())),a("div",{class:i},a("div",{class:"position-right"},a("calcite-action",{appearance:"clear",class:"float-end",icon:"x",onClick:()=>this._toggleShowAddDeduct(),scale:"s",text:""})),a("deduct-calculator",{class:"display-grid padding-top-1",onDeductValueComplete:i=>this._addDeductValue(i)})))}_getDeductValuesInput(){return a("div",{class:"display-flex"},a("calcite-input",{class:"main-input",ref:i=>{this._deductValuesElement=i}}),a("calcite-action",{appearance:"clear",icon:"plus-circle",onClick:()=>this._toggleShowAddDeduct(),scale:"s",text:""}))}_getCalculateButton(){return a("calcite-button",{onClick:()=>this._calculatePCI(this._deductValuesElement.value)},"Calculate PCI")}_toggleShowAddDeduct(){this.showAddDeduct=!this.showAddDeduct}_addDeductValue(i){this._toggleShowAddDeduct(),this._deductValuesElement.value+=Math.abs(parseFloat(this._deductValuesElement.value))>0?`,${i.detail}`:i.detail}_calculatePCI(i){const a=e(i,!0),t=a<=10?"Failed":a<=25?"Serious":a<=40?"Very Poor":a<=55?"Poor":a<=70?"Fair":a<=85?"Satisfactory":"Good";console.log(`PCI: ${a}`),console.log(`Rating: ${t}`),alert("See debug console for results")}get el(){return l(this)}};s.style=":host{display:block;--calcite-label-margin-bottom:0}.label-display{display:block;padding-bottom:1rem}.display-flex{display:flex}.display-grid{display:grid}.display-table{display:table}.display-inline-table{display:inline-table}.display-none{display:none}.display-inherit{display:inherit}.padding-top-1{padding-top:1rem}.main-input{width:300px;-webkit-padding-end:1rem;padding-inline-end:1rem}.float-end{float:inline-end}.position-relative{position:relative}.position-right{position:absolute;right:0px}";export{s as pci_calculator}
@@ -0,0 +1,21 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ /** @license
7
+ * Copyright 2022 Esri
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+ var e,n;function t(t,o,c,r=!1){const u=parseInt(t),s=e[o],D=parseFloat(c.toString());if(Number.isNaN(D)||0===D)return"";const H=!0===r||"true"===r.toString().toLowerCase();let M;switch(u){case n.ALLIGATOR_CRACKING:M=i;break;case n.BLEEDING:M=l;break;case n.BLOCK_CRACKING:M=f;break;case n.BUMPS_SAGS:M=d;break;case n.CORRUGATION:M=b;break;case n.DEPRESSION:M=I;break;case n.EDGE_CRACKING:M=$;break;case n.REFLECTION_CRACKING:M=A;break;case n.LANE_SHOULDER_DROP_OFF:M=C;break;case n.LONG_TRANS_CRACKING:M=G;break;case n.PATCHING_UTIL_CUT_PATCHING:M=R;break;case n.POLISHED_AGGREGATE:M=N;break;case n.POTHOLES:M=h;break;case n.RAILROAD_CROSSING:M=p;break;case n.RUTTING:M=E;break;case n.SHOVING:M=O;break;case n.SLIPPAGE_CRACKING:M=k;break;case n.SWELL:M=L;break;case n.RAVELING:M=v;break;case n.WEATHERING:M=_}const S=M(s,Math.log10(D)),T=a(S),m=`${t}|${o}|${T}|${D}`;return H&&(console.log(`Deduct value: ${S}`),console.log(`Rounded deduct value: ${T}`),console.log(`Formatted devduct value (type|severity|roundedDV|density): ${m}`)),m}function o(e,n=!1){let t=e.indexOf("|")>-1?function(e,n){const t={},o=function(e){return e.split(",").reduce(((e,n)=>{const t=n.split("|"),o=t[0],c=t[1],r=parseFloat(t[2]),u=parseFloat(t[3]);return e[o]||(e[o]={}),e[o][c]={deductValue:r,density:u},e}),{})}(e),u=Object.keys(o).filter((e=>Object.keys(o[e]).length>1));return u.length>0&&u.forEach((e=>{let u,s,a,i,l,f;Object.keys(o[e]).forEach((n=>{"H"===n?(u=o[e][n].deductValue,i=o[e][n].density):"M"===n?(s=o[e][n].deductValue,l=o[e][n].density):(a=o[e][n].deductValue,f=o[e][n].density)}));const d=(i&&l&&f?c:r)(e,u,s,a,i,l,f,n);d&&(t[e]=d,n&&(console.log("updates"),console.log(t)))})),function(e,n){const t=[];return e.split(",").reduce(((e,o)=>{const c=o.split("|"),r=c[0],u=parseFloat(c[2]);return Object.keys(n).length>0&&n[r]?(t.push(r),e.push(...n[r]),delete n[r]):t.indexOf(r)<0&&e.push(u),e}),[])}(e,t)}(e,n):e.split(",").map((e=>parseFloat(e)));const o=!0===n||"true"===n.toString().toLowerCase();let u=0;if(t=t.filter((e=>Math.abs(e)>0)),t.length>0){const e=function(e,n){let t;const o=e.filter((e=>e>2));if(o.length<=1)t=o.reduce(((e,n)=>e+n),0),n&&(console.log("If none or only one individual deduct value is greater"),console.log("than two, the total value is used in place of the maximum CD"),console.log(`Max CDV: ${t}`));else{const o=e.sort(((e,n)=>n-e)),c=o[0],r=1+9/98*(100-c);if(n&&(console.log(`Deduct values sorted in descending order: ${o}`),console.log(`Highest deduct value: ${c}`),console.log(`Allowable number of deducts including fractions: ${r}`)),r<=10){const e=function(e,n){const t=n-Math.floor(n);return e.length<n?e:e.reduce(((e,o,c)=>(c+1<n?e.push(o):t>0&&e.push(a(o*t)),e)),[])}(o,r);n&&console.log(`Reduce deduct values to the m largest including the fractional part: ${e}`);const c=function(e,n){let t=e.length;const o=[];for(;t>=1;)n&&console.log(`vals: ${e}`),o.push(D(e,n)),t-=1,e.splice(t,1,2);return o}(e,n);t=Math.max(...c),n&&console.log(`Max CDV: ${t}`)}else n&&console.log("Allowable number of deducts including fractions (must be less than or equal to ten)")}return t}(t,o);u=100-a(e)}return u}function c(e,n,t,c,r,s,a,i){const l=o(`${n},${t},${c}`,!0);i&&(console.log("pci1"),console.log(l));const f=u(e,"M",(a+s).toString(),n,i),d=u(e,"H",(s+r).toString(),c,i),b=u(e,"H",(a+r).toString(),t,i),I=u(e,"H",(a+s+r).toString(),0,i);i&&(console.log("low med pci2"),console.log(f.pci),console.log("med high pci2"),console.log(d.pci),console.log("low high pci2"),console.log(b.pci),console.log("low med high pci2"),console.log(I.pci));const $=[f,d,b,I].reduce(((e,n)=>n.pci>l&&(!e||n.pci>e.pci)?n:e),void 0);return $?$.dv:void 0}function r(e,n,t,c,r,s,a,i){const l=o(`${n||t},${c||t}`,!0);i&&(console.log("pci1"),console.log(l));const f=r||s,d=u(e,f===r?"H":"M",(f+(a||s)).toString(),0,i);return i&&(console.log("pci2"),console.log(d.pci)),d.pci>l?d.dv:void 0}function u(e,n,c,r,u){const s=t(e,n,c).split("|"),a=parseFloat(s[2]);return{pci:o(`${s[2]},${r}`,u),dv:r?[a,r]:[a]}}function s(e,n){return n.reduce(((n,t,o)=>n+(0===o?t:1===o?t*e:t*Math.pow(e,o))),0)}function a(e){return Math.round(10*e)/10}function i(n,t){return s(t,n===e.H?[30.71,29.22,9.407,-6.981,-2.158,3.047,-.6578]:n===e.M?[21.62,21.32,5.194,-1.343,.2341]:[11.31,16.05,7.572,-1.471])}function l(n,t){return s(t,n===e.H?[5.343,6.927,7.926,4.265,-.7582]:n===e.M?[2.38,5.483,4.128,.8366,.03659,.1052]:[.01391,.5079,1.576,1.191,.1329,.03823])}function f(n,t){return s(t,n===e.H?[7.926,11.93,8.826,3.432,-1.382]:n===e.M?[2.587,9.142,6.647,-.455,-.2439,.1107]:[.646,4.002,4.2,.4987,-.06269])}function d(n,t){return s(t,n===e.H?[52.77,38.07,8.964,-.4148,-1.589,2.478]:n===e.M?[24.66,27.86,15.73,3.295,-5.27,5.921,7.959]:[8.768,13.79,7.064,7.455,6.041,-1.739,-1.371])}function b(n,t){return s(t,n===e.H?[34.21,21.59,1.863,6.141,-.687,-1.885,.4916]:n===e.M?[15.78,19.69,6.276,-2.124,.5868,.06045]:[2.173,5.609,5.976,-.7348,-.2172,1.494,-.5659])}function I(n,t){return s(t,n===e.H?[17.84,5.904,9.406,18.28,-2.753,-7.798,2.402]:n===e.M?[8.471,3.171,10.25,12.2,-.9687,-4.601,1.079]:[4.836,-.7572,4.786,12.39,1.233,-4.871,.9749])}function $(n,t){return s(t,n===e.H?[14.99,13.5,10.62,5.15,-1.792,-2.826]:n===e.M?[9.177,10.26,5.704,-.6812,-.8588,.2123]:[3.049,4.802,4.058,-.3556,-1.55,1.02])}function A(n,t){return s(t,n===e.H?[14.99,17.21,27.63,31.13,-20.94,-18.82,9.985]:n===e.M?[9.9193,10.88,8.073,14.8,-3.792,-9.583,3.651]:[2.356,6.664,3.717,-1.393,1.94,1.785,-.9707])}function C(n,t){return s(t,n===e.H?[7.549,6.907,7.284,9.304,2.064]:n===e.M?[4.02,1.744,14.36,15.92,-40.22,23.6]:[2.004,1.065,9.706,11.75,-27.52,15.04])}function G(n,t){return s(t,n===e.H?[19.56,24.06,12.12,9.336,1.532,-4.396]:n===e.M?[9.751,15.53,4.719,1.369,1.206,-1.164]:[2.347,9.074,8.424,-1.338,-1.873,1.144])}function R(n,t){return s(t,n===e.H?[20.15,16.55,5.415,10.77,3.257,-4.502]:n===e.M?[10.28,12.71,6.174,1.928,.6923,-.4673]:[2.523,6.892,5.702,2.407,.2185,-.8722])}function N(e,n){return s(n,"H"===e||"M"===e||"L"===e?[3.417,-26.82,71.15,-76.22,38.52,-6.904]:[])}function h(n,t){return s(t,n===e.H?[110.7,60.66,2.378,-2.664]:n===e.M?[90.47,60.41,-.1123,-4.746]:[58.19,40.53,2.884,-1.443,.1195])}function p(n,t){return s(t,n===e.H?[20,38.64,-62.82,193.6,-162.7,41.22]:n===e.M?[6.994,23.47,-52.3,167.3,-143.6,37.64]:[1.998,-.7488,13.8,-.7917,-1.981])}function E(n,t){return s(t,n===e.H?[27.61,25.19,8.557,1.65,-2.203]:n===e.M?[18.47,20.77,6.617,-1.13,-2.286]:[8.833,14.84,3.129,.1451,2.438,-1.279])}function O(n,t){return s(t,n===e.H?[18.7,20.17,10.3,4.694,1.331,-2.61]:n===e.M?[10.39,14.78,5.488,4.001,3.23,-2.387]:[4.002,10.66,6.332,-.5226,-.1923])}function k(n,t){return s(t,n===e.H?[19.73,32.21,25.87,-2.871,-10.55,1.496,.7393]:n===e.M?[11.38,18.55,18.38,1.628,-7.596,.5841,.5946]:[5.144,12.95,11.95,-.833,-2.995,1.325,-.2113])}function L(n,t){return s(t,n===e.H?[34,16.84,-23.09,41.17,-14.84]:n===e.M?[12,15.67,20.59,-28.33,21,-5.508]:[1.995,11.9,-12.83,16.74,-5.361])}function v(n,t){return s(t,n===e.H?[16.77,10.67,5.758,12.9,-.0633,-5.659,1.48]:n===e.M?[8.512,5.106,1.63,3.469,1.028,-1.211,.1938]:[])}function _(n,t){return s(t,n===e.H?[3.673,3.349,2.598,-1.233,2.754,2.434,-1.485]:n===e.M?[1.12,.9769,.93,-.5955,1.041,1.111,-.614]:[-.0386,-.0736,.834,1.63,-.0287,-.639,.1515])}function D(e,n){return function(e,n,t){const o=s(e,{7:[-9.482,.6045,3563e-7,-5448e-9],6:[-8.165,.5724,4266e-7,-4254e-9],5:[-7.932,.6091,3464e-7,-4265e-9],4:[-6.78,.6301,7376e-7,-6357e-9],3:[-5.015,.7546,-43e-5,-3075e-9],2:[-1.668,.7992,-3013e-7,-5214e-9],1:[1651e-18,1,-4249e-21,1149e-22]}[n>=7?7:n]);return t&&(console.log(`totalDV: ${e}`),console.log(`q: ${n}`),console.log(`CDV: ${o}`)),o}(e.reduce(((e,n)=>e+n),0),e.reduce(((e,n)=>n>2?e+1:e),0),n)}!function(e){e.H="H",e.M="M",e.L="L"}(e||(e={})),function(e){e[e.ALLIGATOR_CRACKING=1]="ALLIGATOR_CRACKING",e[e.BLEEDING=2]="BLEEDING",e[e.BLOCK_CRACKING=3]="BLOCK_CRACKING",e[e.BUMPS_SAGS=4]="BUMPS_SAGS",e[e.CORRUGATION=5]="CORRUGATION",e[e.DEPRESSION=6]="DEPRESSION",e[e.EDGE_CRACKING=7]="EDGE_CRACKING",e[e.REFLECTION_CRACKING=8]="REFLECTION_CRACKING",e[e.LANE_SHOULDER_DROP_OFF=9]="LANE_SHOULDER_DROP_OFF",e[e.LONG_TRANS_CRACKING=10]="LONG_TRANS_CRACKING",e[e.PATCHING_UTIL_CUT_PATCHING=11]="PATCHING_UTIL_CUT_PATCHING",e[e.POLISHED_AGGREGATE=12]="POLISHED_AGGREGATE",e[e.POTHOLES=13]="POTHOLES",e[e.RAILROAD_CROSSING=14]="RAILROAD_CROSSING",e[e.RUTTING=15]="RUTTING",e[e.SHOVING=16]="SHOVING",e[e.SLIPPAGE_CRACKING=17]="SLIPPAGE_CRACKING",e[e.SWELL=18]="SWELL",e[e.RAVELING=19]="RAVELING",e[e.WEATHERING=20]="WEATHERING"}(n||(n={}));export{n as E,e as a,t as b,o as c}