@mattilsynet/design 2.2.23 → 2.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mtds/alert/alert.js +9 -8
- package/mtds/alert/alert.js.map +1 -1
- package/mtds/analytics/analytics.d.ts +1 -1
- package/mtds/analytics/analytics.js +163 -101
- package/mtds/analytics/analytics.js.map +1 -1
- package/mtds/app/app-observer.js +73 -27
- package/mtds/app/app-observer.js.map +1 -1
- package/mtds/app/app-toggle.js +2 -24
- package/mtds/app/app-toggle.js.map +1 -1
- package/mtds/app/app-toggle2.js +16 -10
- package/mtds/app/app-toggle2.js.map +1 -1
- package/mtds/app/app.d.ts +5 -5
- package/mtds/app/app.js +36 -32
- package/mtds/app/app.js.map +1 -1
- package/mtds/atlas/atlas-element.d.ts +8 -14
- package/mtds/atlas/atlas-element.js +90 -76
- package/mtds/atlas/atlas-element.js.map +1 -1
- package/mtds/atlas/atlas-marker.d.ts +20 -0
- package/mtds/atlas/atlas-marker.js +69 -0
- package/mtds/atlas/atlas-marker.js.map +1 -0
- package/mtds/atlas/atlas-matgeo.d.ts +29 -0
- package/mtds/atlas/atlas-matgeo.js +71 -0
- package/mtds/atlas/atlas-matgeo.js.map +1 -0
- package/mtds/atlas/atlas.css.js +76 -96
- package/mtds/atlas/atlas.css.js.map +1 -1
- package/mtds/atlas/atlas.d.ts +42 -0
- package/mtds/atlas/atlas.js +33 -0
- package/mtds/atlas/atlas.js.map +1 -0
- package/mtds/atlas/atlas.stories.d.ts +5 -1
- package/mtds/atlas/cluster.js +1576 -697
- package/mtds/atlas/cluster.js.map +1 -1
- package/mtds/atlas.iife.js +80 -100
- package/mtds/atlas.js +8 -4
- package/mtds/atlas.js.map +1 -1
- package/mtds/avatar/avatar.js +8 -8
- package/mtds/avatar/avatar.js.map +1 -1
- package/mtds/badge/badge.d.ts +2 -2
- package/mtds/badge/badge.js +7 -7
- package/mtds/badge/badge.js.map +1 -1
- package/mtds/breadcrumbs/breadcrumbs-observer.js +10 -9
- package/mtds/breadcrumbs/breadcrumbs-observer.js.map +1 -1
- package/mtds/breadcrumbs/breadcrumbs.js +14 -13
- package/mtds/breadcrumbs/breadcrumbs.js.map +1 -1
- package/mtds/button/button.js +16 -14
- package/mtds/button/button.js.map +1 -1
- package/mtds/card/card.js +14 -12
- package/mtds/card/card.js.map +1 -1
- package/mtds/chart/chart-axis.js +27 -15
- package/mtds/chart/chart-axis.js.map +1 -1
- package/mtds/chart/chart-bars.js +15 -13
- package/mtds/chart/chart-bars.js.map +1 -1
- package/mtds/chart/chart-element.d.ts +5 -0
- package/mtds/chart/chart-element.js +83 -48
- package/mtds/chart/chart-element.js.map +1 -1
- package/mtds/chart/chart-lines.js +54 -32
- package/mtds/chart/chart-lines.js.map +1 -1
- package/mtds/chart/chart-pies.js +34 -14
- package/mtds/chart/chart-pies.js.map +1 -1
- package/mtds/chart/chart.css.js +2 -2
- package/mtds/chart/chart.css.js.map +1 -1
- package/mtds/chart/chart.d.ts +3 -4
- package/mtds/chart/chart.js +12 -12
- package/mtds/chart/chart.js.map +1 -1
- package/mtds/chip/chip.js +8 -8
- package/mtds/chip/chip.js.map +1 -1
- package/mtds/details/details.d.ts +3 -3
- package/mtds/details/details.js +14 -12
- package/mtds/details/details.js.map +1 -1
- package/mtds/dialog/dialog-observer.js +35 -22
- package/mtds/dialog/dialog-observer.js.map +1 -1
- package/mtds/dialog/dialog.d.ts +2 -2
- package/mtds/dialog/dialog.js +12 -12
- package/mtds/dialog/dialog.js.map +1 -1
- package/mtds/divider/divider.d.ts +2 -2
- package/mtds/divider/divider.js +10 -10
- package/mtds/divider/divider.js.map +1 -1
- package/mtds/errorsummary/errorsummary-observer.js +11 -8
- package/mtds/errorsummary/errorsummary-observer.js.map +1 -1
- package/mtds/errorsummary/errorsummary.d.ts +1 -1
- package/mtds/errorsummary/errorsummary.js +11 -11
- package/mtds/errorsummary/errorsummary.js.map +1 -1
- package/mtds/external/leaflet/dist/leaflet-src.js +6006 -3098
- package/mtds/external/leaflet/dist/leaflet-src.js.map +1 -1
- package/mtds/external/leaflet/dist/leaflet.css.js +2 -2
- package/mtds/external/leaflet/dist/leaflet.css.js.map +1 -1
- package/mtds/field/field-observer.js +114 -62
- package/mtds/field/field-observer.js.map +1 -1
- package/mtds/field/field.d.ts +6 -6
- package/mtds/field/field.js +166 -133
- package/mtds/field/field.js.map +1 -1
- package/mtds/field/field.stories.d.ts +2 -0
- package/mtds/fieldset/fieldset-observer.js +24 -14
- package/mtds/fieldset/fieldset-observer.js.map +1 -1
- package/mtds/fieldset/fieldset.d.ts +1 -1
- package/mtds/fieldset/fieldset.js +11 -11
- package/mtds/fieldset/fieldset.js.map +1 -1
- package/mtds/fileupload/fileupload.js +9 -8
- package/mtds/fileupload/fileupload.js.map +1 -1
- package/mtds/helptext/helptext.d.ts +1 -1
- package/mtds/helptext/helptext.js +15 -15
- package/mtds/helptext/helptext.js.map +1 -1
- package/mtds/index.iife.js +9 -9
- package/mtds/index.js +26 -24
- package/mtds/input/input.d.ts +3 -3
- package/mtds/input/input.js +22 -20
- package/mtds/input/input.js.map +1 -1
- package/mtds/law/law-helper.d.ts +6 -2
- package/mtds/law/law-helper.js +145 -63
- package/mtds/law/law-helper.js.map +1 -1
- package/mtds/law/law.d.ts +6 -2
- package/mtds/law/law.js +6 -6
- package/mtds/law/law.js.map +1 -1
- package/mtds/law/law.stories.d.ts +1 -0
- package/mtds/layout/layout.js +13 -10
- package/mtds/layout/layout.js.map +1 -1
- package/mtds/link/link.js +8 -7
- package/mtds/link/link.js.map +1 -1
- package/mtds/logo/logo-observer.js +18 -12
- package/mtds/logo/logo-observer.js.map +1 -1
- package/mtds/logo/logo.js +8 -8
- package/mtds/logo/logo.js.map +1 -1
- package/mtds/package.json.js +2 -2
- package/mtds/pagination/pagination-helper.js +17 -11
- package/mtds/pagination/pagination-helper.js.map +1 -1
- package/mtds/pagination/pagination.d.ts +1 -1
- package/mtds/pagination/pagination.js +30 -30
- package/mtds/pagination/pagination.js.map +1 -1
- package/mtds/popover/popover-observer.js +37 -28
- package/mtds/popover/popover-observer.js.map +1 -1
- package/mtds/popover/popover.js +13 -11
- package/mtds/popover/popover.js.map +1 -1
- package/mtds/progress/progress.d.ts +1 -1
- package/mtds/progress/progress.js +8 -8
- package/mtds/progress/progress.js.map +1 -1
- package/mtds/react-atlas.d.ts +1 -0
- package/mtds/react-atlas.js +13 -0
- package/mtds/react-atlas.js.map +1 -0
- package/mtds/react-types.d.ts +3 -0
- package/mtds/react.js +79 -79
- package/mtds/skeleton/skeleton.js +8 -8
- package/mtds/skeleton/skeleton.js.map +1 -1
- package/mtds/spinner/spinner.d.ts +2 -2
- package/mtds/spinner/spinner.js +8 -8
- package/mtds/spinner/spinner.js.map +1 -1
- package/mtds/steps/steps.d.ts +2 -2
- package/mtds/steps/steps.js +7 -7
- package/mtds/steps/steps.js.map +1 -1
- package/mtds/styles.css +4586 -1
- package/mtds/styles.module.css.js +167 -112
- package/mtds/styles.module.css.js.map +1 -1
- package/mtds/table/table-observer.js +22 -19
- package/mtds/table/table-observer.js.map +1 -1
- package/mtds/table/table.d.ts +4 -4
- package/mtds/table/table.js +18 -16
- package/mtds/table/table.js.map +1 -1
- package/mtds/tabs/tabs.d.ts +4 -4
- package/mtds/tabs/tabs.js +25 -21
- package/mtds/tabs/tabs.js.map +1 -1
- package/mtds/tag/tag.js +8 -8
- package/mtds/tag/tag.js.map +1 -1
- package/mtds/tailwind.css +24 -6
- package/mtds/toast/toast-helper.js +35 -20
- package/mtds/toast/toast-helper.js.map +1 -1
- package/mtds/toast/toast-observer.js +30 -15
- package/mtds/toast/toast-observer.js.map +1 -1
- package/mtds/toast/toast.js +45 -37
- package/mtds/toast/toast.js.map +1 -1
- package/mtds/togglegroup/togglegroup-observer.js +15 -10
- package/mtds/togglegroup/togglegroup-observer.js.map +1 -1
- package/mtds/togglegroup/togglegroup.d.ts +3 -3
- package/mtds/togglegroup/togglegroup.js +20 -18
- package/mtds/togglegroup/togglegroup.js.map +1 -1
- package/mtds/tooltip/tooltip-observer.js +48 -32
- package/mtds/tooltip/tooltip-observer.js.map +1 -1
- package/mtds/typography/typography.js +28 -19
- package/mtds/typography/typography.js.map +1 -1
- package/mtds/utils.d.ts +12 -3
- package/mtds/utils.js +133 -81
- package/mtds/utils.js.map +1 -1
- package/mtds/validation/validation.d.ts +1 -1
- package/mtds/validation/validation.js +12 -12
- package/mtds/validation/validation.js.map +1 -1
- package/package.json +14 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const LeafletCSS = `/* required styles */
|
|
2
2
|
|
|
3
3
|
.leaflet-pane,
|
|
4
4
|
.leaflet-tile,
|
|
@@ -602,6 +602,6 @@ path.leaflet-interactive:focus:not(:focus-visible) {
|
|
|
602
602
|
}
|
|
603
603
|
`;
|
|
604
604
|
export {
|
|
605
|
-
|
|
605
|
+
LeafletCSS as default
|
|
606
606
|
};
|
|
607
607
|
//# sourceMappingURL=leaflet.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leaflet.css.js","sources":["../../../../node_modules/leaflet/dist/leaflet.css?raw"],"sourcesContent":["export default \"/* required styles */\\n\\n.leaflet-pane,\\n.leaflet-tile,\\n.leaflet-marker-icon,\\n.leaflet-marker-shadow,\\n.leaflet-tile-container,\\n.leaflet-pane > svg,\\n.leaflet-pane > canvas,\\n.leaflet-zoom-box,\\n.leaflet-image-layer,\\n.leaflet-layer {\\n\\tposition: absolute;\\n\\tleft: 0;\\n\\ttop: 0;\\n\\twidth:100%;\\n\\t}\\n.leaflet-container {\\n\\toverflow: hidden;\\n\\t}\\n.leaflet-tile,\\n.leaflet-marker-icon,\\n.leaflet-marker-shadow {\\n\\tuser-select: none;\\n\\t-webkit-user-drag: none;\\n\\t}\\n/* Safari renders non-retina tile on retina better with this, but Chrome is worse */\\n.leaflet-safari .leaflet-tile {\\n\\timage-rendering: -webkit-optimize-contrast;\\n\\t}\\n/* hack that prevents hw layers \\\"stretching\\\" when loading new tiles */\\n.leaflet-safari .leaflet-tile-container {\\n\\twidth: 1600px;\\n\\theight: 1600px;\\n\\t-webkit-transform-origin: 0 0;\\n\\t}\\n.leaflet-marker-icon,\\n.leaflet-marker-shadow {\\n\\tdisplay: block;\\n\\t}\\n/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */\\n/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */\\n.leaflet-container .leaflet-overlay-pane svg {\\n\\tmax-width: none !important;\\n\\tmax-height: none !important;\\n\\t}\\n.leaflet-container .leaflet-marker-pane img,\\n.leaflet-container .leaflet-shadow-pane img,\\n.leaflet-container .leaflet-tile-pane img,\\n.leaflet-container img.leaflet-image-layer,\\n.leaflet-container .leaflet-tile {\\n\\tmax-width: none !important;\\n\\tmax-height: none !important;\\n\\twidth: auto;\\n\\tpadding: 0;\\n\\t}\\n.leaflet-container img.leaflet-tile {\\n\\t/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */\\n\\tmix-blend-mode: plus-lighter;\\n\\t}\\n\\n.leaflet-container.leaflet-touch-zoom {\\n\\ttouch-action: pan-x pan-y;\\n\\t}\\n.leaflet-container.leaflet-touch-drag {\\n\\t/* Fallback for FF which doesn't support pinch-zoom */\\n\\ttouch-action: none;\\n\\ttouch-action: pinch-zoom;\\n}\\n.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {\\n\\ttouch-action: none;\\n}\\n.leaflet-container {\\n\\t-webkit-tap-highlight-color: transparent;\\n}\\n.leaflet-container a {\\n\\t-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);\\n}\\n.leaflet-tile {\\n\\tvisibility: hidden;\\n\\t}\\n.leaflet-tile-loaded {\\n\\tvisibility: inherit;\\n\\t}\\n.leaflet-zoom-box {\\n\\twidth: 0;\\n\\theight: 0;\\n\\tbox-sizing: border-box;\\n\\tz-index: 800;\\n\\t}\\n\\n.leaflet-pane { z-index: 400; }\\n\\n.leaflet-tile-pane { z-index: 200; }\\n.leaflet-overlay-pane { z-index: 400; }\\n.leaflet-shadow-pane { z-index: 500; }\\n.leaflet-marker-pane { z-index: 600; }\\n.leaflet-tooltip-pane { z-index: 650; }\\n.leaflet-popup-pane { z-index: 700; }\\n\\n.leaflet-map-pane canvas { z-index: 100; }\\n.leaflet-map-pane svg { z-index: 200; }\\n\\n\\n/* control positioning */\\n\\n.leaflet-control {\\n\\tposition: relative;\\n\\tz-index: 800;\\n\\tpointer-events: auto;\\n\\t}\\n.leaflet-top,\\n.leaflet-bottom {\\n\\tposition: absolute;\\n\\tz-index: 1000;\\n\\tpointer-events: none;\\n\\t}\\n.leaflet-top {\\n\\ttop: 0;\\n\\t}\\n.leaflet-right {\\n\\tright: 0;\\n\\t}\\n.leaflet-bottom {\\n\\tbottom: 0;\\n\\t}\\n.leaflet-left {\\n\\tleft: 0;\\n\\t}\\n.leaflet-control {\\n\\tfloat: left;\\n\\tclear: both;\\n\\t}\\n.leaflet-right .leaflet-control {\\n\\tfloat: right;\\n\\t}\\n.leaflet-top .leaflet-control {\\n\\tmargin-top: 10px;\\n\\t}\\n.leaflet-bottom .leaflet-control {\\n\\tmargin-bottom: 10px;\\n\\t}\\n.leaflet-left .leaflet-control {\\n\\tmargin-left: 10px;\\n\\t}\\n.leaflet-right .leaflet-control {\\n\\tmargin-right: 10px;\\n\\t}\\n\\n\\n/* zoom and fade animations */\\n\\n.leaflet-fade-anim .leaflet-popup {\\n\\topacity: 0;\\n\\ttransition: opacity 0.2s linear;\\n\\t}\\n.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {\\n\\topacity: 1;\\n\\t}\\n.leaflet-zoom-animated {\\n\\ttransform-origin: 0 0;\\n\\t}\\nsvg.leaflet-zoom-animated {\\n\\twill-change: transform;\\n}\\n\\n.leaflet-zoom-anim .leaflet-zoom-animated {\\n\\ttransition: transform 0.25s cubic-bezier(0,0,0.25,1);\\n\\t}\\n.leaflet-zoom-anim .leaflet-tile,\\n.leaflet-pan-anim .leaflet-tile {\\n\\ttransition: none;\\n\\t}\\n\\n.leaflet-zoom-anim .leaflet-zoom-hide {\\n\\tvisibility: hidden;\\n\\t}\\n\\n\\n/* cursors */\\n\\n.leaflet-interactive {\\n\\tcursor: pointer;\\n\\t}\\n.leaflet-grab {\\n\\tcursor: grab;\\n\\t}\\n.leaflet-crosshair,\\n.leaflet-crosshair .leaflet-interactive {\\n\\tcursor: crosshair;\\n\\t}\\n.leaflet-popup-pane,\\n.leaflet-control {\\n\\tcursor: auto;\\n\\t}\\n.leaflet-dragging .leaflet-grab,\\n.leaflet-dragging .leaflet-grab .leaflet-interactive,\\n.leaflet-dragging .leaflet-marker-draggable {\\n\\tcursor: grabbing;\\n\\t}\\n\\n/* marker & overlays interactivity */\\n.leaflet-marker-icon,\\n.leaflet-marker-shadow,\\n.leaflet-image-layer,\\n.leaflet-pane > svg path,\\n.leaflet-tile-container {\\n\\tpointer-events: none;\\n\\t}\\n\\n.leaflet-marker-icon.leaflet-interactive,\\n.leaflet-image-layer.leaflet-interactive,\\n.leaflet-pane > svg path.leaflet-interactive,\\nsvg.leaflet-image-layer.leaflet-interactive path {\\n\\tpointer-events: auto;\\n\\t}\\n\\n/* visual tweaks */\\n\\n.leaflet-container {\\n\\tbackground: #ddd;\\n\\toutline-offset: 1px;\\n\\t}\\n.leaflet-container a {\\n\\tcolor: #0078A8;\\n\\t}\\n/* prevent showing outline-box on Chromium when clicking on a vector with a tooltip */\\npath.leaflet-interactive:focus:not(:focus-visible) {\\n\\toutline: 0;\\n\\t}\\n\\n.leaflet-zoom-box {\\n\\tborder: 2px dotted #38f;\\n\\tbackground: rgba(255,255,255,0.5);\\n\\t}\\n\\n\\n/* general typography */\\n.leaflet-container {\\n\\tfont-family: \\\"Helvetica Neue\\\", Arial, Helvetica, sans-serif;\\n\\tfont-size: 12px;\\n\\tfont-size: 0.75rem;\\n\\tline-height: 1.5;\\n\\t}\\n\\n\\n/* general toolbar styles */\\n\\n.leaflet-bar {\\n\\tbox-shadow: 0 1px 5px rgba(0,0,0,0.65);\\n\\tborder-radius: 4px;\\n\\t}\\n.leaflet-bar a {\\n\\tbackground-color: #fff;\\n\\tborder-bottom: 1px solid #ccc;\\n\\twidth: 26px;\\n\\theight: 26px;\\n\\tline-height: 26px;\\n\\tdisplay: block;\\n\\ttext-align: center;\\n\\ttext-decoration: none;\\n\\tcolor: black;\\n\\t}\\n.leaflet-bar a,\\n.leaflet-control-layers-toggle {\\n\\tbackground-position: 50% 50%;\\n\\tbackground-repeat: no-repeat;\\n\\tdisplay: block;\\n\\t}\\n.leaflet-bar a:hover,\\n.leaflet-bar a:focus {\\n\\tbackground-color: #f4f4f4;\\n\\t}\\n.leaflet-bar a:first-child {\\n\\tborder-top-left-radius: 4px;\\n\\tborder-top-right-radius: 4px;\\n\\t}\\n.leaflet-bar a:last-child {\\n\\tborder-bottom-left-radius: 4px;\\n\\tborder-bottom-right-radius: 4px;\\n\\tborder-bottom: none;\\n\\t}\\n.leaflet-bar a.leaflet-disabled {\\n\\tcursor: default;\\n\\tbackground-color: #f4f4f4;\\n\\tcolor: #bbb;\\n\\t}\\n\\n.leaflet-touch .leaflet-bar a {\\n\\twidth: 30px;\\n\\theight: 30px;\\n\\tline-height: 30px;\\n\\t}\\n.leaflet-touch .leaflet-bar a:first-child {\\n\\tborder-top-left-radius: 2px;\\n\\tborder-top-right-radius: 2px;\\n\\t}\\n.leaflet-touch .leaflet-bar a:last-child {\\n\\tborder-bottom-left-radius: 2px;\\n\\tborder-bottom-right-radius: 2px;\\n\\t}\\n\\n/* zoom control */\\n\\n.leaflet-control-zoom-in,\\n.leaflet-control-zoom-out {\\n\\tfont: bold 18px 'Lucida Console', Monaco, monospace;\\n\\ttext-indent: 1px;\\n\\t}\\n\\n.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {\\n\\tfont-size: 22px;\\n\\t}\\n\\n\\n/* layers control */\\n\\n.leaflet-control-layers {\\n\\tbox-shadow: 0 1px 5px rgba(0,0,0,0.4);\\n\\tbackground: #fff;\\n\\tborder-radius: 5px;\\n\\t}\\n.leaflet-control-layers-toggle {\\n\\tbackground-image: url(images/layers.svg);\\n\\twidth: 36px;\\n\\theight: 36px;\\n\\t}\\n.leaflet-touch .leaflet-control-layers-toggle {\\n\\twidth: 44px;\\n\\theight: 44px;\\n\\t}\\n.leaflet-control-layers .leaflet-control-layers-list,\\n.leaflet-control-layers-expanded .leaflet-control-layers-toggle {\\n\\tdisplay: none;\\n\\t}\\n.leaflet-control-layers-expanded .leaflet-control-layers-list {\\n\\tdisplay: block;\\n\\tposition: relative;\\n\\t}\\n.leaflet-control-layers-list {\\n\\tborder: 0;\\n\\tmargin: 0;\\n\\tpadding: 0;\\n\\t}\\n.leaflet-control-layers-expanded {\\n\\tpadding: 6px 10px 6px 6px;\\n\\tcolor: #333;\\n\\tbackground: #fff;\\n\\t}\\n.leaflet-control-layers-scrollbar {\\n\\toverflow-y: scroll;\\n\\toverflow-x: hidden;\\n\\tpadding-right: 5px;\\n\\t}\\n.leaflet-control-layers-selector {\\n\\tmargin-top: 2px;\\n\\tposition: relative;\\n\\ttop: 1px;\\n\\t}\\n.leaflet-control-layers label {\\n\\tdisplay: block;\\n\\tfont-size: 13px;\\n\\tfont-size: 1.08333em;\\n\\t}\\n.leaflet-control-layers-separator {\\n\\theight: 0;\\n\\tborder-top: 1px solid #ddd;\\n\\tmargin: 5px -10px 5px -6px;\\n\\t}\\n\\n/* Default icon URLs */\\n.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */\\n\\tbackground-image: url(images/marker-icon.png);\\n\\t}\\n\\n\\n/* attribution and scale controls */\\n\\n.leaflet-container .leaflet-control-attribution {\\n\\tbackground: #fff;\\n\\tbackground: rgba(255, 255, 255, 0.8);\\n\\tmargin: 0;\\n\\t}\\n.leaflet-control-attribution,\\n.leaflet-control-scale-line {\\n\\tpadding: 0 5px;\\n\\tcolor: #333;\\n\\tline-height: 1.4;\\n\\t}\\n.leaflet-control-attribution a {\\n\\ttext-decoration: none;\\n\\t}\\n.leaflet-control-attribution a:hover,\\n.leaflet-control-attribution a:focus {\\n\\ttext-decoration: underline;\\n\\t}\\n.leaflet-attribution-flag {\\n\\tdisplay: inline !important;\\n\\tvertical-align: baseline !important;\\n\\twidth: 1em;\\n\\theight: 0.6669em;\\n\\tmargin-right: 0.277em;\\n\\t}\\n.leaflet-left .leaflet-control-scale {\\n\\tmargin-left: 5px;\\n\\t}\\n.leaflet-bottom .leaflet-control-scale {\\n\\tmargin-bottom: 5px;\\n\\t}\\n.leaflet-control-scale-line {\\n\\tborder: 2px solid #777;\\n\\tborder-top: none;\\n\\tline-height: 1.1;\\n\\tpadding: 2px 5px 1px;\\n\\twhite-space: nowrap;\\n\\tbox-sizing: border-box;\\n\\tbackground: rgba(255, 255, 255, 0.8);\\n\\ttext-shadow: 1px 1px #fff;\\n\\t}\\n.leaflet-control-scale-line:not(:first-child) {\\n\\tborder-top: 2px solid #777;\\n\\tborder-bottom: none;\\n\\tmargin-top: -2px;\\n\\t}\\n.leaflet-control-scale-line:not(:first-child):not(:last-child) {\\n\\tborder-bottom: 2px solid #777;\\n\\t}\\n\\n.leaflet-touch .leaflet-control-attribution,\\n.leaflet-touch .leaflet-control-layers,\\n.leaflet-touch .leaflet-bar {\\n\\tbox-shadow: none;\\n\\t}\\n.leaflet-touch .leaflet-control-layers,\\n.leaflet-touch .leaflet-bar {\\n\\tborder: 2px solid rgba(0,0,0,0.2);\\n\\tbackground-clip: padding-box;\\n\\t}\\n\\n\\n/* popup */\\n\\n.leaflet-popup {\\n\\tposition: absolute;\\n\\ttext-align: center;\\n\\tmargin-bottom: 20px;\\n\\t}\\n.leaflet-popup-content-wrapper {\\n\\tpadding: 1px;\\n\\ttext-align: left;\\n\\tborder-radius: 12px;\\n\\t}\\n.leaflet-popup-content {\\n\\tmargin: 13px 24px 13px 20px;\\n\\tline-height: 1.3;\\n\\tfont-size: 13px;\\n\\tfont-size: 1.08333em;\\n\\tmin-height: 1px;\\n\\t}\\n.leaflet-popup-content p {\\n\\tmargin: 17px 0;\\n\\tmargin: 1.3em 0;\\n\\t}\\n.leaflet-popup-tip-container {\\n\\twidth: 40px;\\n\\theight: 20px;\\n\\tposition: absolute;\\n\\tleft: 50%;\\n\\tmargin-top: -1px;\\n\\tmargin-left: -20px;\\n\\toverflow: hidden;\\n\\tpointer-events: none;\\n\\t}\\n.leaflet-popup-tip {\\n\\twidth: 17px;\\n\\theight: 17px;\\n\\tpadding: 1px;\\n\\n\\tmargin: -10px auto 0;\\n\\tpointer-events: auto;\\n\\n\\ttransform: rotate(45deg);\\n\\t}\\n.leaflet-popup-content-wrapper,\\n.leaflet-popup-tip {\\n\\tbackground: white;\\n\\tcolor: #333;\\n\\tbox-shadow: 0 3px 14px rgba(0,0,0,0.4);\\n\\t}\\n.leaflet-container a.leaflet-popup-close-button {\\n\\tposition: absolute;\\n\\ttop: 0;\\n\\tright: 0;\\n\\tborder: none;\\n\\ttext-align: center;\\n\\twidth: 24px;\\n\\theight: 24px;\\n\\tfont: 16px/24px Tahoma, Verdana, sans-serif;\\n\\tcolor: #757575;\\n\\ttext-decoration: none;\\n\\tbackground: transparent;\\n\\t}\\n.leaflet-container a.leaflet-popup-close-button:hover,\\n.leaflet-container a.leaflet-popup-close-button:focus {\\n\\tcolor: #585858;\\n\\t}\\n.leaflet-popup-scrolled {\\n\\toverflow: auto;\\n\\t}\\n\\n/* div icon */\\n\\n.leaflet-div-icon {\\n\\tbackground: #fff;\\n\\tborder: 1px solid #666;\\n\\t}\\n\\n\\n/* Tooltip */\\n/* Base styles for the element that has a tooltip */\\n.leaflet-tooltip {\\n\\tposition: absolute;\\n\\tpadding: 6px;\\n\\tbackground-color: #fff;\\n\\tborder: 1px solid #fff;\\n\\tborder-radius: 3px;\\n\\tcolor: #222;\\n\\twhite-space: nowrap;\\n\\tuser-select: none;\\n\\tpointer-events: none;\\n\\tbox-shadow: 0 1px 3px rgba(0,0,0,0.4);\\n\\t}\\n.leaflet-tooltip.leaflet-interactive {\\n\\tcursor: pointer;\\n\\tpointer-events: auto;\\n\\t}\\n.leaflet-tooltip-top:before,\\n.leaflet-tooltip-bottom:before,\\n.leaflet-tooltip-left:before,\\n.leaflet-tooltip-right:before {\\n\\tposition: absolute;\\n\\tpointer-events: none;\\n\\tborder: 6px solid transparent;\\n\\tbackground: transparent;\\n\\tcontent: \\\"\\\";\\n\\t}\\n\\n/* Directions */\\n\\n.leaflet-tooltip-bottom {\\n\\tmargin-top: 6px;\\n}\\n.leaflet-tooltip-top {\\n\\tmargin-top: -6px;\\n}\\n.leaflet-tooltip-bottom:before,\\n.leaflet-tooltip-top:before {\\n\\tleft: 50%;\\n\\tmargin-left: -6px;\\n\\t}\\n.leaflet-tooltip-top:before {\\n\\tbottom: 0;\\n\\tmargin-bottom: -12px;\\n\\tborder-top-color: #fff;\\n\\t}\\n.leaflet-tooltip-bottom:before {\\n\\ttop: 0;\\n\\tmargin-top: -12px;\\n\\tmargin-left: -6px;\\n\\tborder-bottom-color: #fff;\\n\\t}\\n.leaflet-tooltip-left {\\n\\tmargin-left: -6px;\\n}\\n.leaflet-tooltip-right {\\n\\tmargin-left: 6px;\\n}\\n.leaflet-tooltip-left:before,\\n.leaflet-tooltip-right:before {\\n\\ttop: 50%;\\n\\tmargin-top: -6px;\\n\\t}\\n.leaflet-tooltip-left:before {\\n\\tright: 0;\\n\\tmargin-right: -12px;\\n\\tborder-left-color: #fff;\\n\\t}\\n.leaflet-tooltip-right:before {\\n\\tleft: 0;\\n\\tmargin-left: -12px;\\n\\tborder-right-color: #fff;\\n\\t}\\n\\n/* Printing */\\n\\n@media print {\\n\\t/* Prevent printers from removing background-images of controls. */\\n\\t.leaflet-control {\\n\\t\\t-webkit-print-color-adjust: exact;\\n\\t\\tprint-color-adjust: exact;\\n\\t}\\n}\\n\""],"names":["LeafletCSS"],"mappings":"AAAA,MAAAA,IAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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AA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"leaflet.css.js","sources":["../../../../node_modules/leaflet/dist/leaflet.css?raw"],"sourcesContent":["export default \"/* required styles */\\n\\n.leaflet-pane,\\n.leaflet-tile,\\n.leaflet-marker-icon,\\n.leaflet-marker-shadow,\\n.leaflet-tile-container,\\n.leaflet-pane > svg,\\n.leaflet-pane > canvas,\\n.leaflet-zoom-box,\\n.leaflet-image-layer,\\n.leaflet-layer {\\n\\tposition: absolute;\\n\\tleft: 0;\\n\\ttop: 0;\\n\\twidth:100%;\\n\\t}\\n.leaflet-container {\\n\\toverflow: hidden;\\n\\t}\\n.leaflet-tile,\\n.leaflet-marker-icon,\\n.leaflet-marker-shadow {\\n\\tuser-select: none;\\n\\t-webkit-user-drag: none;\\n\\t}\\n/* Safari renders non-retina tile on retina better with this, but Chrome is worse */\\n.leaflet-safari .leaflet-tile {\\n\\timage-rendering: -webkit-optimize-contrast;\\n\\t}\\n/* hack that prevents hw layers \\\"stretching\\\" when loading new tiles */\\n.leaflet-safari .leaflet-tile-container {\\n\\twidth: 1600px;\\n\\theight: 1600px;\\n\\t-webkit-transform-origin: 0 0;\\n\\t}\\n.leaflet-marker-icon,\\n.leaflet-marker-shadow {\\n\\tdisplay: block;\\n\\t}\\n/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */\\n/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */\\n.leaflet-container .leaflet-overlay-pane svg {\\n\\tmax-width: none !important;\\n\\tmax-height: none !important;\\n\\t}\\n.leaflet-container .leaflet-marker-pane img,\\n.leaflet-container .leaflet-shadow-pane img,\\n.leaflet-container .leaflet-tile-pane img,\\n.leaflet-container img.leaflet-image-layer,\\n.leaflet-container .leaflet-tile {\\n\\tmax-width: none !important;\\n\\tmax-height: none !important;\\n\\twidth: auto;\\n\\tpadding: 0;\\n\\t}\\n.leaflet-container img.leaflet-tile {\\n\\t/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */\\n\\tmix-blend-mode: plus-lighter;\\n\\t}\\n\\n.leaflet-container.leaflet-touch-zoom {\\n\\ttouch-action: pan-x pan-y;\\n\\t}\\n.leaflet-container.leaflet-touch-drag {\\n\\t/* Fallback for FF which doesn't support pinch-zoom */\\n\\ttouch-action: none;\\n\\ttouch-action: pinch-zoom;\\n}\\n.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {\\n\\ttouch-action: none;\\n}\\n.leaflet-container {\\n\\t-webkit-tap-highlight-color: transparent;\\n}\\n.leaflet-container a {\\n\\t-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);\\n}\\n.leaflet-tile {\\n\\tvisibility: hidden;\\n\\t}\\n.leaflet-tile-loaded {\\n\\tvisibility: inherit;\\n\\t}\\n.leaflet-zoom-box {\\n\\twidth: 0;\\n\\theight: 0;\\n\\tbox-sizing: border-box;\\n\\tz-index: 800;\\n\\t}\\n\\n.leaflet-pane { z-index: 400; }\\n\\n.leaflet-tile-pane { z-index: 200; }\\n.leaflet-overlay-pane { z-index: 400; }\\n.leaflet-shadow-pane { z-index: 500; }\\n.leaflet-marker-pane { z-index: 600; }\\n.leaflet-tooltip-pane { z-index: 650; }\\n.leaflet-popup-pane { z-index: 700; }\\n\\n.leaflet-map-pane canvas { z-index: 100; }\\n.leaflet-map-pane svg { z-index: 200; }\\n\\n\\n/* control positioning */\\n\\n.leaflet-control {\\n\\tposition: relative;\\n\\tz-index: 800;\\n\\tpointer-events: auto;\\n\\t}\\n.leaflet-top,\\n.leaflet-bottom {\\n\\tposition: absolute;\\n\\tz-index: 1000;\\n\\tpointer-events: none;\\n\\t}\\n.leaflet-top {\\n\\ttop: 0;\\n\\t}\\n.leaflet-right {\\n\\tright: 0;\\n\\t}\\n.leaflet-bottom {\\n\\tbottom: 0;\\n\\t}\\n.leaflet-left {\\n\\tleft: 0;\\n\\t}\\n.leaflet-control {\\n\\tfloat: left;\\n\\tclear: both;\\n\\t}\\n.leaflet-right .leaflet-control {\\n\\tfloat: right;\\n\\t}\\n.leaflet-top .leaflet-control {\\n\\tmargin-top: 10px;\\n\\t}\\n.leaflet-bottom .leaflet-control {\\n\\tmargin-bottom: 10px;\\n\\t}\\n.leaflet-left .leaflet-control {\\n\\tmargin-left: 10px;\\n\\t}\\n.leaflet-right .leaflet-control {\\n\\tmargin-right: 10px;\\n\\t}\\n\\n\\n/* zoom and fade animations */\\n\\n.leaflet-fade-anim .leaflet-popup {\\n\\topacity: 0;\\n\\ttransition: opacity 0.2s linear;\\n\\t}\\n.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {\\n\\topacity: 1;\\n\\t}\\n.leaflet-zoom-animated {\\n\\ttransform-origin: 0 0;\\n\\t}\\nsvg.leaflet-zoom-animated {\\n\\twill-change: transform;\\n}\\n\\n.leaflet-zoom-anim .leaflet-zoom-animated {\\n\\ttransition: transform 0.25s cubic-bezier(0,0,0.25,1);\\n\\t}\\n.leaflet-zoom-anim .leaflet-tile,\\n.leaflet-pan-anim .leaflet-tile {\\n\\ttransition: none;\\n\\t}\\n\\n.leaflet-zoom-anim .leaflet-zoom-hide {\\n\\tvisibility: hidden;\\n\\t}\\n\\n\\n/* cursors */\\n\\n.leaflet-interactive {\\n\\tcursor: pointer;\\n\\t}\\n.leaflet-grab {\\n\\tcursor: grab;\\n\\t}\\n.leaflet-crosshair,\\n.leaflet-crosshair .leaflet-interactive {\\n\\tcursor: crosshair;\\n\\t}\\n.leaflet-popup-pane,\\n.leaflet-control {\\n\\tcursor: auto;\\n\\t}\\n.leaflet-dragging .leaflet-grab,\\n.leaflet-dragging .leaflet-grab .leaflet-interactive,\\n.leaflet-dragging .leaflet-marker-draggable {\\n\\tcursor: grabbing;\\n\\t}\\n\\n/* marker & overlays interactivity */\\n.leaflet-marker-icon,\\n.leaflet-marker-shadow,\\n.leaflet-image-layer,\\n.leaflet-pane > svg path,\\n.leaflet-tile-container {\\n\\tpointer-events: none;\\n\\t}\\n\\n.leaflet-marker-icon.leaflet-interactive,\\n.leaflet-image-layer.leaflet-interactive,\\n.leaflet-pane > svg path.leaflet-interactive,\\nsvg.leaflet-image-layer.leaflet-interactive path {\\n\\tpointer-events: auto;\\n\\t}\\n\\n/* visual tweaks */\\n\\n.leaflet-container {\\n\\tbackground: #ddd;\\n\\toutline-offset: 1px;\\n\\t}\\n.leaflet-container a {\\n\\tcolor: #0078A8;\\n\\t}\\n/* prevent showing outline-box on Chromium when clicking on a vector with a tooltip */\\npath.leaflet-interactive:focus:not(:focus-visible) {\\n\\toutline: 0;\\n\\t}\\n\\n.leaflet-zoom-box {\\n\\tborder: 2px dotted #38f;\\n\\tbackground: rgba(255,255,255,0.5);\\n\\t}\\n\\n\\n/* general typography */\\n.leaflet-container {\\n\\tfont-family: \\\"Helvetica Neue\\\", Arial, Helvetica, sans-serif;\\n\\tfont-size: 12px;\\n\\tfont-size: 0.75rem;\\n\\tline-height: 1.5;\\n\\t}\\n\\n\\n/* general toolbar styles */\\n\\n.leaflet-bar {\\n\\tbox-shadow: 0 1px 5px rgba(0,0,0,0.65);\\n\\tborder-radius: 4px;\\n\\t}\\n.leaflet-bar a {\\n\\tbackground-color: #fff;\\n\\tborder-bottom: 1px solid #ccc;\\n\\twidth: 26px;\\n\\theight: 26px;\\n\\tline-height: 26px;\\n\\tdisplay: block;\\n\\ttext-align: center;\\n\\ttext-decoration: none;\\n\\tcolor: black;\\n\\t}\\n.leaflet-bar a,\\n.leaflet-control-layers-toggle {\\n\\tbackground-position: 50% 50%;\\n\\tbackground-repeat: no-repeat;\\n\\tdisplay: block;\\n\\t}\\n.leaflet-bar a:hover,\\n.leaflet-bar a:focus {\\n\\tbackground-color: #f4f4f4;\\n\\t}\\n.leaflet-bar a:first-child {\\n\\tborder-top-left-radius: 4px;\\n\\tborder-top-right-radius: 4px;\\n\\t}\\n.leaflet-bar a:last-child {\\n\\tborder-bottom-left-radius: 4px;\\n\\tborder-bottom-right-radius: 4px;\\n\\tborder-bottom: none;\\n\\t}\\n.leaflet-bar a.leaflet-disabled {\\n\\tcursor: default;\\n\\tbackground-color: #f4f4f4;\\n\\tcolor: #bbb;\\n\\t}\\n\\n.leaflet-touch .leaflet-bar a {\\n\\twidth: 30px;\\n\\theight: 30px;\\n\\tline-height: 30px;\\n\\t}\\n.leaflet-touch .leaflet-bar a:first-child {\\n\\tborder-top-left-radius: 2px;\\n\\tborder-top-right-radius: 2px;\\n\\t}\\n.leaflet-touch .leaflet-bar a:last-child {\\n\\tborder-bottom-left-radius: 2px;\\n\\tborder-bottom-right-radius: 2px;\\n\\t}\\n\\n/* zoom control */\\n\\n.leaflet-control-zoom-in,\\n.leaflet-control-zoom-out {\\n\\tfont: bold 18px 'Lucida Console', Monaco, monospace;\\n\\ttext-indent: 1px;\\n\\t}\\n\\n.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {\\n\\tfont-size: 22px;\\n\\t}\\n\\n\\n/* layers control */\\n\\n.leaflet-control-layers {\\n\\tbox-shadow: 0 1px 5px rgba(0,0,0,0.4);\\n\\tbackground: #fff;\\n\\tborder-radius: 5px;\\n\\t}\\n.leaflet-control-layers-toggle {\\n\\tbackground-image: url(images/layers.svg);\\n\\twidth: 36px;\\n\\theight: 36px;\\n\\t}\\n.leaflet-touch .leaflet-control-layers-toggle {\\n\\twidth: 44px;\\n\\theight: 44px;\\n\\t}\\n.leaflet-control-layers .leaflet-control-layers-list,\\n.leaflet-control-layers-expanded .leaflet-control-layers-toggle {\\n\\tdisplay: none;\\n\\t}\\n.leaflet-control-layers-expanded .leaflet-control-layers-list {\\n\\tdisplay: block;\\n\\tposition: relative;\\n\\t}\\n.leaflet-control-layers-list {\\n\\tborder: 0;\\n\\tmargin: 0;\\n\\tpadding: 0;\\n\\t}\\n.leaflet-control-layers-expanded {\\n\\tpadding: 6px 10px 6px 6px;\\n\\tcolor: #333;\\n\\tbackground: #fff;\\n\\t}\\n.leaflet-control-layers-scrollbar {\\n\\toverflow-y: scroll;\\n\\toverflow-x: hidden;\\n\\tpadding-right: 5px;\\n\\t}\\n.leaflet-control-layers-selector {\\n\\tmargin-top: 2px;\\n\\tposition: relative;\\n\\ttop: 1px;\\n\\t}\\n.leaflet-control-layers label {\\n\\tdisplay: block;\\n\\tfont-size: 13px;\\n\\tfont-size: 1.08333em;\\n\\t}\\n.leaflet-control-layers-separator {\\n\\theight: 0;\\n\\tborder-top: 1px solid #ddd;\\n\\tmargin: 5px -10px 5px -6px;\\n\\t}\\n\\n/* Default icon URLs */\\n.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */\\n\\tbackground-image: url(images/marker-icon.png);\\n\\t}\\n\\n\\n/* attribution and scale controls */\\n\\n.leaflet-container .leaflet-control-attribution {\\n\\tbackground: #fff;\\n\\tbackground: rgba(255, 255, 255, 0.8);\\n\\tmargin: 0;\\n\\t}\\n.leaflet-control-attribution,\\n.leaflet-control-scale-line {\\n\\tpadding: 0 5px;\\n\\tcolor: #333;\\n\\tline-height: 1.4;\\n\\t}\\n.leaflet-control-attribution a {\\n\\ttext-decoration: none;\\n\\t}\\n.leaflet-control-attribution a:hover,\\n.leaflet-control-attribution a:focus {\\n\\ttext-decoration: underline;\\n\\t}\\n.leaflet-attribution-flag {\\n\\tdisplay: inline !important;\\n\\tvertical-align: baseline !important;\\n\\twidth: 1em;\\n\\theight: 0.6669em;\\n\\tmargin-right: 0.277em;\\n\\t}\\n.leaflet-left .leaflet-control-scale {\\n\\tmargin-left: 5px;\\n\\t}\\n.leaflet-bottom .leaflet-control-scale {\\n\\tmargin-bottom: 5px;\\n\\t}\\n.leaflet-control-scale-line {\\n\\tborder: 2px solid #777;\\n\\tborder-top: none;\\n\\tline-height: 1.1;\\n\\tpadding: 2px 5px 1px;\\n\\twhite-space: nowrap;\\n\\tbox-sizing: border-box;\\n\\tbackground: rgba(255, 255, 255, 0.8);\\n\\ttext-shadow: 1px 1px #fff;\\n\\t}\\n.leaflet-control-scale-line:not(:first-child) {\\n\\tborder-top: 2px solid #777;\\n\\tborder-bottom: none;\\n\\tmargin-top: -2px;\\n\\t}\\n.leaflet-control-scale-line:not(:first-child):not(:last-child) {\\n\\tborder-bottom: 2px solid #777;\\n\\t}\\n\\n.leaflet-touch .leaflet-control-attribution,\\n.leaflet-touch .leaflet-control-layers,\\n.leaflet-touch .leaflet-bar {\\n\\tbox-shadow: none;\\n\\t}\\n.leaflet-touch .leaflet-control-layers,\\n.leaflet-touch .leaflet-bar {\\n\\tborder: 2px solid rgba(0,0,0,0.2);\\n\\tbackground-clip: padding-box;\\n\\t}\\n\\n\\n/* popup */\\n\\n.leaflet-popup {\\n\\tposition: absolute;\\n\\ttext-align: center;\\n\\tmargin-bottom: 20px;\\n\\t}\\n.leaflet-popup-content-wrapper {\\n\\tpadding: 1px;\\n\\ttext-align: left;\\n\\tborder-radius: 12px;\\n\\t}\\n.leaflet-popup-content {\\n\\tmargin: 13px 24px 13px 20px;\\n\\tline-height: 1.3;\\n\\tfont-size: 13px;\\n\\tfont-size: 1.08333em;\\n\\tmin-height: 1px;\\n\\t}\\n.leaflet-popup-content p {\\n\\tmargin: 17px 0;\\n\\tmargin: 1.3em 0;\\n\\t}\\n.leaflet-popup-tip-container {\\n\\twidth: 40px;\\n\\theight: 20px;\\n\\tposition: absolute;\\n\\tleft: 50%;\\n\\tmargin-top: -1px;\\n\\tmargin-left: -20px;\\n\\toverflow: hidden;\\n\\tpointer-events: none;\\n\\t}\\n.leaflet-popup-tip {\\n\\twidth: 17px;\\n\\theight: 17px;\\n\\tpadding: 1px;\\n\\n\\tmargin: -10px auto 0;\\n\\tpointer-events: auto;\\n\\n\\ttransform: rotate(45deg);\\n\\t}\\n.leaflet-popup-content-wrapper,\\n.leaflet-popup-tip {\\n\\tbackground: white;\\n\\tcolor: #333;\\n\\tbox-shadow: 0 3px 14px rgba(0,0,0,0.4);\\n\\t}\\n.leaflet-container a.leaflet-popup-close-button {\\n\\tposition: absolute;\\n\\ttop: 0;\\n\\tright: 0;\\n\\tborder: none;\\n\\ttext-align: center;\\n\\twidth: 24px;\\n\\theight: 24px;\\n\\tfont: 16px/24px Tahoma, Verdana, sans-serif;\\n\\tcolor: #757575;\\n\\ttext-decoration: none;\\n\\tbackground: transparent;\\n\\t}\\n.leaflet-container a.leaflet-popup-close-button:hover,\\n.leaflet-container a.leaflet-popup-close-button:focus {\\n\\tcolor: #585858;\\n\\t}\\n.leaflet-popup-scrolled {\\n\\toverflow: auto;\\n\\t}\\n\\n/* div icon */\\n\\n.leaflet-div-icon {\\n\\tbackground: #fff;\\n\\tborder: 1px solid #666;\\n\\t}\\n\\n\\n/* Tooltip */\\n/* Base styles for the element that has a tooltip */\\n.leaflet-tooltip {\\n\\tposition: absolute;\\n\\tpadding: 6px;\\n\\tbackground-color: #fff;\\n\\tborder: 1px solid #fff;\\n\\tborder-radius: 3px;\\n\\tcolor: #222;\\n\\twhite-space: nowrap;\\n\\tuser-select: none;\\n\\tpointer-events: none;\\n\\tbox-shadow: 0 1px 3px rgba(0,0,0,0.4);\\n\\t}\\n.leaflet-tooltip.leaflet-interactive {\\n\\tcursor: pointer;\\n\\tpointer-events: auto;\\n\\t}\\n.leaflet-tooltip-top:before,\\n.leaflet-tooltip-bottom:before,\\n.leaflet-tooltip-left:before,\\n.leaflet-tooltip-right:before {\\n\\tposition: absolute;\\n\\tpointer-events: none;\\n\\tborder: 6px solid transparent;\\n\\tbackground: transparent;\\n\\tcontent: \\\"\\\";\\n\\t}\\n\\n/* Directions */\\n\\n.leaflet-tooltip-bottom {\\n\\tmargin-top: 6px;\\n}\\n.leaflet-tooltip-top {\\n\\tmargin-top: -6px;\\n}\\n.leaflet-tooltip-bottom:before,\\n.leaflet-tooltip-top:before {\\n\\tleft: 50%;\\n\\tmargin-left: -6px;\\n\\t}\\n.leaflet-tooltip-top:before {\\n\\tbottom: 0;\\n\\tmargin-bottom: -12px;\\n\\tborder-top-color: #fff;\\n\\t}\\n.leaflet-tooltip-bottom:before {\\n\\ttop: 0;\\n\\tmargin-top: -12px;\\n\\tmargin-left: -6px;\\n\\tborder-bottom-color: #fff;\\n\\t}\\n.leaflet-tooltip-left {\\n\\tmargin-left: -6px;\\n}\\n.leaflet-tooltip-right {\\n\\tmargin-left: 6px;\\n}\\n.leaflet-tooltip-left:before,\\n.leaflet-tooltip-right:before {\\n\\ttop: 50%;\\n\\tmargin-top: -6px;\\n\\t}\\n.leaflet-tooltip-left:before {\\n\\tright: 0;\\n\\tmargin-right: -12px;\\n\\tborder-left-color: #fff;\\n\\t}\\n.leaflet-tooltip-right:before {\\n\\tleft: 0;\\n\\tmargin-left: -12px;\\n\\tborder-right-color: #fff;\\n\\t}\\n\\n/* Printing */\\n\\n@media print {\\n\\t/* Prevent printers from removing background-images of controls. */\\n\\t.leaflet-control {\\n\\t\\t-webkit-print-color-adjust: exact;\\n\\t\\tprint-color-adjust: exact;\\n\\t}\\n}\\n\""],"names":[],"mappings":"AAAA,MAAA,aAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;","x_google_ignoreList":[0]}
|
|
@@ -1,83 +1,135 @@
|
|
|
1
|
-
import { UHTMLComboboxElement
|
|
2
|
-
import { UHTMLDataListElement
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { UHTMLComboboxElement } from "@u-elements/u-combobox";
|
|
2
|
+
import { UHTMLDataListElement } from "@u-elements/u-datalist";
|
|
3
|
+
import styles from "../styles.module.css.js";
|
|
4
|
+
import { isBrowser, onLoaded, onMutation, on, QUICK_EVENT, isInputLike, attr, useId, anchorPosition } from "../utils.js";
|
|
5
|
+
const CSS_FIELD = styles.field.split(" ")[0];
|
|
6
|
+
const CSS_VALIDATIONS = styles.validation.split(" ");
|
|
7
|
+
const CSS_VALIDATION = CSS_VALIDATIONS[0];
|
|
8
|
+
const FIELDS = isBrowser() ? document.getElementsByClassName(CSS_FIELD) : [];
|
|
9
|
+
function handleFieldMutation(validate) {
|
|
10
|
+
let firstInvalid = null;
|
|
11
|
+
for (const field of FIELDS)
|
|
12
|
+
if (field.isConnected) {
|
|
13
|
+
const labels = [];
|
|
14
|
+
const descriptions = [];
|
|
15
|
+
const validationMsg = [];
|
|
16
|
+
let combobox = null;
|
|
17
|
+
let input = null;
|
|
18
|
+
let valid = true;
|
|
19
|
+
for (const el of field.getElementsByTagName("*")) {
|
|
20
|
+
if (el instanceof HTMLLabelElement) labels.push(el);
|
|
21
|
+
else if (el instanceof UHTMLComboboxElement) combobox = el;
|
|
22
|
+
else if (isInputLike(el) && !el.hidden) input = el;
|
|
23
|
+
else if (el.hasAttribute("data-description")) descriptions.push(el);
|
|
24
|
+
else if (el.classList.contains(CSS_VALIDATION)) {
|
|
25
|
+
valid = attr(el, "data-color") === "success" || !el.clientHeight;
|
|
26
|
+
validationMsg.push(el);
|
|
27
|
+
descriptions.unshift(el);
|
|
28
|
+
} else if (el instanceof HTMLParagraphElement)
|
|
29
|
+
descriptions.some((desc) => desc.contains(el)) || descriptions.push(el);
|
|
30
|
+
}
|
|
31
|
+
if (input) {
|
|
32
|
+
const comboboxInput = combobox?.control;
|
|
33
|
+
const shouldValidate = validate || comboboxInput?.validity.customError;
|
|
34
|
+
if (shouldValidate && attr(field, "data-validation") === "form") {
|
|
35
|
+
valid = comboboxInput?.getAttribute("aria-required") === "true" ? !!combobox?.items.length : input.validity.valid;
|
|
36
|
+
if (!firstInvalid && !valid) firstInvalid = input;
|
|
37
|
+
for (const el of validationMsg) attr(el, "hidden", valid ? "" : null);
|
|
38
|
+
comboboxInput?.setCustomValidity(valid ? "" : "Invalid");
|
|
20
39
|
}
|
|
21
|
-
for (const
|
|
22
|
-
|
|
40
|
+
for (const label of labels) label.htmlFor = useId(input);
|
|
41
|
+
renderCombobox(combobox);
|
|
42
|
+
renderCounter(input);
|
|
43
|
+
renderTextareaSize(input);
|
|
44
|
+
attr(input, "aria-describedby", descriptions.map(useId).join(" "));
|
|
45
|
+
attr(input, "aria-invalid", `${!valid}`);
|
|
23
46
|
}
|
|
24
47
|
}
|
|
25
|
-
|
|
48
|
+
if (validate) firstInvalid?.focus();
|
|
49
|
+
return firstInvalid;
|
|
26
50
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
"--mtds-textarea-height",
|
|
30
|
-
|
|
31
|
-
|
|
51
|
+
function renderTextareaSize(textarea) {
|
|
52
|
+
if (textarea instanceof HTMLTextAreaElement) {
|
|
53
|
+
textarea.style.setProperty("--mtds-textarea-height", "auto");
|
|
54
|
+
textarea.style.setProperty(
|
|
55
|
+
"--mtds-textarea-height",
|
|
56
|
+
`${textarea.scrollHeight}px`
|
|
57
|
+
);
|
|
58
|
+
}
|
|
32
59
|
}
|
|
33
|
-
const
|
|
34
|
-
function
|
|
35
|
-
const { control
|
|
36
|
-
if (
|
|
37
|
-
const
|
|
38
|
-
|
|
60
|
+
const getText = (style, key) => style.getPropertyValue(`--mtds-text-${key}`)?.slice(1, -1) || "";
|
|
61
|
+
function renderCombobox(el) {
|
|
62
|
+
const { control, list } = el || {};
|
|
63
|
+
if (el && list && !el.hasAttribute("data-sr-added")) {
|
|
64
|
+
const style = window.getComputedStyle(el);
|
|
65
|
+
attr(el, "data-sr-added", getText(style, "combobox-added"));
|
|
66
|
+
attr(el, "data-sr-empty", getText(style, "combobox-empty"));
|
|
67
|
+
attr(el, "data-sr-found", getText(style, "combobox-found"));
|
|
68
|
+
attr(el, "data-sr-invalid", getText(style, "combobox-invalid"));
|
|
69
|
+
attr(el, "data-sr-of", getText(style, "combobox-of"));
|
|
70
|
+
attr(el, "data-sr-remove", getText(style, "combobox-remove"));
|
|
71
|
+
attr(el, "data-sr-removed", getText(style, "combobox-removed"));
|
|
72
|
+
attr(list, "data-sr-plural", getText(style, "datalist-plural"));
|
|
73
|
+
attr(list, "data-sr-singular", getText(style, "datalist-singular"));
|
|
74
|
+
}
|
|
75
|
+
if (list && control && !list.hasAttribute("popover")) {
|
|
76
|
+
attr(list, "popover", "manual");
|
|
77
|
+
attr(control, "popovertarget", useId(list));
|
|
39
78
|
}
|
|
40
|
-
a && e && !a.hasAttribute("popover") && (n(a, "popover", "manual"), n(e, "popovertarget", p(a)));
|
|
41
79
|
}
|
|
42
|
-
function
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
80
|
+
function renderCounter(input) {
|
|
81
|
+
const el = input?.nextElementSibling;
|
|
82
|
+
const limit = el && attr(el, "data-count");
|
|
83
|
+
if (el && limit) {
|
|
84
|
+
const remainder = Number(limit) - input.value.length;
|
|
85
|
+
const nextInvalid = remainder < 0;
|
|
86
|
+
const prevInvalid = attr(el, "aria-live") === "polite";
|
|
87
|
+
const style = window.getComputedStyle(el || input);
|
|
88
|
+
const over = getText(style, "count-over");
|
|
89
|
+
const under = getText(style, "count-under");
|
|
90
|
+
if (prevInvalid !== nextInvalid) {
|
|
91
|
+
attr(el, "aria-live", nextInvalid ? "polite" : "off");
|
|
92
|
+
for (const css of CSS_VALIDATIONS) el.classList.toggle(css, nextInvalid);
|
|
49
93
|
}
|
|
50
|
-
|
|
94
|
+
el.textContent = (nextInvalid ? over : under).replace(
|
|
51
95
|
"%d",
|
|
52
|
-
`${Math.abs(
|
|
96
|
+
`${Math.abs(remainder)}`
|
|
53
97
|
);
|
|
54
98
|
}
|
|
55
99
|
}
|
|
56
|
-
function
|
|
57
|
-
if (
|
|
58
|
-
const
|
|
59
|
-
|
|
100
|
+
function handleFieldToggle({ target: el, newState }) {
|
|
101
|
+
if (el instanceof UHTMLDataListElement) {
|
|
102
|
+
const root = el.getRootNode();
|
|
103
|
+
const anchor = root?.querySelector(
|
|
104
|
+
`[popovertarget="${el.id}"]`
|
|
60
105
|
);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
106
|
+
if (newState === "closed") anchorPosition(el, false);
|
|
107
|
+
else if (anchor)
|
|
108
|
+
anchorPosition(el, anchor, {
|
|
109
|
+
contain({ availableHeight }) {
|
|
110
|
+
el.style.width = `${anchor.clientWidth}px`;
|
|
111
|
+
el.style.maxHeight = `${Math.max(50, availableHeight)}px`;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
66
114
|
}
|
|
67
115
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
116
|
+
function handleFieldInput(event) {
|
|
117
|
+
if (isInputLike(event.target)) {
|
|
118
|
+
renderCounter(event.target);
|
|
119
|
+
renderTextareaSize(event.target);
|
|
120
|
+
}
|
|
70
121
|
}
|
|
71
|
-
function
|
|
72
|
-
const
|
|
73
|
-
|
|
122
|
+
function handleFieldValdiation(event) {
|
|
123
|
+
const field = event.target?.closest?.(`.${CSS_FIELD}`);
|
|
124
|
+
if (event.type === "invalid" && field) event.preventDefault();
|
|
125
|
+
if (handleFieldMutation(true)) event.preventDefault();
|
|
74
126
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
127
|
+
onLoaded(() => [
|
|
128
|
+
onMutation(() => handleFieldMutation(), "class"),
|
|
129
|
+
on(document, "input", handleFieldInput, QUICK_EVENT),
|
|
130
|
+
on(document, "toggle", handleFieldToggle, QUICK_EVENT),
|
|
79
131
|
// Use capture since toggle does not bubble
|
|
80
|
-
|
|
132
|
+
on(document, "invalid,submit", handleFieldValdiation, true)
|
|
81
133
|
// Use capture as invalid and submit does not bubble
|
|
82
134
|
]);
|
|
83
135
|
//# sourceMappingURL=field-observer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-observer.js","sources":["../../designsystem/field/field-observer.ts"],"sourcesContent":["import { UHTMLComboboxElement } from \"@u-elements/u-combobox\";\nimport { UHTMLDataListElement } from \"@u-elements/u-datalist\";\nimport styles from \"../styles.module.css\";\nimport {\n\tanchorPosition,\n\tattr,\n\tIS_BROWSER,\n\tisInputLike,\n\ton,\n\tonLoaded,\n\tonMutation,\n\tQUICK_EVENT,\n\tuseId,\n} from \"../utils\";\n\nconst CSS_FIELD = styles.field.split(\" \")[0];\nconst CSS_VALIDATIONS = styles.validation.split(\" \");\nconst CSS_VALIDATION = CSS_VALIDATIONS[0];\nconst FIELDS = IS_BROWSER ? document.getElementsByClassName(CSS_FIELD) : [];\n\nfunction handleFieldMutation(validate?: boolean) {\n\tlet firstInvalid: HTMLInputElement | null = null;\n\tfor (const field of FIELDS)\n\t\tif (field.isConnected) {\n\t\t\tconst labels: HTMLLabelElement[] = [];\n\t\t\tconst descriptions: Element[] = [];\n\t\t\tconst validationMsg: Element[] = [];\n\t\t\tlet combobox: UHTMLComboboxElement | null = null;\n\t\t\tlet input: HTMLInputElement | null = null;\n\t\t\tlet valid = true;\n\n\t\t\tfor (const el of field.getElementsByTagName(\"*\")) {\n\t\t\t\tif (el instanceof HTMLLabelElement) labels.push(el);\n\t\t\t\telse if (el instanceof UHTMLComboboxElement) combobox = el;\n\t\t\t\telse if (isInputLike(el) && !el.hidden) input = el;\n\t\t\t\telse if (el.hasAttribute(\"data-description\")) descriptions.push(el);\n\t\t\t\telse if (el.classList.contains(CSS_VALIDATION)) {\n\t\t\t\t\tvalid = attr(el, \"data-color\") === \"success\" || !el.clientHeight; // Only set invalid if Validation is visible\n\t\t\t\t\tvalidationMsg.push(el);\n\t\t\t\t\tdescriptions.unshift(el);\n\t\t\t\t} else if (el instanceof HTMLParagraphElement)\n\t\t\t\t\tdescriptions.some((desc) => desc.contains(el)) ||\n\t\t\t\t\t\tdescriptions.push(el); // Only add if not already inside description\n\t\t\t}\n\n\t\t\tif (input) {\n\t\t\t\tconst comboboxInput = combobox?.control;\n\t\t\t\tconst shouldValidate = validate || comboboxInput?.validity.customError; // Live re-evaluate combobox if invalid to correct validity before form sumbit\n\n\t\t\t\tif (shouldValidate && attr(field, \"data-validation\") === \"form\") {\n\t\t\t\t\tvalid =\n\t\t\t\t\t\tcomboboxInput?.getAttribute(\"aria-required\") === \"true\"\n\t\t\t\t\t\t\t? !!combobox?.items.length\n\t\t\t\t\t\t\t: input.validity.valid;\n\n\t\t\t\t\tif (!firstInvalid && !valid) firstInvalid = input;\n\t\t\t\t\tfor (const el of validationMsg) attr(el, \"hidden\", valid ? \"\" : null);\n\t\t\t\t\tcomboboxInput?.setCustomValidity(valid ? \"\" : \"Invalid\"); // Combobox does not have native validation\n\t\t\t\t}\n\t\t\t\tfor (const label of labels) label.htmlFor = useId(input);\n\t\t\t\trenderCombobox(combobox);\n\t\t\t\trenderCounter(input);\n\t\t\t\trenderTextareaSize(input);\n\t\t\t\tattr(input, \"aria-describedby\", descriptions.map(useId).join(\" \"));\n\t\t\t\tattr(input, \"aria-invalid\", `${!valid}`);\n\t\t\t}\n\t\t}\n\tif (validate) firstInvalid?.focus(); // Only move focus to first invalid field if validate was true\n\treturn firstInvalid;\n}\n\n// iOS does not support field-sizing: content, so we need to manually resize\nfunction renderTextareaSize(textarea: Element) {\n\tif (textarea instanceof HTMLTextAreaElement) {\n\t\ttextarea.style.setProperty(\"--mtds-textarea-height\", \"auto\");\n\t\ttextarea.style.setProperty(\n\t\t\t\"--mtds-textarea-height\",\n\t\t\t`${textarea.scrollHeight}px`,\n\t\t);\n\t}\n}\n\nconst getText = (style: CSSStyleDeclaration, key: string) =>\n\tstyle.getPropertyValue(`--mtds-text-${key}`)?.slice(1, -1) || \"\"; // slice to trim quotes\n\n// Setup translations from CSS custom properties\nfunction renderCombobox(el: UHTMLComboboxElement | null) {\n\tconst { control, list } = el || {};\n\n\tif (el && list && !el.hasAttribute(\"data-sr-added\")) {\n\t\tconst style = window.getComputedStyle(el);\n\t\tattr(el, \"data-sr-added\", getText(style, \"combobox-added\"));\n\t\tattr(el, \"data-sr-empty\", getText(style, \"combobox-empty\"));\n\t\tattr(el, \"data-sr-found\", getText(style, \"combobox-found\"));\n\t\tattr(el, \"data-sr-invalid\", getText(style, \"combobox-invalid\"));\n\t\tattr(el, \"data-sr-of\", getText(style, \"combobox-of\"));\n\t\tattr(el, \"data-sr-remove\", getText(style, \"combobox-remove\"));\n\t\tattr(el, \"data-sr-removed\", getText(style, \"combobox-removed\"));\n\t\tattr(list, \"data-sr-plural\", getText(style, \"datalist-plural\"));\n\t\tattr(list, \"data-sr-singular\", getText(style, \"datalist-singular\"));\n\t}\n\tif (list && control && !list.hasAttribute(\"popover\")) {\n\t\tattr(list, \"popover\", \"manual\");\n\t\tattr(control, \"popovertarget\", useId(list));\n\t}\n}\n\nfunction renderCounter(input: HTMLInputElement) {\n\tconst el = input?.nextElementSibling;\n\tconst limit = el && attr(el, \"data-count\");\n\n\tif (el && limit) {\n\t\tconst remainder = Number(limit) - input.value.length;\n\t\tconst nextInvalid = remainder < 0;\n\t\tconst prevInvalid = attr(el, \"aria-live\") === \"polite\";\n\t\tconst style = window.getComputedStyle(el || input);\n\t\tconst over = getText(style, \"count-over\");\n\t\tconst under = getText(style, \"count-under\");\n\n\t\tif (prevInvalid !== nextInvalid) {\n\t\t\tattr(el, \"aria-live\", nextInvalid ? \"polite\" : \"off\");\n\t\t\tfor (const css of CSS_VALIDATIONS) el.classList.toggle(css, nextInvalid);\n\t\t}\n\t\tel.textContent = (nextInvalid ? over : under).replace(\n\t\t\t\"%d\",\n\t\t\t`${Math.abs(remainder)}`,\n\t\t);\n\t}\n}\n\nfunction handleFieldToggle({ target: el, newState }: Partial<ToggleEvent>) {\n\tif (el instanceof UHTMLDataListElement) {\n\t\tconst root = el.getRootNode() as ShadowRoot | null;\n\t\tconst anchor = root?.querySelector<HTMLElement>(\n\t\t\t`[popovertarget=\"${el.id}\"]`,\n\t\t);\n\n\t\tif (newState === \"closed\") anchorPosition(el, false);\n\t\telse if (anchor)\n\t\t\tanchorPosition(el, anchor, {\n\t\t\t\tcontain({ availableHeight }) {\n\t\t\t\t\tel.style.width = `${anchor.clientWidth}px`;\n\t\t\t\t\tel.style.maxHeight = `${Math.max(50, availableHeight)}px`;\n\t\t\t\t},\n\t\t\t});\n\t}\n}\n// Update when typing\nfunction handleFieldInput(event: Event) {\n\tif (isInputLike(event.target)) {\n\t\trenderCounter(event.target);\n\t\trenderTextareaSize(event.target);\n\t}\n}\n\nfunction handleFieldValdiation(event: Event) {\n\tconst field = (event.target as Element)?.closest?.(`.${CSS_FIELD}`);\n\tif (event.type === \"invalid\" && field) event.preventDefault(); // Prevent browsers from showing default validation bubbles\n\tif (handleFieldMutation(true)) event.preventDefault(); // Prevent submit if invalid fields found\n}\n\nonLoaded(() => [\n\tonMutation(() => handleFieldMutation(), \"class\"),\n\ton(document, \"input\", handleFieldInput, QUICK_EVENT),\n\ton(document, \"toggle\", handleFieldToggle, QUICK_EVENT), // Use capture since toggle does not bubble\n\ton(document, \"invalid,submit\", handleFieldValdiation, true), // Use capture as invalid and submit does not bubble\n]);\n"],"names":["CSS_FIELD","styles","CSS_VALIDATIONS","CSS_VALIDATION","FIELDS","IS_BROWSER","handleFieldMutation","validate","firstInvalid","field","labels","descriptions","validationMsg","combobox","input","valid","el","UHTMLComboboxElement","isInputLike","attr","desc","comboboxInput","label","useId","renderCombobox","renderCounter","renderTextareaSize","textarea","getText","style","key","control","list","limit","remainder","nextInvalid","prevInvalid","over","under","css","handleFieldToggle","newState","UHTMLDataListElement","anchor","anchorPosition","availableHeight","handleFieldInput","event","handleFieldValdiation","onLoaded","onMutation","on","QUICK_EVENT"],"mappings":";;;;AAeA,MAAMA,IAAYC,EAAO,MAAM,MAAM,GAAG,EAAE,CAAC,GACrCC,IAAkBD,EAAO,WAAW,MAAM,GAAG,GAC7CE,IAAiBD,EAAgB,CAAC,GAClCE,IAASC,IAAa,SAAS,uBAAuBL,CAAS,IAAI,CAAA;AAEzE,SAASM,EAAoBC,GAAoB;AAChD,MAAIC,IAAwC;AAC5C,aAAWC,KAASL;AACnB,QAAIK,EAAM,aAAa;AACtB,YAAMC,IAA6B,CAAA,GAC7BC,IAA0B,CAAA,GAC1BC,IAA2B,CAAA;AACjC,UAAIC,IAAwC,MACxCC,IAAiC,MACjCC,IAAQ;AAEZ,iBAAWC,KAAMP,EAAM,qBAAqB,GAAG;AAC9C,QAAIO,aAAc,mBAAkBN,EAAO,KAAKM,CAAE,IACzCA,aAAcC,IAAsBJ,IAAWG,IAC/CE,EAAYF,CAAE,KAAK,CAACA,EAAG,SAAQF,IAAQE,IACvCA,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kBM,CAAW;AAAA,EACnDD,EAAG,UAAU,UAAUX,GAAmBY,CAAW;AAAA;AAAA,EACrDD,EAAG,UAAU,kBAAkBH,GAAuB,EAAI;AAAA;AAC3D,CAAC;"}
|
|
1
|
+
{"version":3,"file":"field-observer.js","sources":["../../designsystem/field/field-observer.ts"],"sourcesContent":["import { UHTMLComboboxElement } from \"@u-elements/u-combobox\";\nimport { UHTMLDataListElement } from \"@u-elements/u-datalist\";\nimport styles from \"../styles.module.css\";\nimport {\n\tanchorPosition,\n\tattr,\n\tisBrowser,\n\tisInputLike,\n\ton,\n\tonLoaded,\n\tonMutation,\n\tQUICK_EVENT,\n\tuseId,\n} from \"../utils\";\n\nconst CSS_FIELD = styles.field.split(\" \")[0];\nconst CSS_VALIDATIONS = styles.validation.split(\" \");\nconst CSS_VALIDATION = CSS_VALIDATIONS[0];\nconst FIELDS = isBrowser() ? document.getElementsByClassName(CSS_FIELD) : [];\n\nfunction handleFieldMutation(validate?: boolean) {\n\tlet firstInvalid: HTMLInputElement | null = null;\n\tfor (const field of FIELDS)\n\t\tif (field.isConnected) {\n\t\t\tconst labels: HTMLLabelElement[] = [];\n\t\t\tconst descriptions: Element[] = [];\n\t\t\tconst validationMsg: Element[] = [];\n\t\t\tlet combobox: UHTMLComboboxElement | null = null;\n\t\t\tlet input: HTMLInputElement | null = null;\n\t\t\tlet valid = true;\n\n\t\t\tfor (const el of field.getElementsByTagName(\"*\")) {\n\t\t\t\tif (el instanceof HTMLLabelElement) labels.push(el);\n\t\t\t\telse if (el instanceof UHTMLComboboxElement) combobox = el;\n\t\t\t\telse if (isInputLike(el) && !el.hidden) input = el;\n\t\t\t\telse if (el.hasAttribute(\"data-description\")) descriptions.push(el);\n\t\t\t\telse if (el.classList.contains(CSS_VALIDATION)) {\n\t\t\t\t\tvalid = attr(el, \"data-color\") === \"success\" || !el.clientHeight; // Only set invalid if Validation is visible\n\t\t\t\t\tvalidationMsg.push(el);\n\t\t\t\t\tdescriptions.unshift(el);\n\t\t\t\t} else if (el instanceof HTMLParagraphElement)\n\t\t\t\t\tdescriptions.some((desc) => desc.contains(el)) ||\n\t\t\t\t\t\tdescriptions.push(el); // Only add if not already inside description\n\t\t\t}\n\n\t\t\tif (input) {\n\t\t\t\tconst comboboxInput = combobox?.control;\n\t\t\t\tconst shouldValidate = validate || comboboxInput?.validity.customError; // Live re-evaluate combobox if invalid to correct validity before form sumbit\n\n\t\t\t\tif (shouldValidate && attr(field, \"data-validation\") === \"form\") {\n\t\t\t\t\tvalid =\n\t\t\t\t\t\tcomboboxInput?.getAttribute(\"aria-required\") === \"true\"\n\t\t\t\t\t\t\t? !!combobox?.items.length\n\t\t\t\t\t\t\t: input.validity.valid;\n\n\t\t\t\t\tif (!firstInvalid && !valid) firstInvalid = input;\n\t\t\t\t\tfor (const el of validationMsg) attr(el, \"hidden\", valid ? \"\" : null);\n\t\t\t\t\tcomboboxInput?.setCustomValidity(valid ? \"\" : \"Invalid\"); // Combobox does not have native validation\n\t\t\t\t}\n\t\t\t\tfor (const label of labels) label.htmlFor = useId(input);\n\t\t\t\trenderCombobox(combobox);\n\t\t\t\trenderCounter(input);\n\t\t\t\trenderTextareaSize(input);\n\t\t\t\tattr(input, \"aria-describedby\", descriptions.map(useId).join(\" \"));\n\t\t\t\tattr(input, \"aria-invalid\", `${!valid}`);\n\t\t\t}\n\t\t}\n\tif (validate) firstInvalid?.focus(); // Only move focus to first invalid field if validate was true\n\treturn firstInvalid;\n}\n\n// iOS does not support field-sizing: content, so we need to manually resize\nfunction renderTextareaSize(textarea: Element) {\n\tif (textarea instanceof HTMLTextAreaElement) {\n\t\ttextarea.style.setProperty(\"--mtds-textarea-height\", \"auto\");\n\t\ttextarea.style.setProperty(\n\t\t\t\"--mtds-textarea-height\",\n\t\t\t`${textarea.scrollHeight}px`,\n\t\t);\n\t}\n}\n\nconst getText = (style: CSSStyleDeclaration, key: string) =>\n\tstyle.getPropertyValue(`--mtds-text-${key}`)?.slice(1, -1) || \"\"; // slice to trim quotes\n\n// Setup translations from CSS custom properties\nfunction renderCombobox(el: UHTMLComboboxElement | null) {\n\tconst { control, list } = el || {};\n\n\tif (el && list && !el.hasAttribute(\"data-sr-added\")) {\n\t\tconst style = window.getComputedStyle(el);\n\t\tattr(el, \"data-sr-added\", getText(style, \"combobox-added\"));\n\t\tattr(el, \"data-sr-empty\", getText(style, \"combobox-empty\"));\n\t\tattr(el, \"data-sr-found\", getText(style, \"combobox-found\"));\n\t\tattr(el, \"data-sr-invalid\", getText(style, \"combobox-invalid\"));\n\t\tattr(el, \"data-sr-of\", getText(style, \"combobox-of\"));\n\t\tattr(el, \"data-sr-remove\", getText(style, \"combobox-remove\"));\n\t\tattr(el, \"data-sr-removed\", getText(style, \"combobox-removed\"));\n\t\tattr(list, \"data-sr-plural\", getText(style, \"datalist-plural\"));\n\t\tattr(list, \"data-sr-singular\", getText(style, \"datalist-singular\"));\n\t}\n\tif (list && control && !list.hasAttribute(\"popover\")) {\n\t\tattr(list, \"popover\", \"manual\");\n\t\tattr(control, \"popovertarget\", useId(list));\n\t}\n}\n\nfunction renderCounter(input: HTMLInputElement) {\n\tconst el = input?.nextElementSibling;\n\tconst limit = el && attr(el, \"data-count\");\n\n\tif (el && limit) {\n\t\tconst remainder = Number(limit) - input.value.length;\n\t\tconst nextInvalid = remainder < 0;\n\t\tconst prevInvalid = attr(el, \"aria-live\") === \"polite\";\n\t\tconst style = window.getComputedStyle(el || input);\n\t\tconst over = getText(style, \"count-over\");\n\t\tconst under = getText(style, \"count-under\");\n\n\t\tif (prevInvalid !== nextInvalid) {\n\t\t\tattr(el, \"aria-live\", nextInvalid ? \"polite\" : \"off\");\n\t\t\tfor (const css of CSS_VALIDATIONS) el.classList.toggle(css, nextInvalid);\n\t\t}\n\t\tel.textContent = (nextInvalid ? over : under).replace(\n\t\t\t\"%d\",\n\t\t\t`${Math.abs(remainder)}`,\n\t\t);\n\t}\n}\n\nfunction handleFieldToggle({ target: el, newState }: Partial<ToggleEvent>) {\n\tif (el instanceof UHTMLDataListElement) {\n\t\tconst root = el.getRootNode() as ShadowRoot | null;\n\t\tconst anchor = root?.querySelector<HTMLElement>(\n\t\t\t`[popovertarget=\"${el.id}\"]`,\n\t\t);\n\n\t\tif (newState === \"closed\") anchorPosition(el, false);\n\t\telse if (anchor)\n\t\t\tanchorPosition(el, anchor, {\n\t\t\t\tcontain({ availableHeight }) {\n\t\t\t\t\tel.style.width = `${anchor.clientWidth}px`;\n\t\t\t\t\tel.style.maxHeight = `${Math.max(50, availableHeight)}px`;\n\t\t\t\t},\n\t\t\t});\n\t}\n}\n// Update when typing\nfunction handleFieldInput(event: Event) {\n\tif (isInputLike(event.target)) {\n\t\trenderCounter(event.target);\n\t\trenderTextareaSize(event.target);\n\t}\n}\n\nfunction handleFieldValdiation(event: Event) {\n\tconst field = (event.target as Element)?.closest?.(`.${CSS_FIELD}`);\n\tif (event.type === \"invalid\" && field) event.preventDefault(); // Prevent browsers from showing default validation bubbles\n\tif (handleFieldMutation(true)) event.preventDefault(); // Prevent submit if invalid fields found\n}\n\nonLoaded(() => [\n\tonMutation(() => handleFieldMutation(), \"class\"),\n\ton(document, \"input\", handleFieldInput, QUICK_EVENT),\n\ton(document, \"toggle\", handleFieldToggle, QUICK_EVENT), // Use capture since toggle does not bubble\n\ton(document, \"invalid,submit\", handleFieldValdiation, true), // Use capture as invalid and submit does not bubble\n]);\n"],"names":[],"mappings":";;;;AAeA,MAAM,YAAY,OAAO,MAAM,MAAM,GAAG,EAAE,CAAC;AAC3C,MAAM,kBAAkB,OAAO,WAAW,MAAM,GAAG;AACnD,MAAM,iBAAiB,gBAAgB,CAAC;AACxC,MAAM,SAAS,UAAA,IAAc,SAAS,uBAAuB,SAAS,IAAI,CAAA;AAE1E,SAAS,oBAAoB,UAAoB;AAChD,MAAI,eAAwC;AAC5C,aAAW,SAAS;AACnB,QAAI,MAAM,aAAa;AACtB,YAAM,SAA6B,CAAA;AACnC,YAAM,eAA0B,CAAA;AAChC,YAAM,gBAA2B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oBAAoB,IAAI,EAAG,OAAM,eAAA;AACtC;AAEA,SAAS,MAAM;AAAA,EACd,WAAW,MAAM,oBAAA,GAAuB,OAAO;AAAA,EAC/C,GAAG,UAAU,SAAS,kBAAkB,WAAW;AAAA,EACnD,GAAG,UAAU,UAAU,mBAAmB,WAAW;AAAA;AAAA,EACrD,GAAG,UAAU,kBAAkB,uBAAuB,IAAI;AAAA;AAC3D,CAAC;"}
|
package/mtds/field/field.d.ts
CHANGED
|
@@ -46,13 +46,13 @@ export type FieldComboboxProps = Omit<ReactUcombobox, "onChange" | "onInput"> &
|
|
|
46
46
|
Pick<FieldDatalistProps, "data-position" | "data-nofilter">;
|
|
47
47
|
export type FieldLabelProps = React.ComponentPropsWithoutRef<"label">;
|
|
48
48
|
export declare const Field: FieldComponent & {
|
|
49
|
-
Affixes:
|
|
50
|
-
Combobox:
|
|
51
|
-
Datalist:
|
|
49
|
+
Affixes: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
50
|
+
Combobox: import('react').ForwardRefExoticComponent<Omit<FieldComboboxProps, "ref"> & import('react').RefAttributes<UHTMLComboboxElement>>;
|
|
51
|
+
Datalist: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDataListElement>, HTMLDataListElement>, "ref"> & {
|
|
52
52
|
"data-nofilter"?: boolean;
|
|
53
53
|
"data-position"?: Placement;
|
|
54
|
-
} &
|
|
55
|
-
Option:
|
|
56
|
-
Label:
|
|
54
|
+
} & import('react').RefAttributes<HTMLDataListElement>>;
|
|
55
|
+
Option: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>, "ref"> & import('react').RefAttributes<HTMLOptionElement>>;
|
|
56
|
+
Label: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & import('react').RefAttributes<HTMLLabelElement>>;
|
|
57
57
|
};
|
|
58
58
|
export {};
|