@esri/solutions-components 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/buffer-tools_6.cjs.entry.js +8 -5
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +2 -2
- package/dist/cjs/calcite-input-message_5.cjs.entry.js +6 -4
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +2 -2
- package/dist/cjs/{csvUtils-83af7ae1.js → csvUtils-34666909.js} +1 -1
- package/dist/cjs/{interfaces-772edf61.js → interfaces-17c631bf.js} +1 -1
- package/dist/cjs/layer-table.cjs.entry.js +3 -3
- package/dist/cjs/map-card.cjs.entry.js +1 -1
- package/dist/cjs/{mapViewUtils-55ac76cb.js → mapViewUtils-24d1d859.js} +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +16 -10
- package/dist/cjs/solution-configuration.cjs.entry.js +2 -2
- package/dist/cjs/solution-contents_3.cjs.entry.js +2 -2
- package/dist/cjs/{solution-store-39726b81.js → solution-store-2dbab624.js} +1 -1
- package/dist/collection/components/buffer-tools/buffer-tools.js +2 -2
- package/dist/collection/components/map-draw-tools/map-draw-tools.js +2 -1
- package/dist/collection/components/public-notification/public-notification.js +14 -8
- package/dist/collection/components/refine-selection/refine-selection.js +4 -2
- package/dist/collection/components/refine-selection-tools/refine-selection-tools.css +1 -0
- package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +3 -1
- package/dist/collection/demos/new-public-notification.html +2 -1
- package/dist/collection/utils/interfaces.js +1 -1
- package/dist/collection/utils/interfaces.ts +2 -2
- package/dist/components/interfaces3.js +1 -1
- package/dist/components/map-draw-tools2.js +2 -1
- package/dist/components/public-notification.js +14 -8
- package/dist/components/refine-selection-tools2.js +4 -2
- package/dist/components/refine-selection2.js +4 -2
- package/dist/esm/buffer-tools_6.entry.js +8 -5
- package/dist/esm/calcite-combobox_3.entry.js +2 -2
- package/dist/esm/calcite-input-message_5.entry.js +6 -4
- package/dist/esm/calcite-shell-panel_14.entry.js +2 -2
- package/dist/esm/{csvUtils-eb231cfb.js → csvUtils-ae3004b9.js} +1 -1
- package/dist/esm/{interfaces-3b23a5f9.js → interfaces-d0d83efa.js} +1 -1
- package/dist/esm/layer-table.entry.js +3 -3
- package/dist/esm/map-card.entry.js +1 -1
- package/dist/esm/{mapViewUtils-e5d8a1e1.js → mapViewUtils-541e7a3c.js} +1 -1
- package/dist/esm/public-notification.entry.js +16 -10
- package/dist/esm/solution-configuration.entry.js +2 -2
- package/dist/esm/solution-contents_3.entry.js +2 -2
- package/dist/esm/{solution-store-c0bf9200.js → solution-store-41e15f1c.js} +1 -1
- package/dist/solutions-components/demos/new-public-notification.html +2 -1
- package/dist/solutions-components/p-05e64bd1.js +498 -2
- package/dist/solutions-components/p-08a95b33.entry.js +138 -0
- package/dist/solutions-components/p-0da5bbdf.entry.js +91 -0
- package/dist/solutions-components/p-0ef91144.entry.js +913 -0
- package/dist/solutions-components/p-0f523243.entry.js +1916 -0
- package/dist/solutions-components/p-11b9510e.entry.js +173 -0
- package/dist/solutions-components/p-1b875d94.entry.js +58 -0
- package/dist/solutions-components/p-1c567f3a.js +23 -16
- package/dist/solutions-components/p-1c883db9.entry.js +43 -0
- package/dist/solutions-components/p-1f225056.js +322 -0
- package/dist/solutions-components/p-1f499e67.entry.js +72 -0
- package/dist/solutions-components/p-20d3d758.entry.js +881 -0
- package/dist/solutions-components/p-2274ac9e.entry.js +160 -0
- package/dist/solutions-components/p-23ec5ac5.entry.js +93 -0
- package/dist/solutions-components/p-2447798c.entry.js +155 -0
- package/dist/solutions-components/p-2525e691.entry.js +432 -0
- package/dist/solutions-components/p-2561f5b5.js +4092 -0
- package/dist/solutions-components/p-29f887c0.entry.js +234 -0
- package/dist/solutions-components/p-2a0d8047.entry.js +345 -0
- package/dist/solutions-components/p-2c177e6a.entry.js +101 -0
- package/dist/solutions-components/p-2e9ed892.js +46 -1
- package/dist/solutions-components/p-316f56db.js +219 -2
- package/dist/solutions-components/p-327f3ebf.entry.js +98 -0
- package/dist/solutions-components/p-356f8b54.entry.js +138 -0
- package/dist/solutions-components/p-359c58de.entry.js +172 -0
- package/dist/solutions-components/p-37336c0d.entry.js +116 -0
- package/dist/solutions-components/p-374a5031.js +105 -2
- package/dist/solutions-components/p-39ea6ef4.entry.js +71 -0
- package/dist/solutions-components/p-3b010ce1.js +17 -1
- package/dist/solutions-components/p-4307dacd.js +194 -1
- package/dist/solutions-components/p-44da2507.js +405 -14
- package/dist/solutions-components/p-46bdffe8.entry.js +54 -0
- package/dist/solutions-components/p-4894bbeb.js +53 -2
- package/dist/solutions-components/p-4cd569f1.entry.js +1298 -0
- package/dist/solutions-components/p-4d4160f9.entry.js +121 -0
- package/dist/solutions-components/p-4e32bf8c.js +482 -1
- package/dist/solutions-components/p-4e9cbd32.entry.js +184 -0
- package/dist/solutions-components/p-508317b3.js +13 -2
- package/dist/solutions-components/p-54697d58.entry.js +198 -0
- package/dist/solutions-components/p-55c79103.entry.js +311 -0
- package/dist/solutions-components/p-57fd19c0.entry.js +706 -0
- package/dist/solutions-components/p-59b48fde.entry.js +443 -0
- package/dist/solutions-components/p-60e0e6a0.entry.js +214 -0
- package/dist/solutions-components/p-621d0534.entry.js +123 -0
- package/dist/solutions-components/p-63f6e8f1.js +14 -1
- package/dist/solutions-components/p-66aeec57.entry.js +61 -0
- package/dist/solutions-components/p-69834f46.entry.js +618 -0
- package/dist/solutions-components/p-6d9da8e5.entry.js +21530 -0
- package/dist/solutions-components/p-6e0da576.js +13 -1
- package/dist/solutions-components/p-6ec3f294.entry.js +106 -0
- package/dist/solutions-components/p-6fe17794.js +9 -1
- package/dist/solutions-components/p-7024cb16.entry.js +72 -0
- package/dist/solutions-components/p-70535506.entry.js +226 -0
- package/dist/solutions-components/p-708a63a8.js +12 -1
- package/dist/solutions-components/p-729708a3.js +14 -1
- package/dist/solutions-components/p-73e23995.js +6 -1
- package/dist/solutions-components/p-74b29d75.entry.js +231 -0
- package/dist/solutions-components/p-74b7ee25.entry.js +711 -0
- package/dist/solutions-components/p-77182c3a.js +3015 -1
- package/dist/solutions-components/p-78b3ef80.entry.js +456 -0
- package/dist/solutions-components/p-79709c19.js +60 -3
- package/dist/solutions-components/p-7a46ef97.js +181 -2
- package/dist/solutions-components/p-7be159e6.entry.js +175 -0
- package/dist/solutions-components/p-7d4451c2.entry.js +71 -0
- package/dist/solutions-components/p-7daea1df.js +41 -1
- package/dist/solutions-components/p-7e39e5ad.entry.js +102 -0
- package/dist/solutions-components/p-7fb45059.entry.js +43 -0
- package/dist/solutions-components/p-815533de.js +306 -3
- package/dist/solutions-components/p-816622ca.entry.js +248 -0
- package/dist/solutions-components/p-83166522.js +205 -2
- package/dist/solutions-components/p-83bd1991.entry.js +36 -0
- package/dist/solutions-components/p-856464d7.entry.js +572 -0
- package/dist/solutions-components/p-8c349bad.entry.js +347 -0
- package/dist/solutions-components/p-8dccb390.entry.js +1986 -0
- package/dist/solutions-components/p-904c185a.entry.js +228 -0
- package/dist/solutions-components/p-9092f8b3.entry.js +156 -0
- package/dist/solutions-components/p-9371145a.entry.js +477 -0
- package/dist/solutions-components/p-93d3119d.js +1948 -1
- package/dist/solutions-components/p-95ec8062.entry.js +173 -0
- package/dist/solutions-components/p-991ee695.js +109 -1
- package/dist/solutions-components/p-9a57dab7.entry.js +213 -0
- package/dist/solutions-components/p-9a9955db.js +41 -1
- package/dist/solutions-components/p-9c1ebc90.js +35 -16
- package/dist/solutions-components/p-9eba5c66.js +399 -3
- package/dist/solutions-components/p-a033a507.entry.js +252 -0
- package/dist/solutions-components/p-a3773415.entry.js +1132 -0
- package/dist/solutions-components/p-a44fe40f.entry.js +94 -0
- package/dist/solutions-components/p-a5b1ab03.js +33 -3
- package/dist/solutions-components/p-a5b2c13d.entry.js +723 -0
- package/dist/solutions-components/p-a6d729b7.entry.js +85 -0
- package/dist/solutions-components/p-a8005026.entry.js +565 -0
- package/dist/solutions-components/p-a80b3880.js +14 -1
- package/dist/solutions-components/p-a89198a3.entry.js +2620 -0
- package/dist/solutions-components/p-aa04bd1f.entry.js +95 -0
- package/dist/solutions-components/p-aa0a0922.entry.js +80 -0
- package/dist/solutions-components/p-ae1fd76b.js +11 -1
- package/dist/solutions-components/p-b2cf435e.entry.js +87 -0
- package/dist/solutions-components/p-b359dc78.js +41 -1
- package/dist/solutions-components/p-b57bc4eb.entry.js +71 -0
- package/dist/solutions-components/p-b75cc407.entry.js +145 -0
- package/dist/solutions-components/p-b911cb75.entry.js +71 -0
- package/dist/solutions-components/p-b965e177.entry.js +335 -0
- package/dist/solutions-components/p-b978636e.js +14 -1
- package/dist/solutions-components/p-ba10a5c8.entry.js +42 -0
- package/dist/solutions-components/p-bd67334c.js +122 -2
- package/dist/solutions-components/p-bde20dba.entry.js +212 -0
- package/dist/solutions-components/p-be0b5a94.entry.js +248 -0
- package/dist/solutions-components/p-c023e6a1.js +2028 -2
- package/dist/solutions-components/p-c27b0c2d.entry.js +150 -0
- package/dist/solutions-components/p-c579ed60.entry.js +447 -0
- package/dist/solutions-components/p-c92bc231.js +101 -2
- package/dist/solutions-components/p-cc815aca.js +839 -16
- package/dist/solutions-components/p-cc8beabb.entry.js +695 -0
- package/dist/solutions-components/p-cdc46c0c.js +1751 -2
- package/dist/solutions-components/p-d12e6992.entry.js +118 -0
- package/dist/solutions-components/p-d1dfed6b.entry.js +179 -0
- package/dist/solutions-components/p-d48a24e6.js +754 -2
- package/dist/solutions-components/p-d96ee3ef.entry.js +579 -0
- package/dist/solutions-components/p-dbc9a5a8.js +80 -0
- package/dist/solutions-components/p-dcdbe712.entry.js +278 -0
- package/dist/solutions-components/p-de39206f.entry.js +113 -0
- package/dist/solutions-components/p-de5416e8.js +28 -1
- package/dist/solutions-components/p-df420d54.entry.js +213 -0
- package/dist/solutions-components/p-e3138cf0.entry.js +20 -0
- package/dist/solutions-components/p-e4845fec.entry.js +152 -0
- package/dist/solutions-components/p-e611d8c8.js +28 -1
- package/dist/solutions-components/p-e947d3b0.js +5 -1
- package/dist/solutions-components/p-ea534300.js +41 -2
- package/dist/solutions-components/p-ec84ee85.entry.js +55 -0
- package/dist/solutions-components/p-ed36c637.entry.js +85 -0
- package/dist/solutions-components/p-f0add71c.js +74 -0
- package/dist/solutions-components/p-f42e014b.js +171 -2
- package/dist/solutions-components/p-fc02e7de.entry.js +308 -0
- package/dist/solutions-components/p-fc884dd6.js +28 -16
- package/dist/solutions-components/p-fcbfa59c.entry.js +181 -0
- package/dist/solutions-components/p-fdc5cf5f.entry.js +138 -0
- package/dist/solutions-components/solutions-components.esm.js +20 -1
- package/dist/solutions-components/utils/interfaces.ts +2 -2
- package/dist/types/components/buffer-tools/buffer-tools.d.ts +2 -2
- package/dist/types/components/public-notification/public-notification.d.ts +9 -1
- package/dist/types/components.d.ts +2 -2
- package/package.json +1 -1
- package/dist/solutions-components/p-021432b8.entry.js +0 -12
- package/dist/solutions-components/p-03440b1e.entry.js +0 -11
- package/dist/solutions-components/p-0512635b.entry.js +0 -6
- package/dist/solutions-components/p-086ef115.entry.js +0 -29
- package/dist/solutions-components/p-0b4bf57f.entry.js +0 -6
- package/dist/solutions-components/p-0c088725.entry.js +0 -6
- package/dist/solutions-components/p-0f820c08.entry.js +0 -6
- package/dist/solutions-components/p-164780a0.entry.js +0 -6
- package/dist/solutions-components/p-179a68a0.entry.js +0 -6
- package/dist/solutions-components/p-184b5005.entry.js +0 -11
- package/dist/solutions-components/p-1d082fee.entry.js +0 -11
- package/dist/solutions-components/p-1e6c02a2.entry.js +0 -11
- package/dist/solutions-components/p-20a58e62.entry.js +0 -17
- package/dist/solutions-components/p-20b2458c.entry.js +0 -11
- package/dist/solutions-components/p-245d47c1.entry.js +0 -6
- package/dist/solutions-components/p-2cb057a9.entry.js +0 -11
- package/dist/solutions-components/p-2cc72806.entry.js +0 -23
- package/dist/solutions-components/p-2de1db9c.entry.js +0 -11
- package/dist/solutions-components/p-2e9c7055.entry.js +0 -11
- package/dist/solutions-components/p-2ed5e6c8.entry.js +0 -11
- package/dist/solutions-components/p-3109d940.entry.js +0 -6
- package/dist/solutions-components/p-31a8bcfa.entry.js +0 -6
- package/dist/solutions-components/p-3649acb3.entry.js +0 -18
- package/dist/solutions-components/p-3f88ba73.entry.js +0 -6
- package/dist/solutions-components/p-3fa9b3c8.js +0 -36
- package/dist/solutions-components/p-40c41709.entry.js +0 -6
- package/dist/solutions-components/p-40e963c7.entry.js +0 -11
- package/dist/solutions-components/p-40f480da.entry.js +0 -11
- package/dist/solutions-components/p-49d5d2d3.entry.js +0 -11
- package/dist/solutions-components/p-4f7049a4.entry.js +0 -11
- package/dist/solutions-components/p-506e4d78.entry.js +0 -6
- package/dist/solutions-components/p-576fdcab.entry.js +0 -6
- package/dist/solutions-components/p-5bd0cf34.entry.js +0 -23
- package/dist/solutions-components/p-65e177f1.entry.js +0 -6
- package/dist/solutions-components/p-67d710c2.entry.js +0 -6
- package/dist/solutions-components/p-7268b445.entry.js +0 -11
- package/dist/solutions-components/p-75ea4667.entry.js +0 -6
- package/dist/solutions-components/p-778c0a36.entry.js +0 -17
- package/dist/solutions-components/p-7a22509b.entry.js +0 -12
- package/dist/solutions-components/p-7bff51db.entry.js +0 -6
- package/dist/solutions-components/p-7d2d0d5d.entry.js +0 -6
- package/dist/solutions-components/p-7f0036f1.entry.js +0 -11
- package/dist/solutions-components/p-8060fb94.entry.js +0 -6
- package/dist/solutions-components/p-80a1b305.entry.js +0 -6
- package/dist/solutions-components/p-81eae877.entry.js +0 -12
- package/dist/solutions-components/p-84e86b8b.entry.js +0 -6
- package/dist/solutions-components/p-851e04ae.entry.js +0 -6
- package/dist/solutions-components/p-9106950a.entry.js +0 -11
- package/dist/solutions-components/p-979804a4.entry.js +0 -11
- package/dist/solutions-components/p-9862baa8.entry.js +0 -11
- package/dist/solutions-components/p-9b5a9117.entry.js +0 -12
- package/dist/solutions-components/p-9deff0c2.entry.js +0 -6
- package/dist/solutions-components/p-9f400eeb.entry.js +0 -6
- package/dist/solutions-components/p-a0639ad1.entry.js +0 -11
- package/dist/solutions-components/p-a33c044e.entry.js +0 -6
- package/dist/solutions-components/p-a516c658.entry.js +0 -6
- package/dist/solutions-components/p-aa0ef36d.entry.js +0 -11
- package/dist/solutions-components/p-aaccbdf3.entry.js +0 -18
- package/dist/solutions-components/p-ab03a5c9.entry.js +0 -11
- package/dist/solutions-components/p-ad469b92.entry.js +0 -11
- package/dist/solutions-components/p-adc86ac3.entry.js +0 -6
- package/dist/solutions-components/p-addc1156.entry.js +0 -11
- package/dist/solutions-components/p-ae846934.entry.js +0 -11
- package/dist/solutions-components/p-b0572fc4.entry.js +0 -37
- package/dist/solutions-components/p-b4e476b7.js +0 -257
- package/dist/solutions-components/p-b668daf8.js +0 -21
- package/dist/solutions-components/p-b6e6eae1.entry.js +0 -6
- package/dist/solutions-components/p-bc317a7f.entry.js +0 -6
- package/dist/solutions-components/p-be41429f.js +0 -21
- package/dist/solutions-components/p-bf6b6353.entry.js +0 -11
- package/dist/solutions-components/p-c2e3dfbb.entry.js +0 -11
- package/dist/solutions-components/p-c4afae53.entry.js +0 -12
- package/dist/solutions-components/p-c9da1c26.entry.js +0 -6
- package/dist/solutions-components/p-cbf8cd49.entry.js +0 -6
- package/dist/solutions-components/p-cc1a064a.entry.js +0 -11
- package/dist/solutions-components/p-d09a168c.entry.js +0 -6
- package/dist/solutions-components/p-d377f913.entry.js +0 -11
- package/dist/solutions-components/p-d4cefead.entry.js +0 -37
- package/dist/solutions-components/p-d7bc0baf.entry.js +0 -16
- package/dist/solutions-components/p-d8968487.entry.js +0 -11
- package/dist/solutions-components/p-e00a0b86.entry.js +0 -11
- package/dist/solutions-components/p-e9a7ed49.entry.js +0 -11
- package/dist/solutions-components/p-ec27e493.entry.js +0 -11
- package/dist/solutions-components/p-ed6404eb.entry.js +0 -6
- package/dist/solutions-components/p-ef21e195.entry.js +0 -23
- package/dist/solutions-components/p-f6068a2d.entry.js +0 -11
- package/dist/solutions-components/p-f6c4cff3.entry.js +0 -11
- package/dist/solutions-components/p-f847291f.entry.js +0 -6
- package/dist/solutions-components/p-f90fd262.entry.js +0 -11
- package/dist/solutions-components/p-fc973005.entry.js +0 -6
- package/dist/solutions-components/p-ff9fb6bc.entry.js +0 -11
@@ -0,0 +1,101 @@
|
|
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 { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './p-c023e6a1.js';
|
7
|
+
import { E as EDistressType, a as ESeverity, b as calculateDeductValue } from './p-cc815aca.js';
|
8
|
+
|
9
|
+
const deductCalculatorCss = ":host{display:block;--calcite-label-margin-bottom:0}.label-display{display:block;padding-bottom:1rem}";
|
10
|
+
|
11
|
+
const DeductCalculator = class {
|
12
|
+
constructor(hostRef) {
|
13
|
+
registerInstance(this, hostRef);
|
14
|
+
this.deductValueComplete = createEvent(this, "deductValueComplete", 7);
|
15
|
+
/**
|
16
|
+
* string[]: Array of the distress types
|
17
|
+
*/
|
18
|
+
this._types = Object.keys(EDistressType).filter(k => !isNaN(Number(EDistressType[k])));
|
19
|
+
}
|
20
|
+
//--------------------------------------------------------------------------
|
21
|
+
//
|
22
|
+
// Functions (lifecycle)
|
23
|
+
//
|
24
|
+
//--------------------------------------------------------------------------
|
25
|
+
/**
|
26
|
+
* Renders the component.
|
27
|
+
*/
|
28
|
+
render() {
|
29
|
+
return (h(Host, null, h("div", { class: "label-display" }, h("calcite-label", { class: "label-display" }, "Density %", this._getDensityInput()), h("calcite-label", { class: "label-display" }, "Type", this._getTypeInput()), h("calcite-label", { class: "label-display" }, "Severity", this._getSeverityInput())), h("div", null, this._getCalculateInput())));
|
30
|
+
}
|
31
|
+
//--------------------------------------------------------------------------
|
32
|
+
//
|
33
|
+
// Functions (protected)
|
34
|
+
//
|
35
|
+
//--------------------------------------------------------------------------
|
36
|
+
/**
|
37
|
+
* Render the density input
|
38
|
+
*
|
39
|
+
* @returns a node with a control to set the density number (float)
|
40
|
+
*
|
41
|
+
* @protected
|
42
|
+
*/
|
43
|
+
_getDensityInput() {
|
44
|
+
return (h("calcite-input", { max: 100, min: 0, ref: (el) => { this._densityElement = el; }, type: 'number' }));
|
45
|
+
}
|
46
|
+
/**
|
47
|
+
* Render the distress type input
|
48
|
+
*
|
49
|
+
* @returns a node with a control that shows the distress type name and value
|
50
|
+
* for example ALLIGATOR_CRACKING (1)
|
51
|
+
*
|
52
|
+
* @protected
|
53
|
+
*/
|
54
|
+
_getTypeInput() {
|
55
|
+
return (h("calcite-select", { label: '', ref: (el) => { this._typeElement = el; } }, this._types.map((t, i) => h("calcite-option", { value: EDistressType[t].toString() }, `${t} (${i + 1})`))));
|
56
|
+
}
|
57
|
+
/**
|
58
|
+
* Render the distress type input
|
59
|
+
*
|
60
|
+
* @returns a node with a control that shows the distress type name and value
|
61
|
+
* for example ALLIGATOR_CRACKING (1)
|
62
|
+
*
|
63
|
+
* @protected
|
64
|
+
*/
|
65
|
+
_getSeverityInput() {
|
66
|
+
return (h("calcite-select", { label: '', ref: (el) => { this._severityElement = el; } }, h("calcite-option", { value: ESeverity.H }, "High"), h("calcite-option", { value: ESeverity.M }, "Medium"), h("calcite-option", { value: ESeverity.L }, "Low")));
|
67
|
+
}
|
68
|
+
/**
|
69
|
+
* Render calculate deduct value button
|
70
|
+
*
|
71
|
+
* @returns a node with a control that calculates the deduct value
|
72
|
+
*
|
73
|
+
* @protected
|
74
|
+
*/
|
75
|
+
_getCalculateInput() {
|
76
|
+
return (h("calcite-button", { onClick: () => this._calculateDeduct(parseFloat(this._typeElement.value), this._severityElement.value, parseFloat(this._densityElement.value)) }, "Calculate Deduct Value"));
|
77
|
+
}
|
78
|
+
/**
|
79
|
+
* Calculate the deduct value based on the user inputs using the ASTM methodology
|
80
|
+
*
|
81
|
+
* @param type distress type 1-19 based on ASTM
|
82
|
+
* @param severity "H" | "M" | "L" high, med, low based on ASTM
|
83
|
+
* @param density percent density of the distress type and severity based on total sample area
|
84
|
+
*
|
85
|
+
* @protected
|
86
|
+
*/
|
87
|
+
_calculateDeduct(type, severity, density) {
|
88
|
+
if (type && severity && !isNaN(density)) {
|
89
|
+
const dv = calculateDeductValue(type.toString(), severity.toString(), density.toString(), true);
|
90
|
+
this.deductValueComplete.emit(dv);
|
91
|
+
alert(dv);
|
92
|
+
}
|
93
|
+
else {
|
94
|
+
alert("Type, severity, and a density number are required");
|
95
|
+
}
|
96
|
+
}
|
97
|
+
get el() { return getElement(this); }
|
98
|
+
};
|
99
|
+
DeductCalculator.style = deductCalculatorCss;
|
100
|
+
|
101
|
+
export { DeductCalculator as deduct_calculator };
|
@@ -8,4 +8,49 @@
|
|
8
8
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
9
9
|
* v1.0.0-beta.97
|
10
10
|
*/
|
11
|
-
const
|
11
|
+
const componentToTransitionListeners = new WeakMap();
|
12
|
+
function transitionStart(event) {
|
13
|
+
if (event.propertyName === this.openTransitionProp && event.target === this.transitionEl) {
|
14
|
+
this.open ? this.onBeforeOpen() : this.onBeforeClose();
|
15
|
+
}
|
16
|
+
}
|
17
|
+
function transitionEnd(event) {
|
18
|
+
if (event.propertyName === this.openTransitionProp && event.target === this.transitionEl) {
|
19
|
+
this.open ? this.onOpen() : this.onClose();
|
20
|
+
}
|
21
|
+
}
|
22
|
+
/**
|
23
|
+
* Helper to keep track of transition listeners on setTransitionEl and connectedCallback on OpenCloseComponent components.
|
24
|
+
*
|
25
|
+
* @param component
|
26
|
+
*/
|
27
|
+
function connectOpenCloseComponent(component) {
|
28
|
+
disconnectOpenCloseComponent(component);
|
29
|
+
if (component.transitionEl) {
|
30
|
+
const boundOnTransitionStart = transitionStart.bind(component);
|
31
|
+
const boundOnTransitionEnd = transitionEnd.bind(component);
|
32
|
+
componentToTransitionListeners.set(component, [
|
33
|
+
component.transitionEl,
|
34
|
+
boundOnTransitionStart,
|
35
|
+
boundOnTransitionEnd
|
36
|
+
]);
|
37
|
+
component.transitionEl.addEventListener("transitionstart", boundOnTransitionStart);
|
38
|
+
component.transitionEl.addEventListener("transitionend", boundOnTransitionEnd);
|
39
|
+
}
|
40
|
+
}
|
41
|
+
/**
|
42
|
+
* Helper to tear down transition listeners on disconnectedCallback on OpenCloseComponent components.
|
43
|
+
*
|
44
|
+
* @param component
|
45
|
+
*/
|
46
|
+
function disconnectOpenCloseComponent(component) {
|
47
|
+
if (!componentToTransitionListeners.has(component)) {
|
48
|
+
return;
|
49
|
+
}
|
50
|
+
const [transitionEl, start, end] = componentToTransitionListeners.get(component);
|
51
|
+
transitionEl.removeEventListener("transitionstart", start);
|
52
|
+
transitionEl.removeEventListener("transitionend", end);
|
53
|
+
componentToTransitionListeners.delete(component);
|
54
|
+
}
|
55
|
+
|
56
|
+
export { connectOpenCloseComponent as c, disconnectOpenCloseComponent as d };
|
@@ -3,9 +3,226 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{c as
|
6
|
+
import { c as closestElementCrossShadowBoundary } from './p-83166522.js';
|
7
|
+
import { h } from './p-c023e6a1.js';
|
8
|
+
|
7
9
|
/*!
|
8
10
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
9
11
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
10
12
|
* v1.0.0-beta.97
|
11
|
-
*/
|
13
|
+
*/
|
14
|
+
/**
|
15
|
+
* Exported for testing purposes.
|
16
|
+
*/
|
17
|
+
const hiddenFormInputSlotName = "hidden-form-input";
|
18
|
+
function isCheckable(component) {
|
19
|
+
return "checked" in component;
|
20
|
+
}
|
21
|
+
const onFormResetMap = new WeakMap();
|
22
|
+
const formComponentSet = new WeakSet();
|
23
|
+
function hasRegisteredFormComponentParent(form, formComponentEl) {
|
24
|
+
// we use events as a way to test for nested form-associated components across shadow bounds
|
25
|
+
const formComponentRegisterEventName = "calciteInternalFormComponentRegister";
|
26
|
+
let hasRegisteredFormComponentParent = false;
|
27
|
+
form.addEventListener(formComponentRegisterEventName, (event) => {
|
28
|
+
hasRegisteredFormComponentParent = event
|
29
|
+
.composedPath()
|
30
|
+
.some((element) => formComponentSet.has(element));
|
31
|
+
event.stopPropagation();
|
32
|
+
}, { once: true });
|
33
|
+
formComponentEl.dispatchEvent(new CustomEvent(formComponentRegisterEventName, {
|
34
|
+
bubbles: true,
|
35
|
+
composed: true
|
36
|
+
}));
|
37
|
+
return hasRegisteredFormComponentParent;
|
38
|
+
}
|
39
|
+
/**
|
40
|
+
* Helper to submit a form.
|
41
|
+
*
|
42
|
+
* @param component
|
43
|
+
* @returns true if its associated form was submitted, false otherwise.
|
44
|
+
*/
|
45
|
+
function submitForm(component) {
|
46
|
+
const { formEl } = component;
|
47
|
+
if (!formEl) {
|
48
|
+
return false;
|
49
|
+
}
|
50
|
+
"requestSubmit" in formEl ? formEl.requestSubmit() : formEl.submit();
|
51
|
+
return true;
|
52
|
+
}
|
53
|
+
/**
|
54
|
+
* Helper to reset a form.
|
55
|
+
*
|
56
|
+
* @param component
|
57
|
+
*/
|
58
|
+
function resetForm(component) {
|
59
|
+
var _a;
|
60
|
+
(_a = component.formEl) === null || _a === void 0 ? void 0 : _a.reset();
|
61
|
+
}
|
62
|
+
/**
|
63
|
+
* Helper to set up form interactions on connectedCallback.
|
64
|
+
*
|
65
|
+
* @param component
|
66
|
+
*/
|
67
|
+
function connectForm(component) {
|
68
|
+
const { el, value } = component;
|
69
|
+
const form = closestElementCrossShadowBoundary(el, "form");
|
70
|
+
if (!form || hasRegisteredFormComponentParent(form, el)) {
|
71
|
+
return;
|
72
|
+
}
|
73
|
+
component.formEl = form;
|
74
|
+
component.defaultValue = value;
|
75
|
+
if (isCheckable(component)) {
|
76
|
+
component.defaultChecked = component.checked;
|
77
|
+
}
|
78
|
+
const boundOnFormReset = (component.onFormReset || onFormReset).bind(component);
|
79
|
+
form.addEventListener("reset", boundOnFormReset);
|
80
|
+
onFormResetMap.set(component.el, boundOnFormReset);
|
81
|
+
formComponentSet.add(el);
|
82
|
+
}
|
83
|
+
function onFormReset() {
|
84
|
+
if (isCheckable(this)) {
|
85
|
+
this.checked = this.defaultChecked;
|
86
|
+
return;
|
87
|
+
}
|
88
|
+
this.value = this.defaultValue;
|
89
|
+
}
|
90
|
+
/**
|
91
|
+
* Helper to tear down form interactions on disconnectedCallback.
|
92
|
+
*
|
93
|
+
* @param component
|
94
|
+
*/
|
95
|
+
function disconnectForm(component) {
|
96
|
+
const { el, formEl } = component;
|
97
|
+
if (!formEl) {
|
98
|
+
return;
|
99
|
+
}
|
100
|
+
const boundOnFormReset = onFormResetMap.get(el);
|
101
|
+
formEl.removeEventListener("reset", boundOnFormReset);
|
102
|
+
onFormResetMap.delete(el);
|
103
|
+
component.formEl = null;
|
104
|
+
formComponentSet.delete(el);
|
105
|
+
}
|
106
|
+
/**
|
107
|
+
* Helper for setting the default value on initialization after connectedCallback.
|
108
|
+
*
|
109
|
+
* Note that this is only needed if the default value cannot be determined on connectedCallback.
|
110
|
+
*
|
111
|
+
* @param component
|
112
|
+
* @param value
|
113
|
+
*/
|
114
|
+
function afterConnectDefaultValueSet(component, value) {
|
115
|
+
component.defaultValue = value;
|
116
|
+
}
|
117
|
+
const hiddenInputChangeHandler = (event) => {
|
118
|
+
event.target.dispatchEvent(new CustomEvent("calciteInternalHiddenInputChange", { bubbles: true }));
|
119
|
+
};
|
120
|
+
const removeHiddenInputChangeEventListener = (input) => input.removeEventListener("change", hiddenInputChangeHandler);
|
121
|
+
/**
|
122
|
+
* Helper for maintaining a form-associated's hidden input in sync with the component.
|
123
|
+
*
|
124
|
+
* Based on Ionic's approach: https://github.com/ionic-team/ionic-framework/blob/e4bf052794af9aac07f887013b9250d2a045eba3/core/src/utils/helpers.ts#L198
|
125
|
+
*
|
126
|
+
* @param component
|
127
|
+
*/
|
128
|
+
function syncHiddenFormInput(component) {
|
129
|
+
const { el, formEl, name, value } = component;
|
130
|
+
const { ownerDocument } = el;
|
131
|
+
const inputs = el.querySelectorAll(`input[slot="${hiddenFormInputSlotName}"]`);
|
132
|
+
if (!formEl || !name) {
|
133
|
+
inputs.forEach((input) => {
|
134
|
+
removeHiddenInputChangeEventListener(input);
|
135
|
+
input.remove();
|
136
|
+
});
|
137
|
+
return;
|
138
|
+
}
|
139
|
+
const values = Array.isArray(value) ? value : [value];
|
140
|
+
const extra = [];
|
141
|
+
const seen = new Set();
|
142
|
+
inputs.forEach((input) => {
|
143
|
+
const valueMatch = values.find((val) =>
|
144
|
+
/* intentional non-strict equality check */
|
145
|
+
val == input.value);
|
146
|
+
if (valueMatch != null) {
|
147
|
+
seen.add(valueMatch);
|
148
|
+
defaultSyncHiddenFormInput(component, input, valueMatch);
|
149
|
+
}
|
150
|
+
else {
|
151
|
+
extra.push(input);
|
152
|
+
}
|
153
|
+
});
|
154
|
+
let docFrag;
|
155
|
+
values.forEach((value) => {
|
156
|
+
if (seen.has(value)) {
|
157
|
+
return;
|
158
|
+
}
|
159
|
+
let input = extra.pop();
|
160
|
+
if (!input) {
|
161
|
+
input = ownerDocument.createElement("input");
|
162
|
+
input.slot = hiddenFormInputSlotName;
|
163
|
+
}
|
164
|
+
if (!docFrag) {
|
165
|
+
docFrag = ownerDocument.createDocumentFragment();
|
166
|
+
}
|
167
|
+
docFrag.append(input);
|
168
|
+
// emits when hidden input is autofilled
|
169
|
+
input.addEventListener("change", hiddenInputChangeHandler);
|
170
|
+
defaultSyncHiddenFormInput(component, input, value);
|
171
|
+
});
|
172
|
+
if (docFrag) {
|
173
|
+
el.append(docFrag);
|
174
|
+
}
|
175
|
+
extra.forEach((input) => {
|
176
|
+
removeHiddenInputChangeEventListener(input);
|
177
|
+
input.remove();
|
178
|
+
});
|
179
|
+
}
|
180
|
+
function defaultSyncHiddenFormInput(component, input, value) {
|
181
|
+
var _a;
|
182
|
+
const { defaultValue, disabled, name, required } = component;
|
183
|
+
// keep in sync to prevent losing reset value
|
184
|
+
input.defaultValue = defaultValue;
|
185
|
+
input.disabled = disabled;
|
186
|
+
input.name = name;
|
187
|
+
input.required = required;
|
188
|
+
input.tabIndex = -1;
|
189
|
+
if (isCheckable(component)) {
|
190
|
+
// keep in sync to prevent losing reset value
|
191
|
+
input.defaultChecked = component.defaultChecked;
|
192
|
+
// heuristic to support default/on mode from https://html.spec.whatwg.org/multipage/input.html#dom-input-value-default-on
|
193
|
+
input.value = component.checked ? value || "on" : "";
|
194
|
+
// we disable the component when not checked to avoid having its value submitted
|
195
|
+
if (!disabled && !component.checked) {
|
196
|
+
input.disabled = true;
|
197
|
+
}
|
198
|
+
}
|
199
|
+
else {
|
200
|
+
input.value = value || "";
|
201
|
+
}
|
202
|
+
(_a = component.syncHiddenFormInput) === null || _a === void 0 ? void 0 : _a.call(component, input);
|
203
|
+
}
|
204
|
+
/**
|
205
|
+
* Helper to render the slot for form-associated component's hidden input.
|
206
|
+
*
|
207
|
+
* If the component has a default slot, this must be placed at the bottom of the component's root container to ensure it is the last child.
|
208
|
+
*
|
209
|
+
* render(): VNode {
|
210
|
+
* <Host>
|
211
|
+
* <div class={CSS.container}>
|
212
|
+
* // ...
|
213
|
+
* <HiddenFormInputSlot component={this} />
|
214
|
+
* </div>
|
215
|
+
* </Host>
|
216
|
+
* }
|
217
|
+
*
|
218
|
+
* Note that the hidden-form-input Sass mixin must be added to the component's style to apply specific styles.
|
219
|
+
*
|
220
|
+
* @param root0
|
221
|
+
* @param root0.component
|
222
|
+
*/
|
223
|
+
const HiddenFormInputSlot = ({ component }) => {
|
224
|
+
syncHiddenFormInput(component);
|
225
|
+
return h("slot", { name: hiddenFormInputSlotName });
|
226
|
+
};
|
227
|
+
|
228
|
+
export { HiddenFormInputSlot as H, afterConnectDefaultValueSet as a, connectForm as c, disconnectForm as d, resetForm as r, submitForm as s };
|
@@ -0,0 +1,98 @@
|
|
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 { r as registerInstance, h, g as getElement } from './p-c023e6a1.js';
|
7
|
+
import { f as focusElement } from './p-83166522.js';
|
8
|
+
import { u as updateHostInteraction } from './p-7daea1df.js';
|
9
|
+
import './p-729708a3.js';
|
10
|
+
import './p-a80b3880.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
|
+
button: "button"
|
19
|
+
};
|
20
|
+
const ICONS = {
|
21
|
+
plus: "plus"
|
22
|
+
};
|
23
|
+
|
24
|
+
const fabCss = "@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{display:flex;background-color:transparent}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}calcite-button{--tw-shadow:0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08);--tw-shadow-colored:0 6px 20px -4px var(--tw-shadow-color), 0 4px 12px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}calcite-button:hover{--tw-shadow:0 12px 32px -2px rgba(0, 0, 0, 0.1), 0 4px 20px 0 rgba(0, 0, 0, 0.08);--tw-shadow-colored:0 12px 32px -2px var(--tw-shadow-color), 0 4px 20px 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)}calcite-button:active{--tw-shadow:0 2px 12px -4px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.16);--tw-shadow-colored:0 2px 12px -4px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}";
|
25
|
+
|
26
|
+
const Fab = class {
|
27
|
+
constructor(hostRef) {
|
28
|
+
registerInstance(this, hostRef);
|
29
|
+
// --------------------------------------------------------------------------
|
30
|
+
//
|
31
|
+
// Properties
|
32
|
+
//
|
33
|
+
// --------------------------------------------------------------------------
|
34
|
+
/**
|
35
|
+
* Used to set the button's appearance. Default is outline.
|
36
|
+
*/
|
37
|
+
this.appearance = "outline";
|
38
|
+
/**
|
39
|
+
* Used to set the button's color. Default is light.
|
40
|
+
*/
|
41
|
+
this.color = "neutral";
|
42
|
+
/**
|
43
|
+
* When true, disabled prevents interaction. This state shows items with lower opacity/grayed.
|
44
|
+
*/
|
45
|
+
this.disabled = false;
|
46
|
+
/**
|
47
|
+
* Specifies an icon to display.
|
48
|
+
*
|
49
|
+
* @default "plus"
|
50
|
+
*/
|
51
|
+
this.icon = ICONS.plus;
|
52
|
+
/**
|
53
|
+
* When true, content is waiting to be loaded. This state shows a busy indicator.
|
54
|
+
*/
|
55
|
+
this.loading = false;
|
56
|
+
/**
|
57
|
+
* Specifies the size of the fab.
|
58
|
+
*/
|
59
|
+
this.scale = "m";
|
60
|
+
/**
|
61
|
+
* Indicates whether the text is displayed.
|
62
|
+
*/
|
63
|
+
this.textEnabled = false;
|
64
|
+
}
|
65
|
+
//--------------------------------------------------------------------------
|
66
|
+
//
|
67
|
+
// Lifecycle
|
68
|
+
//
|
69
|
+
//--------------------------------------------------------------------------
|
70
|
+
componentDidRender() {
|
71
|
+
updateHostInteraction(this);
|
72
|
+
}
|
73
|
+
// --------------------------------------------------------------------------
|
74
|
+
//
|
75
|
+
// Methods
|
76
|
+
//
|
77
|
+
// --------------------------------------------------------------------------
|
78
|
+
/** Sets focus on the component. */
|
79
|
+
async setFocus() {
|
80
|
+
focusElement(this.buttonEl);
|
81
|
+
}
|
82
|
+
// --------------------------------------------------------------------------
|
83
|
+
//
|
84
|
+
// Render Methods
|
85
|
+
//
|
86
|
+
// --------------------------------------------------------------------------
|
87
|
+
render() {
|
88
|
+
const { appearance, color, disabled, loading, scale, textEnabled, icon, label, text } = this;
|
89
|
+
const title = !textEnabled ? label || text || null : null;
|
90
|
+
return (h("calcite-button", { appearance: appearance === "solid" ? "solid" : "outline", class: CSS.button, color: color, disabled: disabled, iconStart: icon, label: label, loading: loading, ref: (buttonEl) => {
|
91
|
+
this.buttonEl = buttonEl;
|
92
|
+
}, round: true, scale: scale, title: title, type: "button", width: "auto" }, this.textEnabled ? this.text : null));
|
93
|
+
}
|
94
|
+
get el() { return getElement(this); }
|
95
|
+
};
|
96
|
+
Fab.style = fabCss;
|
97
|
+
|
98
|
+
export { Fab as calcite_fab };
|
@@ -0,0 +1,138 @@
|
|
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 { r as registerInstance, c as createEvent, h, g as getElement } from './p-c023e6a1.js';
|
7
|
+
import { a as getSlotted } from './p-83166522.js';
|
8
|
+
import { g as guid } from './p-a80b3880.js';
|
9
|
+
import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './p-ea534300.js';
|
10
|
+
import './p-729708a3.js';
|
11
|
+
import './p-9a9955db.js';
|
12
|
+
|
13
|
+
/*!
|
14
|
+
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
15
|
+
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
16
|
+
* v1.0.0-beta.97
|
17
|
+
*/
|
18
|
+
const CSS = {
|
19
|
+
title: "title",
|
20
|
+
close: "close",
|
21
|
+
imageContainer: "image-container",
|
22
|
+
chipIcon: "chip-icon",
|
23
|
+
closeIcon: "close-icon"
|
24
|
+
};
|
25
|
+
const TEXT = {
|
26
|
+
close: "Close"
|
27
|
+
};
|
28
|
+
const SLOTS = {
|
29
|
+
image: "image"
|
30
|
+
};
|
31
|
+
const ICONS = {
|
32
|
+
close: "x"
|
33
|
+
};
|
34
|
+
|
35
|
+
const chipCss = "@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([scale=s]){block-size:1.5rem;font-size:var(--calcite-font-size--2);--calcite-chip-spacing-unit-l:0.5rem;--calcite-chip-spacing-unit-s:0.25rem}:host([scale=s]) .image-container{block-size:1.25rem;inline-size:1.25rem}:host([scale=m]){block-size:2rem;font-size:var(--calcite-font-size--1);--calcite-chip-spacing-unit-l:0.75rem;--calcite-chip-spacing-unit-s:6px}:host([scale=m]) .image-container{block-size:1.5rem;inline-size:1.5rem;-webkit-padding-start:0.25rem;padding-inline-start:0.25rem}:host([scale=l]){block-size:2.75rem;font-size:var(--calcite-font-size-0);--calcite-chip-spacing-unit-l:1rem;--calcite-chip-spacing-unit-s:0.5rem}:host([scale=l]) .image-container{block-size:2rem;inline-size:2rem;-webkit-padding-start:0.25rem;padding-inline-start:0.25rem}:host{box-sizing:border-box;display:inline-flex;cursor:default;align-items:center;border-radius:9999px;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-1);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}.container{display:inline-flex;block-size:100%;max-inline-size:100%;align-items:center}.title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host span{padding-block:0;padding-inline:var(--calcite-chip-spacing-unit-l)}:host([closable]) span{padding-inline:var(--calcite-chip-spacing-unit-l) var(--calcite-chip-spacing-unit-s)}:host([icon]:not([closable])) span{padding-block:0;padding-inline:var(--calcite-chip-spacing-unit-l)}:host button{margin:0px;display:inline-flex;max-block-size:100%;min-block-size:100%;cursor:pointer;align-items:center;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-ui-text-1);outline-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;-webkit-appearance:none;border-start-start-radius:0;border-start-end-radius:50px;border-end-end-radius:50px;border-end-start-radius:0;padding-block:0;padding-inline:var(--calcite-chip-spacing-unit-s);color:inherit;--calcite-chip-transparent-hover:var(--calcite-button-transparent-hover);--calcite-chip-transparent-press:var(--calcite-button-transparent-press)}:host button:hover{background-color:var(--calcite-chip-transparent-hover)}:host button:focus{background-color:var(--calcite-chip-transparent-hover);outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}:host button:active{background-color:var(--calcite-chip-transparent-press)}.image-container{display:inline-flex;overflow:hidden;border-radius:50%}:host slot[name=image]::slotted(*){display:flex;block-size:100%;inline-size:100%;overflow:hidden;border-radius:50%}.chip-icon{position:relative;margin-block:0px;display:inline-flex;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-margin-end:0;margin-inline-end:0;-webkit-margin-start:var(--calcite-chip-spacing-unit-l);margin-inline-start:var(--calcite-chip-spacing-unit-l);border-start-start-radius:0;border-start-end-radius:50px;border-end-end-radius:50px;border-end-start-radius:0}:host([color=blue]){border-color:transparent;background-color:var(--calcite-ui-info);color:var(--calcite-ui-text-inverse)}:host([color=red]){border-color:transparent;background-color:var(--calcite-ui-danger);color:var(--calcite-ui-text-inverse)}:host([color=yellow]){border-color:transparent;background-color:var(--calcite-ui-warning);color:#151515}:host([color=green]){border-color:transparent;background-color:var(--calcite-ui-success);color:#151515}:host([color=grey]){border-color:transparent;background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}:host([color=grey]) button,:host([color=grey]) .close-icon{color:var(--calcite-ui-text-3)}:host([color=grey]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-text-3))}:host([appearance=clear]),:host([appearance=transparent]){background-color:transparent;color:var(--calcite-ui-text-1)}:host([color=blue][appearance=clear]),:host([color=blue][appearance=transparent]){border-color:var(--calcite-ui-info)}:host([color=blue][appearance=clear]) .chip-icon,:host([color=blue][appearance=transparent]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-info))}:host([color=red][appearance=clear]),:host([color=red][appearance=transparent]){border-color:var(--calcite-ui-danger)}:host([color=red][appearance=clear]) .chip-icon,:host([color=red][appearance=transparent]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-danger))}:host([color=yellow][appearance=clear]),:host([color=yellow][appearance=transparent]){border-color:var(--calcite-ui-warning)}:host([color=yellow][appearance=clear]) .chip-icon,:host([color=yellow][appearance=transparent]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-warning))}:host([color=green][appearance=clear]),:host([color=green][appearance=transparent]){border-color:var(--calcite-ui-success)}:host([color=green][appearance=clear]) .chip-icon,:host([color=green][appearance=transparent]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-success))}:host([color=grey][appearance=clear]),:host([color=grey][appearance=transparent]){border-color:var(--calcite-ui-border-1)}:host([color=grey][appearance=clear]) .chip-icon,:host([color=grey][appearance=transparent]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-text-3))}:host([closed]){display:none}";
|
36
|
+
|
37
|
+
const Chip = class {
|
38
|
+
constructor(hostRef) {
|
39
|
+
registerInstance(this, hostRef);
|
40
|
+
this.calciteChipDismiss = createEvent(this, "calciteChipDismiss", 6);
|
41
|
+
//--------------------------------------------------------------------------
|
42
|
+
//
|
43
|
+
// Public Properties
|
44
|
+
//
|
45
|
+
//--------------------------------------------------------------------------
|
46
|
+
/** Specifies the appearance style of the component. */
|
47
|
+
this.appearance = "solid";
|
48
|
+
/** Specifies the color for the component. */
|
49
|
+
this.color = "grey";
|
50
|
+
/**
|
51
|
+
* When `true`, a close button is added to the component.
|
52
|
+
*
|
53
|
+
* @deprecated use `closable` instead.
|
54
|
+
*/
|
55
|
+
this.dismissible = false;
|
56
|
+
/** When `true`, a close button is added to the component. */
|
57
|
+
this.closable = false;
|
58
|
+
/**
|
59
|
+
* Accessible name for the component's close button.
|
60
|
+
*
|
61
|
+
* @default "Close"
|
62
|
+
*/
|
63
|
+
this.dismissLabel = TEXT.close;
|
64
|
+
/** When `true`, the icon will be flipped when the element direction is right-to-left (`"rtl"`). */
|
65
|
+
this.iconFlipRtl = false;
|
66
|
+
/** Specifies the size of the component. */
|
67
|
+
this.scale = "m";
|
68
|
+
/** When `true`, hides the component. */
|
69
|
+
this.closed = false;
|
70
|
+
// --------------------------------------------------------------------------
|
71
|
+
//
|
72
|
+
// Private Methods
|
73
|
+
//
|
74
|
+
// --------------------------------------------------------------------------
|
75
|
+
this.closeClickHandler = (event) => {
|
76
|
+
event.preventDefault();
|
77
|
+
this.calciteChipDismiss.emit(this.el);
|
78
|
+
this.closed = true;
|
79
|
+
};
|
80
|
+
this.guid = guid();
|
81
|
+
}
|
82
|
+
handleDismissible(value) {
|
83
|
+
this.closable = value;
|
84
|
+
}
|
85
|
+
handleClosable(value) {
|
86
|
+
this.dismissible = value;
|
87
|
+
}
|
88
|
+
// --------------------------------------------------------------------------
|
89
|
+
//
|
90
|
+
// Lifecycle
|
91
|
+
//
|
92
|
+
// --------------------------------------------------------------------------
|
93
|
+
connectedCallback() {
|
94
|
+
connectConditionalSlotComponent(this);
|
95
|
+
if (this.dismissible) {
|
96
|
+
this.handleDismissible(this.dismissible);
|
97
|
+
}
|
98
|
+
if (this.closable) {
|
99
|
+
this.handleClosable(this.closable);
|
100
|
+
}
|
101
|
+
}
|
102
|
+
disconnectedCallback() {
|
103
|
+
disconnectConditionalSlotComponent(this);
|
104
|
+
}
|
105
|
+
//--------------------------------------------------------------------------
|
106
|
+
//
|
107
|
+
// Public Methods
|
108
|
+
//
|
109
|
+
//--------------------------------------------------------------------------
|
110
|
+
/** Sets focus on the component. */
|
111
|
+
async setFocus() {
|
112
|
+
var _a;
|
113
|
+
(_a = this.closeButton) === null || _a === void 0 ? void 0 : _a.focus();
|
114
|
+
}
|
115
|
+
//--------------------------------------------------------------------------
|
116
|
+
//
|
117
|
+
// Render Methods
|
118
|
+
//
|
119
|
+
//--------------------------------------------------------------------------
|
120
|
+
renderChipImage() {
|
121
|
+
const { el } = this;
|
122
|
+
const hasChipImage = getSlotted(el, SLOTS.image);
|
123
|
+
return hasChipImage ? (h("div", { class: CSS.imageContainer, key: "image" }, h("slot", { name: SLOTS.image }))) : null;
|
124
|
+
}
|
125
|
+
render() {
|
126
|
+
const iconEl = (h("calcite-icon", { class: CSS.chipIcon, flipRtl: this.iconFlipRtl, icon: this.icon, scale: "s" }));
|
127
|
+
const closeButton = (h("button", { "aria-describedby": this.guid, "aria-label": this.dismissLabel, class: CSS.close, onClick: this.closeClickHandler, ref: (el) => (this.closeButton = el) }, h("calcite-icon", { class: CSS.closeIcon, icon: ICONS.close, scale: "s" })));
|
128
|
+
return (h("div", { class: "container" }, this.renderChipImage(), this.icon ? iconEl : null, h("span", { class: CSS.title, id: this.guid }, h("slot", null)), this.closable ? closeButton : null));
|
129
|
+
}
|
130
|
+
get el() { return getElement(this); }
|
131
|
+
static get watchers() { return {
|
132
|
+
"dismissible": ["handleDismissible"],
|
133
|
+
"closable": ["handleClosable"]
|
134
|
+
}; }
|
135
|
+
};
|
136
|
+
Chip.style = chipCss;
|
137
|
+
|
138
|
+
export { Chip as calcite_chip };
|