@esri/solutions-components 0.1.8 → 0.1.10
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 +21 -79
- package/dist/cjs/calcite-action-bar_6.cjs.entry.js +14 -16
- package/dist/cjs/calcite-action_2.cjs.entry.js +1 -1
- package/dist/cjs/calcite-block-section.cjs.entry.js +1 -1
- package/dist/cjs/calcite-block.cjs.entry.js +1 -1
- package/dist/cjs/calcite-button.cjs.entry.js +1 -1
- package/dist/cjs/calcite-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/calcite-color-picker-hex-input.cjs.entry.js +2 -2
- package/dist/cjs/calcite-color-picker-swatch.cjs.entry.js +1 -1
- package/dist/cjs/calcite-color-picker.cjs.entry.js +3 -3
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +3 -18
- package/dist/cjs/calcite-date-picker-day_3.cjs.entry.js +1 -1
- package/dist/cjs/calcite-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/calcite-fab.cjs.entry.js +1 -1
- package/dist/cjs/calcite-filter.cjs.entry.js +1 -1
- package/dist/cjs/calcite-flow-item.cjs.entry.js +1 -1
- package/dist/cjs/calcite-inline-editable.cjs.entry.js +1 -1
- package/dist/cjs/calcite-input-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/calcite-input-number.cjs.entry.js +1 -1
- package/dist/cjs/calcite-input-text.cjs.entry.js +1 -1
- package/dist/cjs/calcite-input-time-picker.cjs.entry.js +1 -1
- package/dist/cjs/calcite-input_2.cjs.entry.js +1 -1
- package/dist/cjs/calcite-label.cjs.entry.js +1 -1
- package/dist/cjs/calcite-link.cjs.entry.js +1 -1
- package/dist/cjs/calcite-list_2.cjs.entry.js +2 -2
- package/dist/cjs/calcite-option_2.cjs.entry.js +1 -1
- package/dist/cjs/calcite-pagination.cjs.entry.js +1 -1
- package/dist/cjs/calcite-panel_2.cjs.entry.js +1 -1
- package/dist/cjs/calcite-pick-list-item.cjs.entry.js +1 -1
- package/dist/cjs/calcite-pick-list.cjs.entry.js +1 -1
- package/dist/cjs/calcite-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/calcite-rating.cjs.entry.js +1 -1
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +17 -116
- package/dist/cjs/calcite-sortable-list.cjs.entry.js +1 -1
- package/dist/cjs/calcite-split-button.cjs.entry.js +1 -1
- package/dist/cjs/calcite-stepper-item.cjs.entry.js +1 -1
- package/dist/cjs/calcite-switch.cjs.entry.js +1 -1
- package/dist/cjs/calcite-tile-select-group.cjs.entry.js +1 -1
- package/dist/cjs/calcite-tile-select.cjs.entry.js +1 -1
- package/dist/cjs/calcite-tile.cjs.entry.js +1 -1
- package/dist/cjs/calcite-time-picker.cjs.entry.js +1 -1
- package/dist/cjs/calcite-tree_3.cjs.entry.js +1 -15
- package/dist/cjs/check-list.cjs.entry.js +2 -10
- package/dist/cjs/config-buffer-tools.cjs.entry.js +2 -11
- package/dist/cjs/config-draw-tools.cjs.entry.js +1 -9
- package/dist/cjs/config-layer-picker.cjs.entry.js +2 -19
- package/dist/cjs/config-pdf-download.cjs.entry.js +1 -17
- package/dist/cjs/{index-73010cd8.js → index-7af21b6f.js} +7 -158
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-search.cjs.entry.js +3 -0
- package/dist/cjs/public-notification.cjs.entry.js +3 -24
- package/dist/cjs/{resources-f7622a24.js → resources-aa19bf8c.js} +1 -1
- package/dist/cjs/solution-configuration.cjs.entry.js +7 -24
- package/dist/cjs/solution-contents_3.cjs.entry.js +7 -33
- package/dist/cjs/solutions.cjs.js +1 -1
- package/dist/cjs/store-manager.cjs.entry.js +1 -12
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/buffer-tools/buffer-tools.js +1 -29
- package/dist/collection/components/check-list/check-list.js +2 -10
- package/dist/collection/components/config-buffer-tools/config-buffer-tools.js +2 -11
- package/dist/collection/components/config-draw-tools/config-draw-tools.js +1 -9
- package/dist/collection/components/config-layer-picker/config-layer-picker.js +2 -19
- package/dist/collection/components/config-pdf-download/config-pdf-download.js +1 -17
- package/dist/collection/components/json-editor/assets/monaco-editor/LICENSE +21 -21
- package/dist/collection/components/json-editor/json-editor.js +2 -22
- package/dist/collection/components/map-draw-tools/map-draw-tools.js +5 -14
- package/dist/collection/components/map-layer-picker/map-layer-picker.js +1 -16
- package/dist/collection/components/map-search/map-search.js +5 -0
- package/dist/collection/components/map-select-tools/map-select-tools.js +8 -4
- package/dist/collection/components/pdf-download/pdf-download.js +2 -8
- package/dist/collection/components/public-notification/public-notification.js +3 -24
- package/dist/collection/components/refine-selection/refine-selection.js +4 -4
- package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +13 -34
- package/dist/collection/components/solution-configuration/solution-configuration.js +7 -24
- package/dist/collection/components/solution-contents/solution-contents.js +1 -3
- package/dist/collection/components/solution-item/solution-item.js +3 -9
- package/dist/collection/components/solution-item-details/solution-item-details.js +4 -8
- package/dist/collection/components/solution-item-icon/solution-item-icon.js +0 -14
- package/dist/collection/components/solution-item-sharing/solution-item-sharing.js +1 -11
- package/dist/collection/components/solution-organization-variables/solution-organization-variables.js +1 -13
- package/dist/collection/components/solution-resource-item/solution-resource-item.js +3 -16
- package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +3 -21
- package/dist/collection/components/solution-template-data/solution-template-data.js +2 -30
- package/dist/collection/components/solution-variables/solution-variables.js +1 -13
- package/dist/collection/components/store-manager/store-manager.js +1 -12
- package/dist/components/action.js +1 -1
- package/dist/components/buffer-tools2.js +1 -29
- package/dist/components/button.js +1 -1
- package/dist/components/calcite-block-section.js +1 -1
- package/dist/components/calcite-block.js +1 -1
- package/dist/components/calcite-color-picker.js +1 -1
- package/dist/components/calcite-fab.js +1 -1
- package/dist/components/calcite-filter.js +1 -1
- package/dist/components/calcite-flow-item.js +1 -1
- package/dist/components/calcite-inline-editable.js +1 -1
- package/dist/components/calcite-input-date-picker.js +1 -1
- package/dist/components/calcite-input-number.js +1 -1
- package/dist/components/calcite-input-text.js +1 -1
- package/dist/components/calcite-input-time-picker.js +1 -1
- package/dist/components/calcite-pagination.js +1 -1
- package/dist/components/calcite-pick-list.js +1 -1
- package/dist/components/calcite-radio-button.js +1 -1
- package/dist/components/calcite-rating.js +1 -1
- package/dist/components/calcite-sortable-list.js +1 -1
- package/dist/components/calcite-split-button.js +1 -1
- package/dist/components/calcite-stepper-item.js +1 -1
- package/dist/components/calcite-tile-select-group.js +1 -1
- package/dist/components/calcite-tile-select.js +1 -1
- package/dist/components/check-list2.js +2 -10
- package/dist/components/checkbox.js +1 -1
- package/dist/components/color-picker-swatch.js +7 -158
- package/dist/components/combobox-item.js +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/config-buffer-tools.js +2 -11
- package/dist/components/config-draw-tools.js +1 -9
- package/dist/components/config-layer-picker.js +2 -19
- package/dist/components/config-pdf-download.js +1 -17
- package/dist/components/date-picker-day.js +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/json-editor2.js +2 -22
- package/dist/components/label.js +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/list-item.js +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/map-draw-tools2.js +5 -14
- package/dist/components/map-layer-picker2.js +1 -16
- package/dist/components/map-search.js +3 -0
- package/dist/components/map-select-tools2.js +8 -4
- package/dist/components/panel.js +1 -1
- package/dist/components/pdf-download2.js +2 -8
- package/dist/components/pick-list-item.js +1 -1
- package/dist/components/public-notification.js +3 -24
- package/dist/components/radio-group.js +1 -1
- package/dist/components/refine-selection-tools2.js +13 -34
- package/dist/components/refine-selection2.js +4 -4
- package/dist/components/select.js +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/solution-configuration.js +7 -24
- package/dist/components/solution-contents2.js +1 -3
- package/dist/components/solution-item-details2.js +4 -8
- package/dist/components/solution-item-icon2.js +0 -14
- package/dist/components/solution-item-sharing2.js +1 -11
- package/dist/components/solution-item2.js +3 -9
- package/dist/components/solution-organization-variables2.js +1 -13
- package/dist/components/solution-resource-item2.js +3 -16
- package/dist/components/solution-spatial-ref2.js +3 -21
- package/dist/components/solution-template-data2.js +2 -30
- package/dist/components/solution-variables2.js +1 -13
- package/dist/components/store-manager.js +1 -12
- package/dist/components/switch.js +1 -1
- package/dist/components/tab-title.js +1 -1
- package/dist/components/tile.js +1 -1
- package/dist/components/time-picker.js +1 -1
- package/dist/components/tree-item.js +1 -1
- package/dist/components/value-list-item.js +1 -1
- package/dist/components/value-list.js +1 -1
- package/dist/esm/buffer-tools_6.entry.js +21 -79
- package/dist/esm/calcite-action-bar_6.entry.js +14 -16
- package/dist/esm/calcite-action_2.entry.js +1 -1
- package/dist/esm/calcite-block-section.entry.js +1 -1
- package/dist/esm/calcite-block.entry.js +1 -1
- package/dist/esm/calcite-button.entry.js +1 -1
- package/dist/esm/calcite-checkbox.entry.js +1 -1
- package/dist/esm/calcite-color-picker-hex-input.entry.js +2 -2
- package/dist/esm/calcite-color-picker-swatch.entry.js +1 -1
- package/dist/esm/calcite-color-picker.entry.js +3 -3
- package/dist/esm/calcite-combobox_3.entry.js +3 -18
- package/dist/esm/calcite-date-picker-day_3.entry.js +1 -1
- package/dist/esm/calcite-dropdown.entry.js +1 -1
- package/dist/esm/calcite-fab.entry.js +1 -1
- package/dist/esm/calcite-filter.entry.js +1 -1
- package/dist/esm/calcite-flow-item.entry.js +1 -1
- package/dist/esm/calcite-inline-editable.entry.js +1 -1
- package/dist/esm/calcite-input-date-picker.entry.js +1 -1
- package/dist/esm/calcite-input-number.entry.js +1 -1
- package/dist/esm/calcite-input-text.entry.js +1 -1
- package/dist/esm/calcite-input-time-picker.entry.js +1 -1
- package/dist/esm/calcite-input_2.entry.js +1 -1
- package/dist/esm/calcite-label.entry.js +1 -1
- package/dist/esm/calcite-link.entry.js +1 -1
- package/dist/esm/calcite-list_2.entry.js +2 -2
- package/dist/esm/calcite-option_2.entry.js +1 -1
- package/dist/esm/calcite-pagination.entry.js +1 -1
- package/dist/esm/calcite-panel_2.entry.js +1 -1
- package/dist/esm/calcite-pick-list-item.entry.js +1 -1
- package/dist/esm/calcite-pick-list.entry.js +1 -1
- package/dist/esm/calcite-radio-button.entry.js +1 -1
- package/dist/esm/calcite-rating.entry.js +1 -1
- package/dist/esm/calcite-shell-panel_14.entry.js +17 -116
- package/dist/esm/calcite-sortable-list.entry.js +1 -1
- package/dist/esm/calcite-split-button.entry.js +1 -1
- package/dist/esm/calcite-stepper-item.entry.js +1 -1
- package/dist/esm/calcite-switch.entry.js +1 -1
- package/dist/esm/calcite-tile-select-group.entry.js +1 -1
- package/dist/esm/calcite-tile-select.entry.js +1 -1
- package/dist/esm/calcite-tile.entry.js +1 -1
- package/dist/esm/calcite-time-picker.entry.js +1 -1
- package/dist/esm/calcite-tree_3.entry.js +1 -15
- package/dist/esm/check-list.entry.js +2 -10
- package/dist/esm/config-buffer-tools.entry.js +2 -11
- package/dist/esm/config-draw-tools.entry.js +1 -9
- package/dist/esm/config-layer-picker.entry.js +2 -19
- package/dist/esm/config-pdf-download.entry.js +1 -17
- package/dist/esm/{index-dc607780.js → index-d33ebc35.js} +7 -158
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-search.entry.js +3 -0
- package/dist/esm/public-notification.entry.js +3 -24
- package/dist/esm/{resources-adf937de.js → resources-7d4a587f.js} +1 -1
- package/dist/esm/solution-configuration.entry.js +7 -24
- package/dist/esm/solution-contents_3.entry.js +7 -33
- package/dist/esm/solutions.js +1 -1
- package/dist/esm/store-manager.entry.js +1 -12
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/action/action.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/block/block.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/block-section/block-section.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/button/button.css +0 -2
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/checkbox/checkbox.css +0 -2
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/color-picker/color-picker.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/combobox/combobox.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/combobox-item/combobox-item.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/date-picker-day/date-picker-day.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/dropdown/dropdown.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/fab/fab.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/filter/filter.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/flow-item/flow-item.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/inline-editable/inline-editable.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/input/input.css +0 -6
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/input-date-picker/input-date-picker.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/input-number/input-number.css +0 -6
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/input-text/input-text.css +0 -6
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/input-time-picker/input-time-picker.css +0 -2
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/label/label.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/link/link.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/list/list.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/list-item/list-item.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/pagination/pagination.css +1 -2
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/panel/panel.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/pick-list/pick-list.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/pick-list-item/pick-list-item.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/radio-button/radio-button.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/radio-group/radio-group.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/rating/rating.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/select/select.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/slider/slider.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/sortable-list/sortable-list.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/split-button/split-button.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/stepper-item/stepper-item.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/switch/switch.css +0 -2
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/tab-title/tab-title.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/tile/tile.css +0 -2
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/tile-select/tile-select.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/tile-select-group/tile-select-group.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/time-picker/time-picker.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/tree-item/tree-item.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/value-list/value-list.css +0 -1
- package/dist/node_modules/@esri/calcite-components/dist/collection/components/value-list-item/value-list-item.css +0 -1
- package/dist/solutions/assets/monaco-editor/LICENSE +21 -21
- package/dist/solutions/{p-9fdfd6c6.entry.js → p-07ff4a74.entry.js} +1 -1
- package/dist/solutions/p-08c96ac2.entry.js +6 -0
- package/dist/solutions/p-1033ca8d.entry.js +6 -0
- package/dist/solutions/{p-22b54603.entry.js → p-15994a4d.entry.js} +1 -1
- package/dist/solutions/p-199c5c24.entry.js +6 -0
- package/dist/solutions/p-1db37170.entry.js +6 -0
- package/dist/solutions/p-1ed2008f.entry.js +22 -0
- package/dist/solutions/{p-0922119b.entry.js → p-255ff9e3.entry.js} +2 -2
- package/dist/solutions/p-2a977e48.entry.js +11 -0
- package/dist/solutions/{p-911c476b.entry.js → p-320edf27.entry.js} +1 -1
- package/dist/solutions/p-33d9d95c.entry.js +11 -0
- package/dist/solutions/{p-5f367dbf.js → p-374a5031.js} +2 -2
- package/dist/solutions/{p-8b19de1b.entry.js → p-3841527d.entry.js} +2 -2
- package/dist/solutions/p-420de3c4.entry.js +29 -0
- package/dist/solutions/{p-f8df8f60.entry.js → p-46cb43a6.entry.js} +1 -1
- package/dist/solutions/{p-01e27538.entry.js → p-4a418e85.entry.js} +1 -1
- package/dist/solutions/{p-2f504ad4.entry.js → p-4d5989db.entry.js} +2 -2
- package/dist/solutions/{p-972c9f6b.entry.js → p-4ed258b7.entry.js} +1 -1
- package/dist/solutions/{p-aecc26bc.entry.js → p-58022a7b.entry.js} +1 -1
- package/dist/solutions/p-59070b11.entry.js +6 -0
- package/dist/solutions/{p-fee0d21a.entry.js → p-60e33308.entry.js} +1 -1
- package/dist/solutions/{p-32bde829.entry.js → p-6152930f.entry.js} +1 -1
- package/dist/solutions/{p-1c4e26cd.entry.js → p-66e3e92c.entry.js} +1 -1
- package/dist/solutions/{p-5aa00dda.entry.js → p-68a32f82.entry.js} +2 -2
- package/dist/solutions/p-6d81d035.entry.js +12 -0
- package/dist/solutions/{p-062a0a85.entry.js → p-74c52dd8.entry.js} +1 -1
- package/dist/solutions/p-763f2aff.entry.js +6 -0
- package/dist/solutions/{p-e73ac319.entry.js → p-838b5963.entry.js} +1 -1
- package/dist/solutions/p-8717d549.entry.js +11 -0
- package/dist/solutions/p-93d3119d.js +6 -0
- package/dist/solutions/{p-f65f29be.entry.js → p-953d2b0b.entry.js} +1 -1
- package/dist/solutions/{p-b506be5a.entry.js → p-9645aeb2.entry.js} +1 -1
- package/dist/solutions/{p-1d59f41f.entry.js → p-9b36c7c3.entry.js} +2 -2
- package/dist/solutions/{p-6cd67c8f.entry.js → p-9bbaf3a6.entry.js} +1 -1
- package/dist/solutions/{p-3ba01dcf.entry.js → p-9eebe062.entry.js} +1 -1
- package/dist/solutions/p-9efcd26b.entry.js +23 -0
- package/dist/solutions/{p-4d3cc150.entry.js → p-9f4aab0d.entry.js} +1 -1
- package/dist/solutions/p-a25b2981.entry.js +6 -0
- package/dist/solutions/{p-11aefdf6.entry.js → p-a25b5eac.entry.js} +1 -1
- package/dist/solutions/{p-0d969c42.entry.js → p-a2ff7885.entry.js} +1 -1
- package/dist/solutions/{p-cdcf8087.entry.js → p-a47e729e.entry.js} +2 -2
- package/dist/solutions/p-a8def555.entry.js +11 -0
- package/dist/solutions/{p-c5e2efca.entry.js → p-ac1f7035.entry.js} +2 -2
- package/dist/solutions/p-adaf2269.entry.js +6 -0
- package/dist/solutions/{p-60d5be8d.entry.js → p-b498f95f.entry.js} +1 -1
- package/dist/solutions/p-ba3f1e2c.entry.js +6 -0
- package/dist/solutions/p-bd9c54b1.entry.js +12 -0
- package/dist/solutions/{p-28c78bbe.entry.js → p-c188f72f.entry.js} +1 -1
- package/dist/solutions/{p-d6d15e07.entry.js → p-c55027a5.entry.js} +3 -3
- package/dist/solutions/{p-f8910acc.entry.js → p-d63c9fda.entry.js} +1 -1
- package/dist/solutions/{p-7e9bcf39.entry.js → p-d6d803fd.entry.js} +1 -1
- package/dist/solutions/{p-d6d53153.entry.js → p-e9b057bb.entry.js} +1 -1
- package/dist/solutions/{p-e1ac2e9d.entry.js → p-efa46da1.entry.js} +1 -1
- package/dist/solutions/p-fb544e27.entry.js +6 -0
- package/dist/solutions/solutions.css +1 -1
- package/dist/solutions/solutions.esm.js +1 -1
- package/dist/solutions-components_commit.txt +5 -7
- package/dist/types/stencil-public-runtime.d.ts +5 -0
- package/package.json +1 -1
- package/dist/solutions/p-092a0bff.entry.js +0 -12
- package/dist/solutions/p-0b6167b7.entry.js +0 -11
- package/dist/solutions/p-3c69af40.entry.js +0 -6
- package/dist/solutions/p-437e55cb.entry.js +0 -6
- package/dist/solutions/p-4c125f96.entry.js +0 -6
- package/dist/solutions/p-57157b9d.entry.js +0 -12
- package/dist/solutions/p-599afe71.entry.js +0 -6
- package/dist/solutions/p-5ba1efd5.entry.js +0 -6
- package/dist/solutions/p-60deec33.entry.js +0 -6
- package/dist/solutions/p-7e689d39.entry.js +0 -6
- package/dist/solutions/p-7ee9ae73.entry.js +0 -23
- package/dist/solutions/p-87c09099.entry.js +0 -11
- package/dist/solutions/p-ba6ba612.entry.js +0 -6
- package/dist/solutions/p-be63740d.entry.js +0 -6
- package/dist/solutions/p-c89eefda.entry.js +0 -11
- package/dist/solutions/p-cd33aa83.entry.js +0 -6
- package/dist/solutions/p-ce33ef37.js +0 -6
- package/dist/solutions/p-d58c1b71.entry.js +0 -29
- package/dist/solutions/p-e9641c29.entry.js +0 -11
- package/dist/solutions/p-f27e1023.entry.js +0 -22
@@ -8,4 +8,4 @@ import{r as t,c as i,h as e,g as s}from"./p-be2e3b99.js";import{n as a,i as n}fr
|
|
8
8
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
9
9
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
10
10
|
* v1.0.0-beta.97
|
11
|
-
*/const v={button:"button",buttonBottomLeft:"button--bottom-left",buttonBottomRight:"button--bottom-right",buttonHourDown:"button--hour-down",buttonHourUp:"button--hour-up",buttonMeridiemDown:"button--meridiem-down",buttonMeridiemUp:"button--meridiem-up",buttonMinuteDown:"button--minute-down",buttonMinuteUp:"button--minute-up",buttonSecondDown:"button--second-down",buttonSecondUp:"button--second-up",buttonTopLeft:"button--top-left",buttonTopRight:"button--top-right",column:"column",delimiter:"delimiter",hour:"hour",input:"input",meridiem:"meridiem",minute:"minute",second:"second",showMeridiem:"show-meridiem",showSecond:"show-second","scale-s":"scale-s","scale-m":"scale-m","scale-l":"scale-l",timePicker:"time-picker",meridiemStart:"meridiem--start"},g=class{constructor(e){t(this,e),this.calciteInternalTimePickerBlur=i(this,"calciteInternalTimePickerBlur",6),this.calciteInternalTimePickerChange=i(this,"calciteInternalTimePickerChange",6),this.calciteInternalTimePickerFocus=i(this,"calciteInternalTimePickerFocus",6),this.intlHour="Hour",this.intlHourDown="Decrease hour",this.intlHourUp="Increase hour",this.intlMeridiem="AM/PM",this.intlMeridiemDown="Decrease AM/PM",this.intlMeridiemUp="Increase AM/PM",this.intlMinute="Minute",this.intlMinuteDown="Decrease minute",this.intlMinuteUp="Increase minute",this.intlSecond="Second",this.intlSecondDown="Decrease second",this.intlSecondUp="Increase second",this.scale="m",this.step=60,this.value=null,this.effectiveLocale="",this.showSecond=this.step<60,this.decrementHour=()=>{const t=this.hour?"00"===this.hour?23:parseInt(this.hour)-1:0;this.setValuePart("hour",t)},this.decrementMeridiem=()=>{this.setValuePart("meridiem","PM"===this.meridiem?"AM":"PM")},this.decrementMinuteOrSecond=t=>{let i;if(o(this[t])){const e=parseInt(this[t]);i=0===e?59:e-1}else i=59;this.setValuePart(t,i)},this.decrementMinute=()=>{this.decrementMinuteOrSecond("minute")},this.decrementSecond=()=>{this.decrementMinuteOrSecond("second")},this.focusHandler=t=>{this.activeEl=t.currentTarget},this.hourDownButtonKeyDownHandler=t=>{this.buttonActivated(t)&&this.decrementHour()},this.hourKeyDownHandler=t=>{const{key:i}=t;if(a.includes(i)){const t=parseInt(i);let e;if(o(this.hour))switch(this.hourCycle){case"12":e="01"===this.hour&&t>=0&&t<=2?`1${t}`:t;break;case"24":e="01"===this.hour?`1${t}`:"02"===this.hour&&t>=0&&t<=3?`2${t}`:t}else e=t;this.setValuePart("hour",e)}else switch(i){case"Backspace":case"Delete":this.setValuePart("hour",null);break;case"ArrowDown":t.preventDefault(),this.decrementHour();break;case"ArrowUp":t.preventDefault(),this.incrementHour();break;case" ":t.preventDefault()}},this.hourUpButtonKeyDownHandler=t=>{this.buttonActivated(t)&&this.incrementHour()},this.incrementMeridiem=()=>{this.setValuePart("meridiem","AM"===this.meridiem?"PM":"AM")},this.incrementHour=()=>{const t=o(this.hour)?"23"===this.hour?0:parseInt(this.hour)+1:1;this.setValuePart("hour",t)},this.incrementMinuteOrSecond=t=>{const i=o(this[t])?"59"===this[t]?0:parseInt(this[t])+1:0;this.setValuePart(t,i)},this.incrementMinute=()=>{this.incrementMinuteOrSecond("minute")},this.incrementSecond=()=>{this.incrementMinuteOrSecond("second")},this.meridiemDownButtonKeyDownHandler=t=>{this.buttonActivated(t)&&this.decrementMeridiem()},this.meridiemKeyDownHandler=t=>{switch(t.key){case"a":this.setValuePart("meridiem","AM");break;case"p":this.setValuePart("meridiem","PM");break;case"Backspace":case"Delete":this.setValuePart("meridiem",null);break;case"ArrowUp":t.preventDefault(),this.incrementMeridiem();break;case"ArrowDown":t.preventDefault(),this.decrementMeridiem();break;case" ":t.preventDefault()}},this.meridiemUpButtonKeyDownHandler=t=>{this.buttonActivated(t)&&this.incrementMeridiem()},this.minuteDownButtonKeyDownHandler=t=>{this.buttonActivated(t)&&this.decrementMinute()},this.minuteKeyDownHandler=t=>{const{key:i}=t;if(a.includes(i)){const t=parseInt(i);let e;if(o(this.minute)&&this.minute.startsWith("0")){const i=parseInt(this.minute);e=i>k?t:`${i}${t}`}else e=t;this.setValuePart("minute",e)}else switch(i){case"Backspace":case"Delete":this.setValuePart("minute",null);break;case"ArrowDown":t.preventDefault(),this.decrementMinute();break;case"ArrowUp":t.preventDefault(),this.incrementMinute();break;case" ":t.preventDefault()}},this.minuteUpButtonKeyDownHandler=t=>{this.buttonActivated(t)&&this.incrementMinute()},this.secondDownButtonKeyDownHandler=t=>{this.buttonActivated(t)&&this.decrementSecond()},this.secondKeyDownHandler=t=>{const{key:i}=t;if(a.includes(i)){const t=parseInt(i);let e;if(o(this.second)&&this.second.startsWith("0")){const i=parseInt(this.second);e=i>k?t:`${i}${t}`}else e=t;this.setValuePart("second",e)}else switch(i){case"Backspace":case"Delete":this.setValuePart("second",null);break;case"ArrowDown":t.preventDefault(),this.decrementSecond();break;case"ArrowUp":t.preventDefault(),this.incrementSecond();break;case" ":t.preventDefault()}},this.secondUpButtonKeyDownHandler=t=>{this.buttonActivated(t)&&this.incrementSecond()},this.setHourEl=t=>this.hourEl=t,this.setMeridiemEl=t=>this.meridiemEl=t,this.setMinuteEl=t=>this.minuteEl=t,this.setSecondEl=t=>this.secondEl=t,this.setValue=(t,i=!0)=>{if(h(t)){const{hour:i,minute:e,second:s}=u(t),{effectiveLocale:a,numberingSystem:n}=this,{localizedHour:o,localizedHourSuffix:r,localizedMinute:c,localizedMinuteSuffix:l,localizedSecond:h,localizedSecondSuffix:b,localizedMeridiem:f}=m({value:t,locale:a,numberingSystem:n});if(this.localizedHour=o,this.localizedHourSuffix=r,this.localizedMinute=c,this.localizedMinuteSuffix=l,this.localizedSecond=h,this.localizedSecondSuffix=b,this.hour=i,this.minute=e,this.second=s,f){this.localizedMeridiem=f,this.meridiem=d(this.hour);const i=p({value:t,locale:a,numberingSystem:n});this.meridiemOrder=this.getMeridiemOrder(i)}}else this.hour=null,this.localizedHour=null,this.localizedHourSuffix=null,this.localizedMeridiem=null,this.localizedMinute=null,this.localizedMinuteSuffix=null,this.localizedSecond=null,this.localizedSecondSuffix=null,this.meridiem=null,this.minute=null,this.second=null,this.value=null;i&&this.calciteInternalTimePickerChange.emit()},this.setValuePart=(t,i,e=!0)=>{var s;const{effectiveLocale:a,numberingSystem:n}=this;if("meridiem"===t){if(this.meridiem=i,o(this.hour)){const t=parseInt(this.hour);switch(i){case"AM":t>=12&&(this.hour=b(t-12));break;case"PM":t<12&&(this.hour=b(t+12))}this.localizedHour=f({value:this.hour,part:"hour",locale:a,numberingSystem:n})}}else this[t]="number"==typeof i?b(i):i,this[`localized${r=t,r.charAt(0).toUpperCase()+r.slice(1)}`]=f({value:this[t],part:t,locale:a,numberingSystem:n});var r;this.value=this.hour&&this.minute?`${this.hour}:${this.minute}:${this.second&&this.showSecond?this.second:"00"}`:null,this.localizedMeridiem=this.value?(null===(s=m({value:this.value,locale:a,numberingSystem:n}))||void 0===s?void 0:s.localizedMeridiem)||null:f({value:this.meridiem,part:"meridiem",locale:a,numberingSystem:n}),e&&this.calciteInternalTimePickerChange.emit()}}localeChanged(){r(this)}valueWatcher(t){this.setValue(t,!1)}effectiveLocaleWatcher(){this.updateLocale()}hostBlurHandler(){this.calciteInternalTimePickerBlur.emit()}hostFocusHandler(){this.calciteInternalTimePickerFocus.emit()}keyDownHandler(t){const{defaultPrevented:i,key:e}=t;if(!i)switch(this.activeEl){case this.hourEl:"ArrowRight"===e&&(this.setFocus("minute"),t.preventDefault());break;case this.minuteEl:switch(e){case"ArrowLeft":this.setFocus("hour"),t.preventDefault();break;case"ArrowRight":60!==this.step?(this.setFocus("second"),t.preventDefault()):"12"===this.hourCycle&&(this.setFocus("meridiem"),t.preventDefault())}break;case this.secondEl:switch(e){case"ArrowLeft":this.setFocus("minute"),t.preventDefault();break;case"ArrowRight":"12"===this.hourCycle&&(this.setFocus("meridiem"),t.preventDefault())}break;case this.meridiemEl:switch(e){case"ArrowLeft":60!==this.step?(this.setFocus("second"),t.preventDefault()):(this.setFocus("minute"),t.preventDefault())}}}async setFocus(t){var i;null===(i=this[`${t||"hour"}El`])||void 0===i||i.focus()}buttonActivated(t){const{key:i}=t;return" "===i&&t.preventDefault(),n(i)}getMeridiemOrder(t){const i=this.effectiveLocale;return t&&"ar"!==i&&"he"!==i?t.findIndex((t=>t.value===this.localizedMeridiem)):0}updateLocale(){this.hourCycle=w(this.effectiveLocale,this.numberingSystem),this.setValue(this.value,!1)}connectedCallback(){c(this),this.updateLocale(),this.meridiemOrder=this.getMeridiemOrder(p({value:"0:00:00",locale:this.effectiveLocale,numberingSystem:this.numberingSystem}))}disconnectedCallback(){l(this)}render(){const t=o(this.hour),i="s"===this.scale||"m"===this.scale?"s":"m",s=o(this.minute),a=o(this.second),n="12"===this.hourCycle;return e("div",{class:{[v.timePicker]:!0,[v.showMeridiem]:n,[v.showSecond]:this.showSecond,[v[`scale-${this.scale}`]]:!0},dir:"ltr"},e("div",{class:v.column,role:"group"},e("span",{"aria-label":this.intlHourUp,class:{[v.button]:!0,[v.buttonHourUp]:!0,[v.buttonTopLeft]:!0},onClick:this.incrementHour,onKeyDown:this.hourUpButtonKeyDownHandler,role:"button",tabIndex:-1},e("calcite-icon",{icon:"chevron-up",scale:i})),e("span",{"aria-label":this.intlHour,"aria-valuemax":"23","aria-valuemin":"1","aria-valuenow":t&&parseInt(this.hour)||"0","aria-valuetext":this.hour,class:{[v.input]:!0,[v.hour]:!0},onFocus:this.focusHandler,onKeyDown:this.hourKeyDownHandler,ref:this.setHourEl,role:"spinbutton",tabIndex:0},this.localizedHour||"--"),e("span",{"aria-label":this.intlHourDown,class:{[v.button]:!0,[v.buttonHourDown]:!0,[v.buttonBottomLeft]:!0},onClick:this.decrementHour,onKeyDown:this.hourDownButtonKeyDownHandler,role:"button",tabIndex:-1},e("calcite-icon",{icon:"chevron-down",scale:i}))),e("span",{class:v.delimiter},this.localizedHourSuffix),e("div",{class:v.column,role:"group"},e("span",{"aria-label":this.intlMinuteUp,class:{[v.button]:!0,[v.buttonMinuteUp]:!0},onClick:this.incrementMinute,onKeyDown:this.minuteUpButtonKeyDownHandler,role:"button",tabIndex:-1},e("calcite-icon",{icon:"chevron-up",scale:i})),e("span",{"aria-label":this.intlMinute,"aria-valuemax":"12","aria-valuemin":"1","aria-valuenow":s&&parseInt(this.minute)||"0","aria-valuetext":this.minute,class:{[v.input]:!0,[v.minute]:!0},onFocus:this.focusHandler,onKeyDown:this.minuteKeyDownHandler,ref:this.setMinuteEl,role:"spinbutton",tabIndex:0},this.localizedMinute||"--"),e("span",{"aria-label":this.intlMinuteDown,class:{[v.button]:!0,[v.buttonMinuteDown]:!0},onClick:this.decrementMinute,onKeyDown:this.minuteDownButtonKeyDownHandler,role:"button",tabIndex:-1},e("calcite-icon",{icon:"chevron-down",scale:i}))),this.showSecond&&e("span",{class:v.delimiter},this.localizedMinuteSuffix),this.showSecond&&e("div",{class:v.column,role:"group"},e("span",{"aria-label":this.intlSecondUp,class:{[v.button]:!0,[v.buttonSecondUp]:!0},onClick:this.incrementSecond,onKeyDown:this.secondUpButtonKeyDownHandler,role:"button",tabIndex:-1},e("calcite-icon",{icon:"chevron-up",scale:i})),e("span",{"aria-label":this.intlSecond,"aria-valuemax":"59","aria-valuemin":"0","aria-valuenow":a&&parseInt(this.second)||"0","aria-valuetext":this.second,class:{[v.input]:!0,[v.second]:!0},onFocus:this.focusHandler,onKeyDown:this.secondKeyDownHandler,ref:this.setSecondEl,role:"spinbutton",tabIndex:0},this.localizedSecond||"--"),e("span",{"aria-label":this.intlSecondDown,class:{[v.button]:!0,[v.buttonSecondDown]:!0},onClick:this.decrementSecond,onKeyDown:this.secondDownButtonKeyDownHandler,role:"button",tabIndex:-1},e("calcite-icon",{icon:"chevron-down",scale:i}))),this.localizedSecondSuffix&&e("span",{class:v.delimiter},this.localizedSecondSuffix),n&&e("div",{class:{[v.column]:!0,[v.meridiemStart]:0===this.meridiemOrder},role:"group"},e("span",{"aria-label":this.intlMeridiemUp,class:{[v.button]:!0,[v.buttonMeridiemUp]:!0,[v.buttonTopRight]:!0},onClick:this.incrementMeridiem,onKeyDown:this.meridiemUpButtonKeyDownHandler,role:"button",tabIndex:-1},e("calcite-icon",{icon:"chevron-up",scale:i})),e("span",{"aria-label":this.intlMeridiem,"aria-valuemax":"2","aria-valuemin":"1","aria-valuenow":"PM"===this.meridiem?"2":"1","aria-valuetext":this.meridiem,class:{[v.input]:!0,[v.meridiem]:!0},onFocus:this.focusHandler,onKeyDown:this.meridiemKeyDownHandler,ref:this.setMeridiemEl,role:"spinbutton",tabIndex:0},this.localizedMeridiem||"--"),e("span",{"aria-label":this.intlMeridiemDown,class:{[v.button]:!0,[v.buttonMeridiemDown]:!0,[v.buttonBottomRight]:!0},onClick:this.decrementMeridiem,onKeyDown:this.meridiemDownButtonKeyDownHandler,role:"button",tabIndex:-1},e("calcite-icon",{icon:"chevron-down",scale:i}))))}get el(){return s(this)}static get watchers(){return{locale:["localeChanged"],value:["valueWatcher"],effectiveLocale:["effectiveLocaleWatcher"]}}};g.style="@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{display:inline-block}.time-picker{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;align-items:center;background-color:var(--calcite-ui-foreground-1);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);--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);border-radius:var(--calcite-border-radius)}.time-picker .column{display:flex;flex-direction:column}.time-picker .meridiem--start{order:-1}.time-picker .button{display:inline-flex;cursor:pointer;align-items:center;justify-content:center;background-color:var(--calcite-ui-foreground-1)}.time-picker .button:hover,.time-picker .button:focus{background-color:var(--calcite-ui-foreground-2);outline:2px solid transparent;outline-offset:2px}.time-picker .button:active{background-color:var(--calcite-ui-foreground-3)}.time-picker .button.top-left{border-start-start-radius:var(--calcite-border-radius)}.time-picker .button.bottom-left{border-end-start-radius:var(--calcite-border-radius)}.time-picker .button.top-right{border-start-end-radius:var(--calcite-border-radius)}.time-picker .button.bottom-right{border-end-end-radius:var(--calcite-border-radius)}.time-picker .button calcite-icon{color:var(--calcite-ui-text-3)}.time-picker .input{display:inline-flex;cursor:pointer;align-items:center;justify-content:center;background-color:var(--calcite-ui-foreground-1);font-weight:var(--calcite-font-weight-medium)}.time-picker .input:hover{box-shadow:inset 0 0 0 2px var(--calcite-ui-foreground-2)}.time-picker .input:focus,.time-picker .input:hover:focus{outline:2px solid transparent;outline-offset:2px;box-shadow:inset 0 0 0 2px var(--calcite-ui-brand)}.time-picker.scale-s{font-size:var(--calcite-font-size--1)}.time-picker.scale-s .button,.time-picker.scale-s .input{padding-inline:0.75rem;padding-block:0.25rem}.time-picker.scale-s:not(.show-meridiem) .delimiter:last-child{-webkit-padding-end:0.75rem;padding-inline-end:0.75rem}.time-picker.scale-m{font-size:var(--calcite-font-size-0)}.time-picker.scale-m .button,.time-picker.scale-m .input{padding-inline:1rem;padding-block:0.5rem}.time-picker.scale-m:not(.show-meridiem) .delimiter:last-child{-webkit-padding-end:1rem;padding-inline-end:1rem}.time-picker.scale-l{font-size:var(--calcite-font-size-1)}.time-picker.scale-l .button,.time-picker.scale-l .input{padding-inline:1.25rem;padding-block:0.75rem}.time-picker.scale-l:not(.show-meridiem) .delimiter:last-child{-webkit-padding-end:1.25rem;padding-inline-end:1.25rem}";export{g as calcite_time_picker}
|
11
|
+
*/const v={button:"button",buttonBottomLeft:"button--bottom-left",buttonBottomRight:"button--bottom-right",buttonHourDown:"button--hour-down",buttonHourUp:"button--hour-up",buttonMeridiemDown:"button--meridiem-down",buttonMeridiemUp:"button--meridiem-up",buttonMinuteDown:"button--minute-down",buttonMinuteUp:"button--minute-up",buttonSecondDown:"button--second-down",buttonSecondUp:"button--second-up",buttonTopLeft:"button--top-left",buttonTopRight:"button--top-right",column:"column",delimiter:"delimiter",hour:"hour",input:"input",meridiem:"meridiem",minute:"minute",second:"second",showMeridiem:"show-meridiem",showSecond:"show-second","scale-s":"scale-s","scale-m":"scale-m","scale-l":"scale-l",timePicker:"time-picker",meridiemStart:"meridiem--start"},g=class{constructor(e){t(this,e),this.calciteInternalTimePickerBlur=i(this,"calciteInternalTimePickerBlur",6),this.calciteInternalTimePickerChange=i(this,"calciteInternalTimePickerChange",6),this.calciteInternalTimePickerFocus=i(this,"calciteInternalTimePickerFocus",6),this.intlHour="Hour",this.intlHourDown="Decrease hour",this.intlHourUp="Increase hour",this.intlMeridiem="AM/PM",this.intlMeridiemDown="Decrease AM/PM",this.intlMeridiemUp="Increase AM/PM",this.intlMinute="Minute",this.intlMinuteDown="Decrease minute",this.intlMinuteUp="Increase minute",this.intlSecond="Second",this.intlSecondDown="Decrease second",this.intlSecondUp="Increase second",this.scale="m",this.step=60,this.value=null,this.effectiveLocale="",this.showSecond=this.step<60,this.decrementHour=()=>{const t=this.hour?"00"===this.hour?23:parseInt(this.hour)-1:0;this.setValuePart("hour",t)},this.decrementMeridiem=()=>{this.setValuePart("meridiem","PM"===this.meridiem?"AM":"PM")},this.decrementMinuteOrSecond=t=>{let i;if(o(this[t])){const e=parseInt(this[t]);i=0===e?59:e-1}else i=59;this.setValuePart(t,i)},this.decrementMinute=()=>{this.decrementMinuteOrSecond("minute")},this.decrementSecond=()=>{this.decrementMinuteOrSecond("second")},this.focusHandler=t=>{this.activeEl=t.currentTarget},this.hourDownButtonKeyDownHandler=t=>{this.buttonActivated(t)&&this.decrementHour()},this.hourKeyDownHandler=t=>{const{key:i}=t;if(a.includes(i)){const t=parseInt(i);let e;if(o(this.hour))switch(this.hourCycle){case"12":e="01"===this.hour&&t>=0&&t<=2?`1${t}`:t;break;case"24":e="01"===this.hour?`1${t}`:"02"===this.hour&&t>=0&&t<=3?`2${t}`:t}else e=t;this.setValuePart("hour",e)}else switch(i){case"Backspace":case"Delete":this.setValuePart("hour",null);break;case"ArrowDown":t.preventDefault(),this.decrementHour();break;case"ArrowUp":t.preventDefault(),this.incrementHour();break;case" ":t.preventDefault()}},this.hourUpButtonKeyDownHandler=t=>{this.buttonActivated(t)&&this.incrementHour()},this.incrementMeridiem=()=>{this.setValuePart("meridiem","AM"===this.meridiem?"PM":"AM")},this.incrementHour=()=>{const t=o(this.hour)?"23"===this.hour?0:parseInt(this.hour)+1:1;this.setValuePart("hour",t)},this.incrementMinuteOrSecond=t=>{const i=o(this[t])?"59"===this[t]?0:parseInt(this[t])+1:0;this.setValuePart(t,i)},this.incrementMinute=()=>{this.incrementMinuteOrSecond("minute")},this.incrementSecond=()=>{this.incrementMinuteOrSecond("second")},this.meridiemDownButtonKeyDownHandler=t=>{this.buttonActivated(t)&&this.decrementMeridiem()},this.meridiemKeyDownHandler=t=>{switch(t.key){case"a":this.setValuePart("meridiem","AM");break;case"p":this.setValuePart("meridiem","PM");break;case"Backspace":case"Delete":this.setValuePart("meridiem",null);break;case"ArrowUp":t.preventDefault(),this.incrementMeridiem();break;case"ArrowDown":t.preventDefault(),this.decrementMeridiem();break;case" ":t.preventDefault()}},this.meridiemUpButtonKeyDownHandler=t=>{this.buttonActivated(t)&&this.incrementMeridiem()},this.minuteDownButtonKeyDownHandler=t=>{this.buttonActivated(t)&&this.decrementMinute()},this.minuteKeyDownHandler=t=>{const{key:i}=t;if(a.includes(i)){const t=parseInt(i);let e;if(o(this.minute)&&this.minute.startsWith("0")){const i=parseInt(this.minute);e=i>k?t:`${i}${t}`}else e=t;this.setValuePart("minute",e)}else switch(i){case"Backspace":case"Delete":this.setValuePart("minute",null);break;case"ArrowDown":t.preventDefault(),this.decrementMinute();break;case"ArrowUp":t.preventDefault(),this.incrementMinute();break;case" ":t.preventDefault()}},this.minuteUpButtonKeyDownHandler=t=>{this.buttonActivated(t)&&this.incrementMinute()},this.secondDownButtonKeyDownHandler=t=>{this.buttonActivated(t)&&this.decrementSecond()},this.secondKeyDownHandler=t=>{const{key:i}=t;if(a.includes(i)){const t=parseInt(i);let e;if(o(this.second)&&this.second.startsWith("0")){const i=parseInt(this.second);e=i>k?t:`${i}${t}`}else e=t;this.setValuePart("second",e)}else switch(i){case"Backspace":case"Delete":this.setValuePart("second",null);break;case"ArrowDown":t.preventDefault(),this.decrementSecond();break;case"ArrowUp":t.preventDefault(),this.incrementSecond();break;case" ":t.preventDefault()}},this.secondUpButtonKeyDownHandler=t=>{this.buttonActivated(t)&&this.incrementSecond()},this.setHourEl=t=>this.hourEl=t,this.setMeridiemEl=t=>this.meridiemEl=t,this.setMinuteEl=t=>this.minuteEl=t,this.setSecondEl=t=>this.secondEl=t,this.setValue=(t,i=!0)=>{if(h(t)){const{hour:i,minute:e,second:s}=u(t),{effectiveLocale:a,numberingSystem:n}=this,{localizedHour:o,localizedHourSuffix:r,localizedMinute:c,localizedMinuteSuffix:l,localizedSecond:h,localizedSecondSuffix:b,localizedMeridiem:f}=m({value:t,locale:a,numberingSystem:n});if(this.localizedHour=o,this.localizedHourSuffix=r,this.localizedMinute=c,this.localizedMinuteSuffix=l,this.localizedSecond=h,this.localizedSecondSuffix=b,this.hour=i,this.minute=e,this.second=s,f){this.localizedMeridiem=f,this.meridiem=d(this.hour);const i=p({value:t,locale:a,numberingSystem:n});this.meridiemOrder=this.getMeridiemOrder(i)}}else this.hour=null,this.localizedHour=null,this.localizedHourSuffix=null,this.localizedMeridiem=null,this.localizedMinute=null,this.localizedMinuteSuffix=null,this.localizedSecond=null,this.localizedSecondSuffix=null,this.meridiem=null,this.minute=null,this.second=null,this.value=null;i&&this.calciteInternalTimePickerChange.emit()},this.setValuePart=(t,i,e=!0)=>{var s;const{effectiveLocale:a,numberingSystem:n}=this;if("meridiem"===t){if(this.meridiem=i,o(this.hour)){const t=parseInt(this.hour);switch(i){case"AM":t>=12&&(this.hour=b(t-12));break;case"PM":t<12&&(this.hour=b(t+12))}this.localizedHour=f({value:this.hour,part:"hour",locale:a,numberingSystem:n})}}else this[t]="number"==typeof i?b(i):i,this[`localized${r=t,r.charAt(0).toUpperCase()+r.slice(1)}`]=f({value:this[t],part:t,locale:a,numberingSystem:n});var r;this.value=this.hour&&this.minute?`${this.hour}:${this.minute}:${this.second&&this.showSecond?this.second:"00"}`:null,this.localizedMeridiem=this.value?(null===(s=m({value:this.value,locale:a,numberingSystem:n}))||void 0===s?void 0:s.localizedMeridiem)||null:f({value:this.meridiem,part:"meridiem",locale:a,numberingSystem:n}),e&&this.calciteInternalTimePickerChange.emit()}}localeChanged(){r(this)}valueWatcher(t){this.setValue(t,!1)}effectiveLocaleWatcher(){this.updateLocale()}hostBlurHandler(){this.calciteInternalTimePickerBlur.emit()}hostFocusHandler(){this.calciteInternalTimePickerFocus.emit()}keyDownHandler(t){const{defaultPrevented:i,key:e}=t;if(!i)switch(this.activeEl){case this.hourEl:"ArrowRight"===e&&(this.setFocus("minute"),t.preventDefault());break;case this.minuteEl:switch(e){case"ArrowLeft":this.setFocus("hour"),t.preventDefault();break;case"ArrowRight":60!==this.step?(this.setFocus("second"),t.preventDefault()):"12"===this.hourCycle&&(this.setFocus("meridiem"),t.preventDefault())}break;case this.secondEl:switch(e){case"ArrowLeft":this.setFocus("minute"),t.preventDefault();break;case"ArrowRight":"12"===this.hourCycle&&(this.setFocus("meridiem"),t.preventDefault())}break;case this.meridiemEl:switch(e){case"ArrowLeft":60!==this.step?(this.setFocus("second"),t.preventDefault()):(this.setFocus("minute"),t.preventDefault())}}}async setFocus(t){var i;null===(i=this[`${t||"hour"}El`])||void 0===i||i.focus()}buttonActivated(t){const{key:i}=t;return" "===i&&t.preventDefault(),n(i)}getMeridiemOrder(t){const i=this.effectiveLocale;return t&&"ar"!==i&&"he"!==i?t.findIndex((t=>t.value===this.localizedMeridiem)):0}updateLocale(){this.hourCycle=w(this.effectiveLocale,this.numberingSystem),this.setValue(this.value,!1)}connectedCallback(){c(this),this.updateLocale(),this.meridiemOrder=this.getMeridiemOrder(p({value:"0:00:00",locale:this.effectiveLocale,numberingSystem:this.numberingSystem}))}disconnectedCallback(){l(this)}render(){const t=o(this.hour),i="s"===this.scale||"m"===this.scale?"s":"m",s=o(this.minute),a=o(this.second),n="12"===this.hourCycle;return e("div",{class:{[v.timePicker]:!0,[v.showMeridiem]:n,[v.showSecond]:this.showSecond,[v[`scale-${this.scale}`]]:!0},dir:"ltr"},e("div",{class:v.column,role:"group"},e("span",{"aria-label":this.intlHourUp,class:{[v.button]:!0,[v.buttonHourUp]:!0,[v.buttonTopLeft]:!0},onClick:this.incrementHour,onKeyDown:this.hourUpButtonKeyDownHandler,role:"button",tabIndex:-1},e("calcite-icon",{icon:"chevron-up",scale:i})),e("span",{"aria-label":this.intlHour,"aria-valuemax":"23","aria-valuemin":"1","aria-valuenow":t&&parseInt(this.hour)||"0","aria-valuetext":this.hour,class:{[v.input]:!0,[v.hour]:!0},onFocus:this.focusHandler,onKeyDown:this.hourKeyDownHandler,ref:this.setHourEl,role:"spinbutton",tabIndex:0},this.localizedHour||"--"),e("span",{"aria-label":this.intlHourDown,class:{[v.button]:!0,[v.buttonHourDown]:!0,[v.buttonBottomLeft]:!0},onClick:this.decrementHour,onKeyDown:this.hourDownButtonKeyDownHandler,role:"button",tabIndex:-1},e("calcite-icon",{icon:"chevron-down",scale:i}))),e("span",{class:v.delimiter},this.localizedHourSuffix),e("div",{class:v.column,role:"group"},e("span",{"aria-label":this.intlMinuteUp,class:{[v.button]:!0,[v.buttonMinuteUp]:!0},onClick:this.incrementMinute,onKeyDown:this.minuteUpButtonKeyDownHandler,role:"button",tabIndex:-1},e("calcite-icon",{icon:"chevron-up",scale:i})),e("span",{"aria-label":this.intlMinute,"aria-valuemax":"12","aria-valuemin":"1","aria-valuenow":s&&parseInt(this.minute)||"0","aria-valuetext":this.minute,class:{[v.input]:!0,[v.minute]:!0},onFocus:this.focusHandler,onKeyDown:this.minuteKeyDownHandler,ref:this.setMinuteEl,role:"spinbutton",tabIndex:0},this.localizedMinute||"--"),e("span",{"aria-label":this.intlMinuteDown,class:{[v.button]:!0,[v.buttonMinuteDown]:!0},onClick:this.decrementMinute,onKeyDown:this.minuteDownButtonKeyDownHandler,role:"button",tabIndex:-1},e("calcite-icon",{icon:"chevron-down",scale:i}))),this.showSecond&&e("span",{class:v.delimiter},this.localizedMinuteSuffix),this.showSecond&&e("div",{class:v.column,role:"group"},e("span",{"aria-label":this.intlSecondUp,class:{[v.button]:!0,[v.buttonSecondUp]:!0},onClick:this.incrementSecond,onKeyDown:this.secondUpButtonKeyDownHandler,role:"button",tabIndex:-1},e("calcite-icon",{icon:"chevron-up",scale:i})),e("span",{"aria-label":this.intlSecond,"aria-valuemax":"59","aria-valuemin":"0","aria-valuenow":a&&parseInt(this.second)||"0","aria-valuetext":this.second,class:{[v.input]:!0,[v.second]:!0},onFocus:this.focusHandler,onKeyDown:this.secondKeyDownHandler,ref:this.setSecondEl,role:"spinbutton",tabIndex:0},this.localizedSecond||"--"),e("span",{"aria-label":this.intlSecondDown,class:{[v.button]:!0,[v.buttonSecondDown]:!0},onClick:this.decrementSecond,onKeyDown:this.secondDownButtonKeyDownHandler,role:"button",tabIndex:-1},e("calcite-icon",{icon:"chevron-down",scale:i}))),this.localizedSecondSuffix&&e("span",{class:v.delimiter},this.localizedSecondSuffix),n&&e("div",{class:{[v.column]:!0,[v.meridiemStart]:0===this.meridiemOrder},role:"group"},e("span",{"aria-label":this.intlMeridiemUp,class:{[v.button]:!0,[v.buttonMeridiemUp]:!0,[v.buttonTopRight]:!0},onClick:this.incrementMeridiem,onKeyDown:this.meridiemUpButtonKeyDownHandler,role:"button",tabIndex:-1},e("calcite-icon",{icon:"chevron-up",scale:i})),e("span",{"aria-label":this.intlMeridiem,"aria-valuemax":"2","aria-valuemin":"1","aria-valuenow":"PM"===this.meridiem?"2":"1","aria-valuetext":this.meridiem,class:{[v.input]:!0,[v.meridiem]:!0},onFocus:this.focusHandler,onKeyDown:this.meridiemKeyDownHandler,ref:this.setMeridiemEl,role:"spinbutton",tabIndex:0},this.localizedMeridiem||"--"),e("span",{"aria-label":this.intlMeridiemDown,class:{[v.button]:!0,[v.buttonMeridiemDown]:!0,[v.buttonBottomRight]:!0},onClick:this.decrementMeridiem,onKeyDown:this.meridiemDownButtonKeyDownHandler,role:"button",tabIndex:-1},e("calcite-icon",{icon:"chevron-down",scale:i}))))}get el(){return s(this)}static get watchers(){return{locale:["localeChanged"],value:["valueWatcher"],effectiveLocale:["effectiveLocaleWatcher"]}}};g.style="@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{display:inline-block}.time-picker{display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;background-color:var(--calcite-ui-foreground-1);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);--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);border-radius:var(--calcite-border-radius)}.time-picker .column{display:flex;flex-direction:column}.time-picker .meridiem--start{order:-1}.time-picker .button{display:inline-flex;cursor:pointer;align-items:center;justify-content:center;background-color:var(--calcite-ui-foreground-1)}.time-picker .button:hover,.time-picker .button:focus{background-color:var(--calcite-ui-foreground-2);outline:2px solid transparent;outline-offset:2px}.time-picker .button:active{background-color:var(--calcite-ui-foreground-3)}.time-picker .button.top-left{border-start-start-radius:var(--calcite-border-radius)}.time-picker .button.bottom-left{border-end-start-radius:var(--calcite-border-radius)}.time-picker .button.top-right{border-start-end-radius:var(--calcite-border-radius)}.time-picker .button.bottom-right{border-end-end-radius:var(--calcite-border-radius)}.time-picker .button calcite-icon{color:var(--calcite-ui-text-3)}.time-picker .input{display:inline-flex;cursor:pointer;align-items:center;justify-content:center;background-color:var(--calcite-ui-foreground-1);font-weight:var(--calcite-font-weight-medium)}.time-picker .input:hover{box-shadow:inset 0 0 0 2px var(--calcite-ui-foreground-2)}.time-picker .input:focus,.time-picker .input:hover:focus{outline:2px solid transparent;outline-offset:2px;box-shadow:inset 0 0 0 2px var(--calcite-ui-brand)}.time-picker.scale-s{font-size:var(--calcite-font-size--1)}.time-picker.scale-s .button,.time-picker.scale-s .input{padding-inline:0.75rem;padding-block:0.25rem}.time-picker.scale-s:not(.show-meridiem) .delimiter:last-child{-webkit-padding-end:0.75rem;padding-inline-end:0.75rem}.time-picker.scale-m{font-size:var(--calcite-font-size-0)}.time-picker.scale-m .button,.time-picker.scale-m .input{padding-inline:1rem;padding-block:0.5rem}.time-picker.scale-m:not(.show-meridiem) .delimiter:last-child{-webkit-padding-end:1rem;padding-inline-end:1rem}.time-picker.scale-l{font-size:var(--calcite-font-size-1)}.time-picker.scale-l .button,.time-picker.scale-l .input{padding-inline:1.25rem;padding-block:0.75rem}.time-picker.scale-l:not(.show-meridiem) .delimiter:last-child{-webkit-padding-end:1.25rem;padding-inline-end:1.25rem}";export{g as calcite_time_picker}
|
@@ -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 t,c as i,h as e,g as s}from"./p-be2e3b99.js";import{c as n}from"./p-ce33ef37.js";import{D as a,T as o,a as l,H as r,C as h,b as c,R as d}from"./p-5f367dbf.js";import{i as p,b as u,f as m}from"./p-32a67cb2.js";import{n as f,C as g,p as b,c as v}from"./p-991ee695.js";import{c as x}from"./p-63f6e8f1.js";import{u as w}from"./p-7daea1df.js";import{i as y}from"./p-73e23995.js";import{d as k,i as C}from"./p-4e32bf8c.js";import"./p-3b010ce1.js";import"./p-729708a3.js";import"./p-a80b3880.js";const S=f(a.hex()),D=class{constructor(s){var m,b,v,w;t(this,s),this.calciteColorPickerChange=i(this,"calciteColorPickerChange",6),this.calciteColorPickerInput=i(this,"calciteColorPickerInput",6),this.allowEmpty=!1,this.appearance="solid",this.color=a,this.disabled=!1,this.format="auto",this.hideHex=!1,this.hideChannels=!1,this.hideSaved=!1,this.intlB=o.b,this.intlBlue=o.blue,this.intlDeleteColor=o.deleteColor,this.intlG=o.g,this.intlGreen=o.green,this.intlH=o.h,this.intlHsv=o.hsv,this.intlHex=o.hex,this.intlHue=o.hue,this.intlNoColor=o.noColor,this.intlR=o.r,this.intlRed=o.red,this.intlRgb=o.rgb,this.intlS=o.s,this.intlSaturation=o.saturation,this.intlSaveColor=o.saveColor,this.intlSaved=o.saved,this.intlV=o.v,this.intlValue=o.value,this.scale="m",this.value=S,this.colorFieldAndSliderHovered=!1,this.hueThumbState="idle",this.internalColorUpdateContext=null,this.mode=g.HEX,this.shiftKeyChannelAdjustment=0,this.sliderThumbState="idle",this.colorFieldAndSliderInteractive=!1,this.channelMode="rgb",this.channels=this.toChannels(a),this.dimensions=l.m,this.savedColors=[],this.handleTabActivate=t=>{this.channelMode=t.currentTarget.getAttribute("data-color-mode"),this.updateChannelsFromColor(this.color)},this.handleColorFieldScopeKeyDown=t=>{const{key:i}=t,e={ArrowUp:{x:0,y:-10},ArrowRight:{x:10,y:0},ArrowDown:{x:0,y:10},ArrowLeft:{x:-10,y:0}};e[i]&&(t.preventDefault(),this.scopeOrientation="ArrowDown"===i||"ArrowUp"===i?"vertical":"horizontal",this.captureColorFieldColor(this.colorFieldScopeLeft+e[i].x||0,this.colorFieldScopeTop+e[i].y||0,!1))},this.handleHueScopeKeyDown=t=>{const i=t.shiftKey?10:1,{key:e}=t,s={ArrowUp:1,ArrowRight:1,ArrowDown:-1,ArrowLeft:-1};if(s[e]){t.preventDefault();const n=s[e]*i,a=this.baseColorFieldColor.hue(),o=this.baseColorFieldColor.hue(a+n);this.internalColorSet(o,!1)}},this.handleHexInputChange=t=>{t.stopPropagation();const{allowEmpty:i,color:e}=this,s=t.target.value;!i||s?s!==(e&&f(e.hex()))&&this.internalColorSet(n(s)):this.internalColorSet(null)},this.handleSavedColorSelect=t=>{this.internalColorSet(n(t.currentTarget.color))},this.handleChannelInput=t=>{const i=t.currentTarget,e=t.detail.nativeEvent.target,s=Number(i.getAttribute("data-channel-index")),n="rgb"===this.channelMode?d[Object.keys(d)[s]]:r[Object.keys(r)[s]];let a;if(this.allowEmpty&&!i.value)a="";else{const t=Number(i.value)+this.shiftKeyChannelAdjustment;a=x(t,0,n).toString()}i.value=a,e.value=a},this.handleChannelChange=t=>{const i=t.currentTarget,e=Number(i.getAttribute("data-channel-index")),s=[...this.channels];if(this.allowEmpty&&!i.value)return this.channels=[null,null,null],void this.internalColorSet(null);s[e]=Number(i.value),this.updateColorFromChannels(s)},this.handleSavedColorKeyDown=t=>{y(t.key)&&(t.preventDefault(),this.handleSavedColorSelect(t))},this.handleColorFieldAndSliderPointerLeave=()=>{this.colorFieldAndSliderInteractive=!1,this.colorFieldAndSliderHovered=!1,"drag"!==this.sliderThumbState&&"drag"!==this.hueThumbState&&(this.hueThumbState="idle",this.sliderThumbState="idle",this.drawColorFieldAndSlider())},this.handleColorFieldAndSliderPointerDown=t=>{var i,e;if(!p(t))return;const{offsetX:s,offsetY:n}=t,a=this.getCanvasRegion(n);"color-field"===a?(this.hueThumbState="drag",this.captureColorFieldColor(s,n),null===(i=this.colorFieldScopeNode)||void 0===i||i.focus()):"slider"===a&&(this.sliderThumbState="drag",this.captureHueSliderColor(s),null===(e=this.hueScopeNode)||void 0===e||e.focus()),t.preventDefault(),document.addEventListener("pointermove",this.globalPointerMoveHandler),document.addEventListener("pointerup",this.globalPointerUpHandler,{once:!0}),this.activeColorFieldAndSliderRect=this.fieldAndSliderRenderingContext.canvas.getBoundingClientRect()},this.globalPointerUpHandler=t=>{if(!p(t))return;const i="drag"===this.sliderThumbState||"drag"===this.hueThumbState;this.hueThumbState="idle",this.sliderThumbState="idle",this.activeColorFieldAndSliderRect=null,this.drawColorFieldAndSlider(),i&&this.calciteColorPickerChange.emit()},this.globalPointerMoveHandler=t=>{const{el:i,dimensions:e}=this,s="drag"===this.hueThumbState;if(!i.isConnected||"drag"!==this.sliderThumbState&&!s)return;let n,a;const o=this.activeColorFieldAndSliderRect,{clientX:l,clientY:r}=t;if(this.colorFieldAndSliderHovered)n=l-o.x,a=r-o.y;else{const t=e.colorField.width,i=e.colorField.height,s=e.slider.height;n=l<o.x+t&&l>o.x?l-o.x:l<o.x?0:t-1,a=r<o.y+i+s&&r>o.y?r-o.y:r<o.y?0:i+s}s?this.captureColorFieldColor(n,a,!1):this.captureHueSliderColor(n)},this.handleColorFieldAndSliderPointerEnterOrMove=({offsetX:t,offsetY:i})=>{const{dimensions:{colorField:e,slider:s,thumb:n}}=this;this.colorFieldAndSliderInteractive=i<=e.height+s.height,this.colorFieldAndSliderHovered=!0;const a=this.getCanvasRegion(i);if("color-field"===a){const s=this.hueThumbState,a=this.baseColorFieldColor.hsv(),o=Math.round(a.saturationv()/(r.s/e.width)),l=Math.round(e.height-a.value()/(r.v/e.height)),h=this.containsPoint(t,i,o,l,n.radius);let c=!1;"idle"===s&&h?(this.hueThumbState="hover",c=!0):"hover"!==s||h||(this.hueThumbState="idle",c=!0),"drag"!==this.hueThumbState&&c&&this.drawColorFieldAndSlider()}else if("slider"===a){const a=this.baseColorFieldColor.hsv().saturationv(100).value(100),o=this.sliderThumbState,l=Math.round(a.hue()/(360/s.width)),r=Math.round((s.height+this.getSliderCapSpacing())/2)+e.height,h=this.containsPoint(t,i,l,r,n.radius);let c=!1;"idle"===o&&h?(this.sliderThumbState="hover",c=!0):"hover"!==o||h||(this.sliderThumbState="idle",c=!0),"drag"!==this.sliderThumbState&&c&&this.drawColorFieldAndSlider()}},this.storeColorFieldScope=t=>{this.colorFieldScopeNode=t},this.storeHueScope=t=>{this.hueScopeNode=t},this.renderChannelsTabTitle=t=>{const{channelMode:i,intlRgb:s,intlHsv:n}=this;return e("calcite-tab-title",{active:t===i,class:h.colorMode,"data-color-mode":t,key:t,onCalciteTabsActivate:this.handleTabActivate},"rgb"===t?s:n)},this.renderChannelsTab=t=>{const{channelMode:i,channels:s,intlB:n,intlBlue:a,intlG:o,intlGreen:l,intlH:r,intlHue:c,intlR:d,intlRed:p,intlS:m,intlSaturation:f,intlV:g,intlValue:b}=this,v=t===i,x="rgb"===t,w=x?[d,o,n]:[r,m,g],y=x?[p,l,a]:[c,f,b],k=u(this.el);return e("calcite-tab",{active:v,class:h.control,key:t},e("div",{class:h.channels,dir:"ltr"},s.map(((t,i)=>this.renderChannel(t,i,w[i],y[i],k)))))},this.renderChannel=(t,i,s,n,a)=>e("calcite-input",{class:h.channel,"data-channel-index":i,dir:a,label:n,numberButtonType:"none",numberingSystem:this.numberingSystem,onCalciteInputChange:this.handleChannelChange,onCalciteInputInput:this.handleChannelInput,onKeyDown:this.handleKeyDown,prefixText:s,scale:"l"===this.scale?"m":"s",type:"number",value:null==t?void 0:t.toString()}),this.deleteColor=()=>{const t=this.color.hex();if(!(this.savedColors.indexOf(t)>-1))return;const i=this.savedColors.filter((i=>i!==t));this.savedColors=i,this.storageId&&localStorage.setItem(`${c}${this.storageId}`,JSON.stringify(i))},this.saveColor=()=>{const t=this.color.hex();if(this.savedColors.indexOf(t)>-1)return;const i=[...this.savedColors,t];this.savedColors=i,this.storageId&&localStorage.setItem(`${c}${this.storageId}`,JSON.stringify(i))},this.drawColorFieldAndSlider=(m=()=>{this.fieldAndSliderRenderingContext&&(this.drawColorField(),this.drawHueSlider())},v=!0,w=!0,C(b)&&(v="leading"in b?!!b.leading:v,w="trailing"in b?!!b.trailing:w),k(m,16,{leading:v,maxWait:16,trailing:w})),this.captureColorFieldColor=(t,i,e=!0)=>{const{dimensions:{colorField:{height:s,width:n}}}=this,a=Math.round(r.s/n*t),o=Math.round(r.v/s*(s-i));this.internalColorSet(this.baseColorFieldColor.hsv().saturationv(a).value(o),e)},this.initColorFieldAndSlider=t=>{this.fieldAndSliderRenderingContext=t.getContext("2d"),this.updateCanvasSize(t)}}handleColorChange(t,i){this.drawColorFieldAndSlider(),this.updateChannelsFromColor(t),this.previousColor=i}handleFormatChange(t){this.setMode(t),this.internalColorSet(this.color,!1,"internal")}handleScaleChange(t="m"){var i;this.updateDimensions(t),this.updateCanvasSize(null===(i=this.fieldAndSliderRenderingContext)||void 0===i?void 0:i.canvas)}handleValueChange(t,i){const{allowEmpty:e,format:s}=this;let a=!1;if(!e||t){const e=b(t);if(!e||"auto"!==s&&e!==s)return this.showIncompatibleColorWarning(t,s),void(this.value=i);a=this.mode!==e,this.setMode(e)}const o="drag"===this.sliderThumbState||"drag"===this.hueThumbState;if("initial"===this.internalColorUpdateContext)return;if("user-interaction"===this.internalColorUpdateContext)return this.calciteColorPickerInput.emit(),void(o||this.calciteColorPickerChange.emit());const l=e&&!t?null:n(t),r=!v(l,this.color);(a||r)&&this.internalColorSet(l,!0,"internal")}get baseColorFieldColor(){return this.color||this.previousColor||a}handleChannelKeyUpOrDown(t){this.shiftKeyChannelAdjustment=0;const{key:i}=t;if("ArrowUp"!==i&&"ArrowDown"!==i||!t.composedPath().some((t=>{var i;return null===(i=t.classList)||void 0===i?void 0:i.contains(h.channel)})))return;const{shiftKey:e}=t;if(t.preventDefault(),!this.color)return this.internalColorSet(this.previousColor),void t.stopPropagation();this.shiftKeyChannelAdjustment="ArrowUp"===i&&e?9:"ArrowDown"===i&&e?-9:0}async setFocus(){return m(this.colorFieldScopeNode)}componentWillLoad(){const{allowEmpty:t,color:i,format:e,value:s}=this,a=t&&!s,o=b(s),l=a||"auto"===e&&o||e===o,r=a?null:l?n(s):i;l||this.showIncompatibleColorWarning(s,e),this.setMode(e),this.internalColorSet(r,!1,"initial"),this.updateDimensions(this.scale);const h=`${c}${this.storageId}`;this.storageId&&localStorage.getItem(h)&&(this.savedColors=JSON.parse(localStorage.getItem(h)))}disconnectedCallback(){document.removeEventListener("pointermove",this.globalPointerMoveHandler),document.removeEventListener("pointerup",this.globalPointerUpHandler)}componentDidRender(){w(this)}render(){const{allowEmpty:t,color:i,intlDeleteColor:s,hideHex:n,hideChannels:o,hideSaved:l,intlHex:c,intlSaved:d,intlSaveColor:p,savedColors:u,scale:m}=this,f=i?i.hex():null,g="l"===m?"m":"s",{colorFieldAndSliderInteractive:b,colorFieldScopeTop:v,colorFieldScopeLeft:x,hueScopeLeft:w,hueScopeTop:y,scopeOrientation:k,dimensions:{colorField:{height:C,width:S},slider:{height:D}}}=this,F=null!=y?y:D/2+C,A=null!=w?w:S*a.hue()/r.h,z=null===i,j="vertical"===k;return e("div",{class:h.container},e("div",{class:h.colorFieldAndSliderWrap},e("canvas",{class:{[h.colorFieldAndSlider]:!0,[h.colorFieldAndSliderInteractive]:b},onPointerDown:this.handleColorFieldAndSliderPointerDown,onPointerEnter:this.handleColorFieldAndSliderPointerEnterOrMove,onPointerLeave:this.handleColorFieldAndSliderPointerLeave,onPointerMove:this.handleColorFieldAndSliderPointerEnterOrMove,ref:this.initColorFieldAndSlider}),e("div",{"aria-label":j?this.intlValue:this.intlSaturation,"aria-valuemax":j?r.v:r.s,"aria-valuemin":"0","aria-valuenow":(j?null==i?void 0:i.saturationv():null==i?void 0:i.value())||"0",class:{[h.scope]:!0,[h.colorFieldScope]:!0},onKeyDown:this.handleColorFieldScopeKeyDown,ref:this.storeColorFieldScope,role:"slider",style:{top:`${v||0}px`,left:`${x||0}px`},tabindex:"0"}),e("div",{"aria-label":this.intlHue,"aria-valuemax":r.h,"aria-valuemin":"0","aria-valuenow":(null==i?void 0:i.round().hue())||a.round().hue(),class:{[h.scope]:!0,[h.hueScope]:!0},onKeyDown:this.handleHueScopeKeyDown,ref:this.storeHueScope,role:"slider",style:{top:`${F}px`,left:`${A}px`},tabindex:"0"})),n&&o?null:e("div",{class:{[h.controlSection]:!0,[h.section]:!0}},n?null:e("div",{class:h.hexOptions},e("span",{class:{[h.header]:!0,[h.headerHex]:!0}},c),e("calcite-color-picker-hex-input",{allowEmpty:t,class:h.control,numberingSystem:this.numberingSystem,onCalciteColorPickerHexInputChange:this.handleHexInputChange,scale:g,value:f})),o?null:e("calcite-tabs",{class:{[h.colorModeContainer]:!0,[h.splitSection]:!0},scale:g},e("calcite-tab-nav",{slot:"tab-nav"},this.renderChannelsTabTitle("rgb"),this.renderChannelsTabTitle("hsv")),this.renderChannelsTab("rgb"),this.renderChannelsTab("hsv"))),l?null:e("div",{class:{[h.savedColorsSection]:!0,[h.section]:!0}},e("div",{class:h.header},e("label",null,d),e("div",{class:h.savedColorsButtons},e("calcite-button",{appearance:"transparent",class:h.deleteColor,color:"neutral",disabled:z,iconStart:"minus",label:s,onClick:this.deleteColor,scale:g,type:"button"}),e("calcite-button",{appearance:"transparent",class:h.saveColor,color:"neutral",disabled:z,iconStart:"plus",label:p,onClick:this.saveColor,scale:g,type:"button"}))),u.length>0?e("div",{class:h.savedColors},[...u.map((t=>e("calcite-color-picker-swatch",{active:f===t,class:h.savedColor,color:t,key:t,onClick:this.handleSavedColorSelect,onKeyDown:this.handleSavedColorKeyDown,scale:m,tabIndex:0})))]):null))}handleKeyDown(t){"Enter"===t.key&&t.preventDefault()}showIncompatibleColorWarning(t,i){console.warn(`ignoring color value (${t}) as it is not compatible with the current format (${i})`)}setMode(t){this.mode="auto"===t?this.mode:t}captureHueSliderColor(t){const{dimensions:{slider:{width:i}}}=this;this.internalColorSet(this.baseColorFieldColor.hue(360/i*t),!1)}getCanvasRegion(t){const{dimensions:{colorField:{height:i},slider:{height:e}}}=this;return t<=i?"color-field":t<=i+e?"slider":"none"}internalColorSet(t,i=!0,e="user-interaction"){i&&v(t,this.color)||(this.internalColorUpdateContext=e,this.color=t,this.value=this.toValue(t),this.internalColorUpdateContext=null)}toValue(t,i=this.mode){if(!t)return null;if(i.includes("hex"))return f(t.round().hex());if(i.includes("-css"))return t[i.replace("-css","").replace("a","")]().round().string();const e=t[i]().round().object();return i.endsWith("a")&&(e.a=e.alpha,delete e.alpha),e}getSliderCapSpacing(){const{dimensions:{slider:{height:t},thumb:{radius:i}}}=this;return 2*i-t}updateDimensions(t="m"){this.dimensions=l[t]}drawColorField(){const t=this.fieldAndSliderRenderingContext,{dimensions:{colorField:{height:i,width:e}}}=this;t.fillStyle=this.baseColorFieldColor.hsv().saturationv(100).value(100).string(),t.fillRect(0,0,e,i);const s=t.createLinearGradient(0,0,e,0);s.addColorStop(0,"rgba(255,255,255,1)"),s.addColorStop(1,"rgba(255,255,255,0)"),t.fillStyle=s,t.fillRect(0,0,e,i);const n=t.createLinearGradient(0,0,0,i);n.addColorStop(0,"rgba(0,0,0,0)"),n.addColorStop(1,"rgba(0,0,0,1)"),t.fillStyle=n,t.fillRect(0,0,e,i),this.drawActiveColorFieldColor()}setCanvasContextSize(t,{height:i,width:e}){const s=window.devicePixelRatio||1;t.width=e*s,t.height=i*s,t.style.height=`${i}px`,t.style.width=`${e}px`,t.getContext("2d").scale(s,s)}updateCanvasSize(t){t&&(this.setCanvasContextSize(t,{width:this.dimensions.colorField.width,height:this.dimensions.colorField.height+this.dimensions.slider.height+2*this.getSliderCapSpacing()}),this.drawColorFieldAndSlider())}containsPoint(t,i,e,s,n){return Math.pow(t-e,2)+Math.pow(i-s,2)<=Math.pow(n,2)}drawActiveColorFieldColor(){const{color:t}=this;if(!t)return;const i=t.hsv(),{dimensions:{colorField:{height:e,width:s},thumb:{radius:n}}}=this,a=i.saturationv()/(r.s/s),o=e-i.value()/(r.v/e);requestAnimationFrame((()=>{this.colorFieldScopeLeft=a,this.colorFieldScopeTop=o})),this.drawThumb(this.fieldAndSliderRenderingContext,n,a,o,i,this.hueThumbState)}drawThumb(t,i,e,s,n,a){const o=2*Math.PI;t.beginPath(),t.arc(e,s,i,0,o),t.shadowBlur="hover"===a?32:16,t.shadowColor=`rgba(0, 0, 0, ${"drag"===a?.32:.16})`,t.fillStyle="#fff",t.fill(),t.beginPath(),t.arc(e,s,i-3,0,o),t.shadowBlur=0,t.shadowColor="transparent",t.fillStyle=n.rgb().string(),t.fill()}drawActiveHueSliderColor(){const{color:t}=this;if(!t)return;const i=t.hsv().saturationv(100).value(100),{dimensions:{colorField:{height:e},slider:{height:s,width:n},thumb:{radius:a}}}=this,o=i.hue()/(360/n),l=s/2+e;requestAnimationFrame((()=>{this.hueScopeLeft=o,this.hueScopeTop=l})),this.drawThumb(this.fieldAndSliderRenderingContext,a,o,l,i,this.sliderThumbState)}drawHueSlider(){const t=this.fieldAndSliderRenderingContext,{dimensions:{colorField:{height:i},slider:{height:e,width:s}}}=this,a=t.createLinearGradient(0,0,s,0),o=["red","yellow","lime","cyan","blue","magenta","red"],l=1/(o.length-1);let r=0;o.forEach((t=>{a.addColorStop(r,n(t).string()),r+=l})),t.fillStyle=a,t.clearRect(0,i,s,e+2*this.getSliderCapSpacing()),t.fillRect(0,i,s,e),this.drawActiveHueSliderColor()}updateColorFromChannels(t){this.internalColorSet(n(t,this.channelMode))}updateChannelsFromColor(t){this.channels=t?this.toChannels(t):[null,null,null]}toChannels(t){const{channelMode:i}=this;return t[i]().array().map((t=>Math.floor(t)))}get el(){return s(this)}static get watchers(){return{color:["handleColorChange"],format:["handleFormatChange"],scale:["handleScaleChange"],value:["handleValueChange"]}}};D.style="@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;-ms-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{display:inline-block;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]) .container{inline-size:160px}:host([scale=s]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(20px, 1fr))}:host([scale=s]) .channels{flex-direction:column}:host([scale=s]) .channel{inline-size:100%;-webkit-margin-after:4px;margin-block-end:4px}:host([scale=s]) .channel:last-child{-webkit-margin-after:0;margin-block-end:0}:host([scale=m]) .container{inline-size:272px}:host([scale=l]) .header{-webkit-padding-after:0px;padding-block-end:0px}:host([scale=l]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) .container{inline-size:464px}:host([scale=l]) .color-field-and-slider{-webkit-margin-after:-20px;margin-block-end:-20px}:host([scale=l]) .section{padding-block:0 16px;padding-inline:16px}:host([scale=l]) .section:first-of-type{-webkit-padding-before:16px;padding-block-start:16px}:host([scale=l]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(28px, 1fr));grid-gap:12px;-webkit-padding-before:16px;padding-block-start:16px}:host([scale=l]) .control-section{flex-wrap:nowrap;align-items:baseline}:host([scale=l]) .control-section>:nth-child(2){-webkit-margin-start:12px;margin-inline-start:12px}:host([scale=l]) .color-hex-options{display:flex;flex-shrink:1;flex-direction:column;justify-content:space-around;min-block-size:98px;inline-size:160px}:host([scale=l]) .color-mode-container{flex-shrink:3}:host([appearance=minimal]) .container{border:none}.container{background-color:var(--calcite-ui-foreground-1);display:inline-block;border:1px solid var(--calcite-ui-border-1)}.color-field-and-slider-wrap{position:relative}.scope{pointer-events:none;position:absolute;font-size:var(--calcite-font-size--1);outline-color:transparent;outline-offset:14px}.scope:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:16px}.color-field-and-slider{-webkit-margin-after:-16px;margin-block-end:-16px;touch-action:none}.color-field-and-slider--interactive{cursor:pointer}.control-section{display:flex;flex-direction:row;flex-wrap:wrap}.section{padding-block:0 12px;padding-inline:12px}.section:first-of-type{-webkit-padding-before:12px;padding-block-start:12px}.color-hex-options,.section--split{flex-grow:1}.header{display:flex;align-items:center;justify-content:space-between;-webkit-padding-after:0.25rem;padding-block-end:0.25rem;color:var(--calcite-ui-text-1)}.header--hex,.color-mode-container{-webkit-padding-before:12px;padding-block-start:12px}.channels{display:flex;justify-content:space-between}.channel{inline-size:31%}.saved-colors{-webkit-padding-before:12px;padding-block-start:12px;display:grid;grid-template-columns:repeat(auto-fill, minmax(24px, 1fr));grid-gap:8px;inline-size:100%}.saved-colors-buttons{display:flex}.saved-color{outline-offset:0;outline-color:transparent;cursor:pointer}.saved-color:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.saved-color:hover{transition:outline-color var(--calcite-internal-animation-timing-fast) ease-in-out;outline:2px solid var(--calcite-ui-border-2);outline-offset:2px}";export{D as calcite_color_picker}
|
6
|
+
import{r as t,c as i,h as e,g as s}from"./p-be2e3b99.js";import{c as n}from"./p-93d3119d.js";import{D as a,T as o,a as l,H as r,C as h,b as c,R as d}from"./p-374a5031.js";import{i as p,b as u,f as m}from"./p-32a67cb2.js";import{n as f,C as g,p as b,c as v}from"./p-991ee695.js";import{c as x}from"./p-63f6e8f1.js";import{u as w}from"./p-7daea1df.js";import{i as y}from"./p-73e23995.js";import{d as k,i as C}from"./p-4e32bf8c.js";import"./p-3b010ce1.js";import"./p-729708a3.js";import"./p-a80b3880.js";const S=f(a.hex()),D=class{constructor(s){var m,b,v,w;t(this,s),this.calciteColorPickerChange=i(this,"calciteColorPickerChange",6),this.calciteColorPickerInput=i(this,"calciteColorPickerInput",6),this.allowEmpty=!1,this.appearance="solid",this.color=a,this.disabled=!1,this.format="auto",this.hideHex=!1,this.hideChannels=!1,this.hideSaved=!1,this.intlB=o.b,this.intlBlue=o.blue,this.intlDeleteColor=o.deleteColor,this.intlG=o.g,this.intlGreen=o.green,this.intlH=o.h,this.intlHsv=o.hsv,this.intlHex=o.hex,this.intlHue=o.hue,this.intlNoColor=o.noColor,this.intlR=o.r,this.intlRed=o.red,this.intlRgb=o.rgb,this.intlS=o.s,this.intlSaturation=o.saturation,this.intlSaveColor=o.saveColor,this.intlSaved=o.saved,this.intlV=o.v,this.intlValue=o.value,this.scale="m",this.value=S,this.colorFieldAndSliderHovered=!1,this.hueThumbState="idle",this.internalColorUpdateContext=null,this.mode=g.HEX,this.shiftKeyChannelAdjustment=0,this.sliderThumbState="idle",this.colorFieldAndSliderInteractive=!1,this.channelMode="rgb",this.channels=this.toChannels(a),this.dimensions=l.m,this.savedColors=[],this.handleTabActivate=t=>{this.channelMode=t.currentTarget.getAttribute("data-color-mode"),this.updateChannelsFromColor(this.color)},this.handleColorFieldScopeKeyDown=t=>{const{key:i}=t,e={ArrowUp:{x:0,y:-10},ArrowRight:{x:10,y:0},ArrowDown:{x:0,y:10},ArrowLeft:{x:-10,y:0}};e[i]&&(t.preventDefault(),this.scopeOrientation="ArrowDown"===i||"ArrowUp"===i?"vertical":"horizontal",this.captureColorFieldColor(this.colorFieldScopeLeft+e[i].x||0,this.colorFieldScopeTop+e[i].y||0,!1))},this.handleHueScopeKeyDown=t=>{const i=t.shiftKey?10:1,{key:e}=t,s={ArrowUp:1,ArrowRight:1,ArrowDown:-1,ArrowLeft:-1};if(s[e]){t.preventDefault();const n=s[e]*i,a=this.baseColorFieldColor.hue(),o=this.baseColorFieldColor.hue(a+n);this.internalColorSet(o,!1)}},this.handleHexInputChange=t=>{t.stopPropagation();const{allowEmpty:i,color:e}=this,s=t.target.value;!i||s?s!==(e&&f(e.hex()))&&this.internalColorSet(n(s)):this.internalColorSet(null)},this.handleSavedColorSelect=t=>{this.internalColorSet(n(t.currentTarget.color))},this.handleChannelInput=t=>{const i=t.currentTarget,e=t.detail.nativeEvent.target,s=Number(i.getAttribute("data-channel-index")),n="rgb"===this.channelMode?d[Object.keys(d)[s]]:r[Object.keys(r)[s]];let a;if(this.allowEmpty&&!i.value)a="";else{const t=Number(i.value)+this.shiftKeyChannelAdjustment;a=x(t,0,n).toString()}i.value=a,e.value=a},this.handleChannelChange=t=>{const i=t.currentTarget,e=Number(i.getAttribute("data-channel-index")),s=[...this.channels];if(this.allowEmpty&&!i.value)return this.channels=[null,null,null],void this.internalColorSet(null);s[e]=Number(i.value),this.updateColorFromChannels(s)},this.handleSavedColorKeyDown=t=>{y(t.key)&&(t.preventDefault(),this.handleSavedColorSelect(t))},this.handleColorFieldAndSliderPointerLeave=()=>{this.colorFieldAndSliderInteractive=!1,this.colorFieldAndSliderHovered=!1,"drag"!==this.sliderThumbState&&"drag"!==this.hueThumbState&&(this.hueThumbState="idle",this.sliderThumbState="idle",this.drawColorFieldAndSlider())},this.handleColorFieldAndSliderPointerDown=t=>{var i,e;if(!p(t))return;const{offsetX:s,offsetY:n}=t,a=this.getCanvasRegion(n);"color-field"===a?(this.hueThumbState="drag",this.captureColorFieldColor(s,n),null===(i=this.colorFieldScopeNode)||void 0===i||i.focus()):"slider"===a&&(this.sliderThumbState="drag",this.captureHueSliderColor(s),null===(e=this.hueScopeNode)||void 0===e||e.focus()),t.preventDefault(),document.addEventListener("pointermove",this.globalPointerMoveHandler),document.addEventListener("pointerup",this.globalPointerUpHandler,{once:!0}),this.activeColorFieldAndSliderRect=this.fieldAndSliderRenderingContext.canvas.getBoundingClientRect()},this.globalPointerUpHandler=t=>{if(!p(t))return;const i="drag"===this.sliderThumbState||"drag"===this.hueThumbState;this.hueThumbState="idle",this.sliderThumbState="idle",this.activeColorFieldAndSliderRect=null,this.drawColorFieldAndSlider(),i&&this.calciteColorPickerChange.emit()},this.globalPointerMoveHandler=t=>{const{el:i,dimensions:e}=this,s="drag"===this.hueThumbState;if(!i.isConnected||"drag"!==this.sliderThumbState&&!s)return;let n,a;const o=this.activeColorFieldAndSliderRect,{clientX:l,clientY:r}=t;if(this.colorFieldAndSliderHovered)n=l-o.x,a=r-o.y;else{const t=e.colorField.width,i=e.colorField.height,s=e.slider.height;n=l<o.x+t&&l>o.x?l-o.x:l<o.x?0:t-1,a=r<o.y+i+s&&r>o.y?r-o.y:r<o.y?0:i+s}s?this.captureColorFieldColor(n,a,!1):this.captureHueSliderColor(n)},this.handleColorFieldAndSliderPointerEnterOrMove=({offsetX:t,offsetY:i})=>{const{dimensions:{colorField:e,slider:s,thumb:n}}=this;this.colorFieldAndSliderInteractive=i<=e.height+s.height,this.colorFieldAndSliderHovered=!0;const a=this.getCanvasRegion(i);if("color-field"===a){const s=this.hueThumbState,a=this.baseColorFieldColor.hsv(),o=Math.round(a.saturationv()/(r.s/e.width)),l=Math.round(e.height-a.value()/(r.v/e.height)),h=this.containsPoint(t,i,o,l,n.radius);let c=!1;"idle"===s&&h?(this.hueThumbState="hover",c=!0):"hover"!==s||h||(this.hueThumbState="idle",c=!0),"drag"!==this.hueThumbState&&c&&this.drawColorFieldAndSlider()}else if("slider"===a){const a=this.baseColorFieldColor.hsv().saturationv(100).value(100),o=this.sliderThumbState,l=Math.round(a.hue()/(360/s.width)),r=Math.round((s.height+this.getSliderCapSpacing())/2)+e.height,h=this.containsPoint(t,i,l,r,n.radius);let c=!1;"idle"===o&&h?(this.sliderThumbState="hover",c=!0):"hover"!==o||h||(this.sliderThumbState="idle",c=!0),"drag"!==this.sliderThumbState&&c&&this.drawColorFieldAndSlider()}},this.storeColorFieldScope=t=>{this.colorFieldScopeNode=t},this.storeHueScope=t=>{this.hueScopeNode=t},this.renderChannelsTabTitle=t=>{const{channelMode:i,intlRgb:s,intlHsv:n}=this;return e("calcite-tab-title",{active:t===i,class:h.colorMode,"data-color-mode":t,key:t,onCalciteTabsActivate:this.handleTabActivate},"rgb"===t?s:n)},this.renderChannelsTab=t=>{const{channelMode:i,channels:s,intlB:n,intlBlue:a,intlG:o,intlGreen:l,intlH:r,intlHue:c,intlR:d,intlRed:p,intlS:m,intlSaturation:f,intlV:g,intlValue:b}=this,v=t===i,x="rgb"===t,w=x?[d,o,n]:[r,m,g],y=x?[p,l,a]:[c,f,b],k=u(this.el);return e("calcite-tab",{active:v,class:h.control,key:t},e("div",{class:h.channels,dir:"ltr"},s.map(((t,i)=>this.renderChannel(t,i,w[i],y[i],k)))))},this.renderChannel=(t,i,s,n,a)=>e("calcite-input",{class:h.channel,"data-channel-index":i,dir:a,label:n,numberButtonType:"none",numberingSystem:this.numberingSystem,onCalciteInputChange:this.handleChannelChange,onCalciteInputInput:this.handleChannelInput,onKeyDown:this.handleKeyDown,prefixText:s,scale:"l"===this.scale?"m":"s",type:"number",value:null==t?void 0:t.toString()}),this.deleteColor=()=>{const t=this.color.hex();if(!(this.savedColors.indexOf(t)>-1))return;const i=this.savedColors.filter((i=>i!==t));this.savedColors=i,this.storageId&&localStorage.setItem(`${c}${this.storageId}`,JSON.stringify(i))},this.saveColor=()=>{const t=this.color.hex();if(this.savedColors.indexOf(t)>-1)return;const i=[...this.savedColors,t];this.savedColors=i,this.storageId&&localStorage.setItem(`${c}${this.storageId}`,JSON.stringify(i))},this.drawColorFieldAndSlider=(m=()=>{this.fieldAndSliderRenderingContext&&(this.drawColorField(),this.drawHueSlider())},v=!0,w=!0,C(b)&&(v="leading"in b?!!b.leading:v,w="trailing"in b?!!b.trailing:w),k(m,16,{leading:v,maxWait:16,trailing:w})),this.captureColorFieldColor=(t,i,e=!0)=>{const{dimensions:{colorField:{height:s,width:n}}}=this,a=Math.round(r.s/n*t),o=Math.round(r.v/s*(s-i));this.internalColorSet(this.baseColorFieldColor.hsv().saturationv(a).value(o),e)},this.initColorFieldAndSlider=t=>{this.fieldAndSliderRenderingContext=t.getContext("2d"),this.updateCanvasSize(t)}}handleColorChange(t,i){this.drawColorFieldAndSlider(),this.updateChannelsFromColor(t),this.previousColor=i}handleFormatChange(t){this.setMode(t),this.internalColorSet(this.color,!1,"internal")}handleScaleChange(t="m"){var i;this.updateDimensions(t),this.updateCanvasSize(null===(i=this.fieldAndSliderRenderingContext)||void 0===i?void 0:i.canvas)}handleValueChange(t,i){const{allowEmpty:e,format:s}=this;let a=!1;if(!e||t){const e=b(t);if(!e||"auto"!==s&&e!==s)return this.showIncompatibleColorWarning(t,s),void(this.value=i);a=this.mode!==e,this.setMode(e)}const o="drag"===this.sliderThumbState||"drag"===this.hueThumbState;if("initial"===this.internalColorUpdateContext)return;if("user-interaction"===this.internalColorUpdateContext)return this.calciteColorPickerInput.emit(),void(o||this.calciteColorPickerChange.emit());const l=e&&!t?null:n(t),r=!v(l,this.color);(a||r)&&this.internalColorSet(l,!0,"internal")}get baseColorFieldColor(){return this.color||this.previousColor||a}handleChannelKeyUpOrDown(t){this.shiftKeyChannelAdjustment=0;const{key:i}=t;if("ArrowUp"!==i&&"ArrowDown"!==i||!t.composedPath().some((t=>{var i;return null===(i=t.classList)||void 0===i?void 0:i.contains(h.channel)})))return;const{shiftKey:e}=t;if(t.preventDefault(),!this.color)return this.internalColorSet(this.previousColor),void t.stopPropagation();this.shiftKeyChannelAdjustment="ArrowUp"===i&&e?9:"ArrowDown"===i&&e?-9:0}async setFocus(){return m(this.colorFieldScopeNode)}componentWillLoad(){const{allowEmpty:t,color:i,format:e,value:s}=this,a=t&&!s,o=b(s),l=a||"auto"===e&&o||e===o,r=a?null:l?n(s):i;l||this.showIncompatibleColorWarning(s,e),this.setMode(e),this.internalColorSet(r,!1,"initial"),this.updateDimensions(this.scale);const h=`${c}${this.storageId}`;this.storageId&&localStorage.getItem(h)&&(this.savedColors=JSON.parse(localStorage.getItem(h)))}disconnectedCallback(){document.removeEventListener("pointermove",this.globalPointerMoveHandler),document.removeEventListener("pointerup",this.globalPointerUpHandler)}componentDidRender(){w(this)}render(){const{allowEmpty:t,color:i,intlDeleteColor:s,hideHex:n,hideChannels:o,hideSaved:l,intlHex:c,intlSaved:d,intlSaveColor:p,savedColors:u,scale:m}=this,f=i?i.hex():null,g="l"===m?"m":"s",{colorFieldAndSliderInteractive:b,colorFieldScopeTop:v,colorFieldScopeLeft:x,hueScopeLeft:w,hueScopeTop:y,scopeOrientation:k,dimensions:{colorField:{height:C,width:S},slider:{height:D}}}=this,F=null!=y?y:D/2+C,A=null!=w?w:S*a.hue()/r.h,z=null===i,j="vertical"===k;return e("div",{class:h.container},e("div",{class:h.colorFieldAndSliderWrap},e("canvas",{class:{[h.colorFieldAndSlider]:!0,[h.colorFieldAndSliderInteractive]:b},onPointerDown:this.handleColorFieldAndSliderPointerDown,onPointerEnter:this.handleColorFieldAndSliderPointerEnterOrMove,onPointerLeave:this.handleColorFieldAndSliderPointerLeave,onPointerMove:this.handleColorFieldAndSliderPointerEnterOrMove,ref:this.initColorFieldAndSlider}),e("div",{"aria-label":j?this.intlValue:this.intlSaturation,"aria-valuemax":j?r.v:r.s,"aria-valuemin":"0","aria-valuenow":(j?null==i?void 0:i.saturationv():null==i?void 0:i.value())||"0",class:{[h.scope]:!0,[h.colorFieldScope]:!0},onKeyDown:this.handleColorFieldScopeKeyDown,ref:this.storeColorFieldScope,role:"slider",style:{top:`${v||0}px`,left:`${x||0}px`},tabindex:"0"}),e("div",{"aria-label":this.intlHue,"aria-valuemax":r.h,"aria-valuemin":"0","aria-valuenow":(null==i?void 0:i.round().hue())||a.round().hue(),class:{[h.scope]:!0,[h.hueScope]:!0},onKeyDown:this.handleHueScopeKeyDown,ref:this.storeHueScope,role:"slider",style:{top:`${F}px`,left:`${A}px`},tabindex:"0"})),n&&o?null:e("div",{class:{[h.controlSection]:!0,[h.section]:!0}},n?null:e("div",{class:h.hexOptions},e("span",{class:{[h.header]:!0,[h.headerHex]:!0}},c),e("calcite-color-picker-hex-input",{allowEmpty:t,class:h.control,numberingSystem:this.numberingSystem,onCalciteColorPickerHexInputChange:this.handleHexInputChange,scale:g,value:f})),o?null:e("calcite-tabs",{class:{[h.colorModeContainer]:!0,[h.splitSection]:!0},scale:g},e("calcite-tab-nav",{slot:"tab-nav"},this.renderChannelsTabTitle("rgb"),this.renderChannelsTabTitle("hsv")),this.renderChannelsTab("rgb"),this.renderChannelsTab("hsv"))),l?null:e("div",{class:{[h.savedColorsSection]:!0,[h.section]:!0}},e("div",{class:h.header},e("label",null,d),e("div",{class:h.savedColorsButtons},e("calcite-button",{appearance:"transparent",class:h.deleteColor,color:"neutral",disabled:z,iconStart:"minus",label:s,onClick:this.deleteColor,scale:g,type:"button"}),e("calcite-button",{appearance:"transparent",class:h.saveColor,color:"neutral",disabled:z,iconStart:"plus",label:p,onClick:this.saveColor,scale:g,type:"button"}))),u.length>0?e("div",{class:h.savedColors},[...u.map((t=>e("calcite-color-picker-swatch",{active:f===t,class:h.savedColor,color:t,key:t,onClick:this.handleSavedColorSelect,onKeyDown:this.handleSavedColorKeyDown,scale:m,tabIndex:0})))]):null))}handleKeyDown(t){"Enter"===t.key&&t.preventDefault()}showIncompatibleColorWarning(t,i){console.warn(`ignoring color value (${t}) as it is not compatible with the current format (${i})`)}setMode(t){this.mode="auto"===t?this.mode:t}captureHueSliderColor(t){const{dimensions:{slider:{width:i}}}=this;this.internalColorSet(this.baseColorFieldColor.hue(360/i*t),!1)}getCanvasRegion(t){const{dimensions:{colorField:{height:i},slider:{height:e}}}=this;return t<=i?"color-field":t<=i+e?"slider":"none"}internalColorSet(t,i=!0,e="user-interaction"){i&&v(t,this.color)||(this.internalColorUpdateContext=e,this.color=t,this.value=this.toValue(t),this.internalColorUpdateContext=null)}toValue(t,i=this.mode){if(!t)return null;if(i.includes("hex"))return f(t.round().hex());if(i.includes("-css"))return t[i.replace("-css","").replace("a","")]().round().string();const e=t[i]().round().object();return i.endsWith("a")&&(e.a=e.alpha,delete e.alpha),e}getSliderCapSpacing(){const{dimensions:{slider:{height:t},thumb:{radius:i}}}=this;return 2*i-t}updateDimensions(t="m"){this.dimensions=l[t]}drawColorField(){const t=this.fieldAndSliderRenderingContext,{dimensions:{colorField:{height:i,width:e}}}=this;t.fillStyle=this.baseColorFieldColor.hsv().saturationv(100).value(100).string(),t.fillRect(0,0,e,i);const s=t.createLinearGradient(0,0,e,0);s.addColorStop(0,"rgba(255,255,255,1)"),s.addColorStop(1,"rgba(255,255,255,0)"),t.fillStyle=s,t.fillRect(0,0,e,i);const n=t.createLinearGradient(0,0,0,i);n.addColorStop(0,"rgba(0,0,0,0)"),n.addColorStop(1,"rgba(0,0,0,1)"),t.fillStyle=n,t.fillRect(0,0,e,i),this.drawActiveColorFieldColor()}setCanvasContextSize(t,{height:i,width:e}){const s=window.devicePixelRatio||1;t.width=e*s,t.height=i*s,t.style.height=`${i}px`,t.style.width=`${e}px`,t.getContext("2d").scale(s,s)}updateCanvasSize(t){t&&(this.setCanvasContextSize(t,{width:this.dimensions.colorField.width,height:this.dimensions.colorField.height+this.dimensions.slider.height+2*this.getSliderCapSpacing()}),this.drawColorFieldAndSlider())}containsPoint(t,i,e,s,n){return Math.pow(t-e,2)+Math.pow(i-s,2)<=Math.pow(n,2)}drawActiveColorFieldColor(){const{color:t}=this;if(!t)return;const i=t.hsv(),{dimensions:{colorField:{height:e,width:s},thumb:{radius:n}}}=this,a=i.saturationv()/(r.s/s),o=e-i.value()/(r.v/e);requestAnimationFrame((()=>{this.colorFieldScopeLeft=a,this.colorFieldScopeTop=o})),this.drawThumb(this.fieldAndSliderRenderingContext,n,a,o,i,this.hueThumbState)}drawThumb(t,i,e,s,n,a){const o=2*Math.PI;t.beginPath(),t.arc(e,s,i,0,o),t.shadowBlur="hover"===a?32:16,t.shadowColor=`rgba(0, 0, 0, ${"drag"===a?.32:.16})`,t.fillStyle="#fff",t.fill(),t.beginPath(),t.arc(e,s,i-3,0,o),t.shadowBlur=0,t.shadowColor="transparent",t.fillStyle=n.rgb().string(),t.fill()}drawActiveHueSliderColor(){const{color:t}=this;if(!t)return;const i=t.hsv().saturationv(100).value(100),{dimensions:{colorField:{height:e},slider:{height:s,width:n},thumb:{radius:a}}}=this,o=i.hue()/(360/n),l=s/2+e;requestAnimationFrame((()=>{this.hueScopeLeft=o,this.hueScopeTop=l})),this.drawThumb(this.fieldAndSliderRenderingContext,a,o,l,i,this.sliderThumbState)}drawHueSlider(){const t=this.fieldAndSliderRenderingContext,{dimensions:{colorField:{height:i},slider:{height:e,width:s}}}=this,a=t.createLinearGradient(0,0,s,0),o=["red","yellow","lime","cyan","blue","magenta","red"],l=1/(o.length-1);let r=0;o.forEach((t=>{a.addColorStop(r,n(t).string()),r+=l})),t.fillStyle=a,t.clearRect(0,i,s,e+2*this.getSliderCapSpacing()),t.fillRect(0,i,s,e),this.drawActiveHueSliderColor()}updateColorFromChannels(t){this.internalColorSet(n(t,this.channelMode))}updateChannelsFromColor(t){this.channels=t?this.toChannels(t):[null,null,null]}toChannels(t){const{channelMode:i}=this;return t[i]().array().map((t=>Math.floor(t)))}get el(){return s(this)}static get watchers(){return{color:["handleColorChange"],format:["handleFormatChange"],scale:["handleScaleChange"],value:["handleValueChange"]}}};D.style="@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:inline-block;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]) .container{inline-size:160px}:host([scale=s]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(20px, 1fr))}:host([scale=s]) .channels{flex-direction:column}:host([scale=s]) .channel{inline-size:100%;-webkit-margin-after:4px;margin-block-end:4px}:host([scale=s]) .channel:last-child{-webkit-margin-after:0;margin-block-end:0}:host([scale=m]) .container{inline-size:272px}:host([scale=l]) .header{-webkit-padding-after:0px;padding-block-end:0px}:host([scale=l]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) .container{inline-size:464px}:host([scale=l]) .color-field-and-slider{-webkit-margin-after:-20px;margin-block-end:-20px}:host([scale=l]) .section{padding-block:0 16px;padding-inline:16px}:host([scale=l]) .section:first-of-type{-webkit-padding-before:16px;padding-block-start:16px}:host([scale=l]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(28px, 1fr));grid-gap:12px;-webkit-padding-before:16px;padding-block-start:16px}:host([scale=l]) .control-section{flex-wrap:nowrap;align-items:baseline}:host([scale=l]) .control-section>:nth-child(2){-webkit-margin-start:12px;margin-inline-start:12px}:host([scale=l]) .color-hex-options{display:flex;flex-shrink:1;flex-direction:column;justify-content:space-around;min-block-size:98px;inline-size:160px}:host([scale=l]) .color-mode-container{flex-shrink:3}:host([appearance=minimal]) .container{border:none}.container{background-color:var(--calcite-ui-foreground-1);display:inline-block;border:1px solid var(--calcite-ui-border-1)}.color-field-and-slider-wrap{position:relative}.scope{pointer-events:none;position:absolute;font-size:var(--calcite-font-size--1);outline-color:transparent;outline-offset:14px}.scope:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:16px}.color-field-and-slider{-webkit-margin-after:-16px;margin-block-end:-16px;touch-action:none}.color-field-and-slider--interactive{cursor:pointer}.control-section{display:flex;flex-direction:row;flex-wrap:wrap}.section{padding-block:0 12px;padding-inline:12px}.section:first-of-type{-webkit-padding-before:12px;padding-block-start:12px}.color-hex-options,.section--split{flex-grow:1}.header{display:flex;align-items:center;justify-content:space-between;-webkit-padding-after:0.25rem;padding-block-end:0.25rem;color:var(--calcite-ui-text-1)}.header--hex,.color-mode-container{-webkit-padding-before:12px;padding-block-start:12px}.channels{display:flex;justify-content:space-between}.channel{inline-size:31%}.saved-colors{-webkit-padding-before:12px;padding-block-start:12px;display:grid;grid-template-columns:repeat(auto-fill, minmax(24px, 1fr));grid-gap:8px;inline-size:100%}.saved-colors-buttons{display:flex}.saved-color{outline-offset:0;outline-color:transparent;cursor:pointer}.saved-color:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.saved-color:hover{transition:outline-color var(--calcite-internal-animation-timing-fast) ease-in-out;outline:2px solid var(--calcite-ui-border-2);outline-offset:2px}";export{D as calcite_color_picker}
|
@@ -0,0 +1,6 @@
|
|
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 i,h as t,H as e,g as s}from"./p-be2e3b99.js";import{l}from"./p-a128b9ca.js";import{a,E as d,b as n}from"./p-6b9dc092.js";import{a as o,b as c,c as r,h}from"./p-fe0fdd8b.js";import{s as p}from"./p-fda0d45f.js";import{g}from"./p-0af82897.js";import{g as v,a as u}from"./p-fc884dd6.js";import"./p-91192214.js";import"./p-3b010ce1.js";const b=class{constructor(t){i(this,t),this.addresseeLayer=void 0,this.mapView=void 0,this._downloadActive=!0,this._numSelected=0,this._pageType=a.LIST,this._saveEnabled=!1,this._selectionSets=[],this._selectionWorkflowType=d.SEARCH,this._translations=void 0}async selectionSetsWatchHandler(i,t){i&&i!==t&&i.length>0&&0===i.filter((i=>i.workflowType!==d.REFINE)).length&&(this._selectionSets=[])}async pageTypeWatchHandler(i,t){if(this._clearHighlight(),t!==a.SELECT&&t!==a.REFINE||await this._clearSelection(),i!==a.SELECT)return this._highlightFeatures()}selectionSetsChanged(i){this._selectionSets=[...i.detail]}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){var i,s,l,d;const n=this._selectionSets.length>0;return t(e,null,t("calcite-shell",null,t("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getActionGroup("list-check",!1,a.LIST,null===(i=this._translations)||void 0===i?void 0:i.myLists),this._getActionGroup("test-data",!n,a.REFINE,null===(s=this._translations)||void 0===s?void 0:s.refineSelection),this._getActionGroup("file-pdf",!n,a.PDF,null===(l=this._translations)||void 0===l?void 0:l.downloadPDF),this._getActionGroup("file-csv",!n,a.CSV,null===(d=this._translations)||void 0===d?void 0:d.downloadCSV)),this._getPage(this._pageType)))}async _initModules(){const[i]=await l(["esri/geometry/geometryEngine"]);this._geometryEngine=i}_getActionGroup(i,e,s,l){return t("calcite-action-group",{class:"action-center w-1-4",layout:"horizontal"},t("calcite-action",{active:this._pageType===s,alignment:"center",class:"width-full height-full",compact:!1,disabled:e,icon:i,id:i,onClick:()=>{this._setPageType(s)},text:""}),t("calcite-tooltip",{label:"",placement:"bottom","reference-element":i},t("span",null,l)))}_setPageType(i){this._pageType=i}_getPage(i){let t;switch(i){case a.LIST:t=this._getListPage();break;case a.SELECT:t=this._getSelectPage();break;case a.REFINE:t=this._getRefinePage();break;case a.PDF:t=this._getPDFPage();break;case a.CSV:t=this._getCSVPage()}return t}_getListPage(){var i,e,s,l,n,o,c,r,h,p,g,u,b,m,f;const w=this._selectionSets.filter((i=>i.workflowType!==d.REFINE)).length>0,y=v(this._selectionSets);return w?t("calcite-panel",null,t("div",{class:"padding-top-sides-1"},t("calcite-label",{class:"font-bold"},null===(i=this._translations)||void 0===i?void 0:i.myLists)),this._getNotice(null===(e=this._translations)||void 0===e?void 0:e.listHasSetsTip,"padding-sides-1 padding-bottom-1"),t("div",{class:"display-flex padding-sides-1"},t("calcite-label",{class:"font-bold width-full"},null===(s=this._translations)||void 0===s?void 0:s.addresseeLayer,t("map-layer-picker",{mapView:this.mapView,onLayerSelectionChange:i=>this._layerSelectionChange(i),selectedLayers:this.addresseeLayer?[null===(l=this.addresseeLayer)||void 0===l?void 0:l.layer.title]:[],selectionMode:"single"}))),t("div",{class:"padding-sides-1 height-1-1-2"},t("div",{class:"position-left"},t("calcite-label",{alignment:"start",class:"font-bold"},null===(n=this._translations)||void 0===n?void 0:n.notifications)),t("div",{class:"position-right"},t("calcite-input-message",{active:!0,class:"info-blue margin-top-0",scale:"m"},null===(o=this._translations)||void 0===o?void 0:o.uniqueCout.replace("{{n}}",y.toString())))),w?this._getSelectionSetList():t("div",{class:"info-message"},t("calcite-input-message",{active:!0,class:"info-blue",scale:"m"},null===(c=this._translations)||void 0===c?void 0:c.noNotifications)),t("div",{class:"display-flex padding-1"},t("calcite-button",{onClick:()=>{this._setPageType(a.SELECT)},width:"full"},null===(r=this._translations)||void 0===r?void 0:r.add))):t("calcite-panel",null,t("div",{class:"padding-top-sides-1"},t("calcite-label",{class:"font-bold"},null===(h=this._translations)||void 0===h?void 0:h.myLists)),t("div",{class:"padding-sides-1"},t("calcite-label",null,null===(p=this._translations)||void 0===p?void 0:p.notifications)),t("div",{class:"info-message padding-bottom-1"},t("calcite-input-message",{active:!0,class:"info-blue",scale:"m"},null===(g=this._translations)||void 0===g?void 0:g.noNotifications)),this._getNotice(null===(u=this._translations)||void 0===u?void 0:u.selectLayerAndAdd,"padding-sides-1 padding-bottom-1"),t("div",{class:"display-flex padding-sides-1"},t("calcite-label",{class:"font-bold width-full"},null===(b=this._translations)||void 0===b?void 0:b.addresseeLayer,t("map-layer-picker",{mapView:this.mapView,onLayerSelectionChange:i=>this._layerSelectionChange(i),selectedLayers:this.addresseeLayer?[null===(m=this.addresseeLayer)||void 0===m?void 0:m.layer.title]:[],selectionMode:"single"}))),t("div",{class:"display-flex padding-1"},t("calcite-button",{onClick:()=>{this._setPageType(a.SELECT)},width:"full"},null===(f=this._translations)||void 0===f?void 0:f.add)))}_getSelectionSetList(){return t("calcite-list",{class:"list-border margin-sides-1"},this._selectionSets.reduce(((i,e,s)=>(e.workflowType!==d.REFINE&&i.push(t("calcite-list-item",{description:this._translations.selectedFeatures.replace("{{n}}",e.selectedIds.length.toString()),label:e.label,onClick:()=>o(e.selectedIds,e.layerView,this.mapView)},this._getAction(!0,"pencil","",(i=>this._openSelection(e,i)),!1,"actions-end"),this._getAction(!0,"x","",(i=>this._deleteSelection(s,i)),!1,"actions-end"))),i)),[]))}_getSelectPage(){var i,e,s,l,a,n,o,c,r,h;const p=`${null===(i=this._translations)||void 0===i?void 0:i.selectSearchTip} ${null===(e=this._translations)||void 0===e?void 0:e.optionalSearchDistance}`,g=`${null===(s=this._translations)||void 0===s?void 0:s.selectLayerTip} ${null===(l=this._translations)||void 0===l?void 0:l.optionalSearchDistance}`,v=`${null===(a=this._translations)||void 0===a?void 0:a.selectSketchTip} ${null===(n=this._translations)||void 0===n?void 0:n.optionalSearchDistance}`,u=this._selectionWorkflowType===d.SELECT?g:this._selectionWorkflowType===d.SKETCH?v:p;return t("calcite-panel",null,this._getLabel(null===(o=this._translations)||void 0===o?void 0:o.stepTwoFull,!0),this._getNotice(u),t("div",{class:"padding-1"},t("map-select-tools",{class:"font-bold",isUpdate:!!this._activeSelection,mapView:this.mapView,onSelectionSetChange:i=>this._updateForSelection(i),onWorkflowTypeChange:i=>this._updateForWorkflowType(i),ref:i=>{this._selectTools=i},selectLayerView:this.addresseeLayer,selectionSet:this._activeSelection})),t("div",{class:"padding-sides-1 padding-bottom-1",style:{"align-items":"end",display:"flex"}},t("calcite-icon",{class:"info-blue padding-end-1-2",icon:"feature-layer",scale:"s"}),t("calcite-input-message",{active:!0,class:"info-blue",scale:"m"},null===(c=this._translations)||void 0===c?void 0:c.selectedAddresses.replace("{{n}}",this._numSelected.toString()))),this._getPageNavButtons(null===(r=this._translations)||void 0===r?void 0:r.done,0===this._numSelected,(()=>{this._saveSelection()}),null===(h=this._translations)||void 0===h?void 0:h.cancel,!1,(()=>{this._home()})))}_getRefinePage(){var i,e;return t("calcite-panel",null,this._getLabel(null===(i=this._translations)||void 0===i?void 0:i.refineSelection),this._getNotice(null===(e=this._translations)||void 0===e?void 0:e.refineTip,"padding-sides-1"),t("refine-selection",{addresseeLayer:this.addresseeLayer,mapView:this.mapView,selectionSets:this._selectionSets}))}_getPDFPage(){return this._getDownloadPage(n.PDF)}_getCSVPage(){return this._getDownloadPage(n.CSV)}_getDownloadPage(i){var e,s,l,a,d,o,c;const r=i===n.PDF;return t("calcite-panel",null,t("div",null,t("div",{class:"padding-top-sides-1"},t("calcite-label",{class:"font-bold"},r?null===(e=this._translations)||void 0===e?void 0:e.pdfDownloads:null===(s=this._translations)||void 0===s?void 0:s.csvDownloads),t("calcite-label",null,null===(l=this._translations)||void 0===l?void 0:l.notifications)),this._getSelectionLists(),t("div",{class:"margin-side-1 padding-top-1 border-bottom"}),t("div",{class:"padding-top-sides-1"},t("calcite-label",{disabled:!this._downloadActive,layout:"inline"},t("calcite-checkbox",{disabled:!this._downloadActive,ref:i=>{this._removeDuplicates=i}}),null===(a=this._translations)||void 0===a?void 0:a.removeDuplicate)),t("div",{class:r?"":"display-none"},this._getLabel(null===(d=this._translations)||void 0===d?void 0:d.selectPDFLabelOption,!1,!this._downloadActive),t("div",{class:"padding-sides-1"},t("pdf-download",{disabled:!this._downloadActive,layerView:this.addresseeLayer,ref:i=>{this._downloadTools=i}}))),t("div",{class:"padding-1 display-flex"},t("calcite-button",{disabled:!this._downloadActive,onClick:r?()=>this._downloadPDF():()=>this._downloadCSV(),width:"full"},r?null===(o=this._translations)||void 0===o?void 0:o.downloadPDF:null===(c=this._translations)||void 0===c?void 0:c.downloadCSV))))}_getPageNavButtons(i,e,s,l,a,d){return t("div",null,t("div",{class:"display-flex padding-top-sides-1"},t("calcite-button",{disabled:e,onClick:s,width:"full"},i)),t("div",{class:"display-flex padding-top-1-2 padding-sides-1"},t("calcite-button",{appearance:"outline",disabled:a,onClick:d,width:"full"},l)))}_getNotice(i,e="padding-1"){return t("calcite-notice",{active:!0,class:e,color:"green",icon:"lightbulb"},t("div",{slot:"message"},i))}_getLabel(i,e=!1,s=!1){return t("div",{class:"padding-top-sides-1"},t("calcite-label",{class:"font-bold","disable-spacing":e,disabled:s},i))}_getSelectionLists(){return this._selectionSets.reduce(((i,e)=>(e.workflowType!==d.REFINE&&(!this._downloadActive&&e.download&&(this._downloadActive=!0),i.push(t("div",{class:"display-flex padding-sides-1 padding-bottom-1"},t("calcite-checkbox",{checked:e.download,onClick:()=>{this._toggleDownload(e.id)}}),t("calcite-list",{class:"list-border margin-start-1-2 w-100",id:"download-list"},t("calcite-list-item",{description:this._translations.selectedFeatures.replace("{{n}}",e.selectedIds.length.toString()),disabled:!e.download,label:e.label,onClick:()=>{this._toggleDownload(e.id)}}))))),i)),[])||t("div",null)}async _toggleDownload(i){let t=!1;this._selectionSets=this._selectionSets.map((e=>(e.download=e.id===i?!e.download:e.download,t=!!e.download||t,e))),this._downloadActive=t,await this._highlightFeatures()}_downloadPDF(){const i=u(this._getDownloadSelectionSets());return this._downloadTools.downloadPDF(i,this._removeDuplicates.checked)}_downloadCSV(){const i=u(this._getDownloadSelectionSets());return this._downloadTools.downloadCSV(i,this._removeDuplicates.checked)}_getDownloadSelectionSets(){return this._selectionSets.filter((i=>i.download||i.workflowType===d.REFINE))}_updateForWorkflowType(i){this._selectionWorkflowType=i.detail}_getAction(i,e,s,l,a=!1,d=""){return t("calcite-action",{disabled:!i,icon:e,indicator:a,onClick:l,slot:d,text:s})}_updateForSelection(i){this._numSelected=i.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType(a.LIST)}async _layerSelectionChange(i){var t,e;const s=(null===(t=null==i?void 0:i.detail)||void 0===t?void 0:t.length)>0?i.detail[0]:"";s!==(null===(e=this.addresseeLayer)||void 0===e?void 0:e.layer.title)&&(this.addresseeLayer=await c(this.mapView,s),await this._updateSelectionSets(this.addresseeLayer))}async _updateSelectionSets(i){const t=this._selectionSets.filter((i=>i.workflowType!==d.REFINE)),e=[];return t.forEach((t=>{t.layerView=i,t.selectedIds=[],e.push(r(t,this._geometryEngine))})),Promise.all(e).then((async i=>{i.forEach(((i,e)=>{t[e].selectedIds=i})),await this._highlightFeatures(),this._selectionSets=[...t]}))}async _saveSelection(){var i,t;const e=await(null===(i=this._selectTools)||void 0===i?void 0:i.getSelection()),s=null===(t=this._selectTools)||void 0===t?void 0:t.isUpdate;return this._selectionSets=s?this._selectionSets.map((i=>i.id===e.id?e:i)):[...this._selectionSets,e],this._home()}async _clearSelection(){var i;await(null===(i=this._selectTools)||void 0===i?void 0:i.clearSelection()),this._numSelected=0,this._activeSelection=void 0}_deleteSelection(i,t){return t.stopPropagation(),this._selectionSets=this._selectionSets.filter(((t,e)=>{if(e!==i)return t})),this._highlightFeatures()}_openSelection(i,t){t.stopPropagation(),this._activeSelection=i,this._pageType=a.SELECT}async _highlightFeatures(){this._clearHighlight();const i=u(this._selectionSets);i.length>0&&(p.highlightHandle=await h(i,this.addresseeLayer,this.mapView))}_clearHighlight(){var i;null===(i=p.highlightHandle)||void 0===i||i.remove()}async _getTranslations(){const i=await g(this.el);this._translations=i[0]}get el(){return s(this)}static get watchers(){return{_selectionSets:["selectionSetsWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};b.style=':host{display:block}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-3{width:33.3%}.w-1-4{width:25%}.action-center{-webkit-box-align:center;-webkit-align-items:center;-ms-grid-row-align:center;align-items:center;align-content:center;justify-content:center}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{-webkit-padding-before:1rem;padding-block-start:1rem;-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-sides-1{-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-end-1-2{-webkit-padding-end:.5rem;padding-inline-end:.5rem}.padding-top-1-2{-webkit-padding-before:.5rem;padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.main-label{float:left}html[dir="rtl"] .main-label{float:right}.back-label:hover{cursor:pointer;color:var(--calcite-ui-brand-hover)}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.margin-side-1{-webkit-margin-start:1rem;margin-inline-start:1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.border-top{border-top:1px solid var(--calcite-ui-border-2)}.w-100{width:100%}.w-50{width:50%}.padding-1-2{padding:0.5rem}.list-border{border:1px solid var(--calcite-ui-border-2)}.margin-sides-1{-webkit-margin-start:1rem;margin-inline-start:1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.margin-start-1-2{-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}.position-right{position:absolute;right:1rem}.position-right[dir="rtl"]{position:absolute;left:1rem}.position-left{position:absolute;left:1rem}.position-left[dir="rtl"]{position:absolute;right:1rem}.margin-top-0{-webkit-margin-before:0 !important;margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-ui-foreground-2)}';export{b as public_notification}
|