@siemens/ix-icons 0.0.0-20240422125504
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/LICENSE.md +9 -0
- package/README.md +69 -0
- package/dist/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/icon-58cf66e3.js +244 -0
- package/dist/cjs/icon-58cf66e3.js.map +1 -0
- package/dist/cjs/icons-0dd6f96e.js +1405 -0
- package/dist/cjs/icons-0dd6f96e.js.map +1 -0
- package/dist/cjs/index-af0541e0.js +1808 -0
- package/dist/cjs/index-af0541e0.js.map +1 -0
- package/dist/cjs/index.cjs.js +12 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/ix-icon.cjs.entry.js +12 -0
- package/dist/cjs/ix-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/ix-icons.cjs.js +27 -0
- package/dist/cjs/ix-icons.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/icon/icon.css +54 -0
- package/dist/collection/components/icon/icon.js +165 -0
- package/dist/collection/components/icon/icon.js.map +1 -0
- package/dist/collection/components/icon/icons.js +702 -0
- package/dist/collection/components/icon/icons.js.map +1 -0
- package/dist/collection/components/icon/meta-tag.js +42 -0
- package/dist/collection/components/icon/meta-tag.js.map +1 -0
- package/dist/collection/components/icon/resolveIcon.js +131 -0
- package/dist/collection/components/icon/resolveIcon.js.map +1 -0
- package/dist/collection/components/icon/test/ix-icon.spec.js +61 -0
- package/dist/collection/components/icon/test/ix-icon.spec.js.map +1 -0
- package/dist/collection/components/icon/test/resolveIcon.spec.js +72 -0
- package/dist/collection/components/icon/test/resolveIcon.spec.js.map +1 -0
- package/dist/collection/components/icon/test/rocker-example.js +5 -0
- package/dist/collection/components/icon/test/rocker-example.js.map +1 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/components/icon.js +266 -0
- package/dist/components/icon.js.map +1 -0
- package/dist/components/icons.js +705 -0
- package/dist/components/icons.js.map +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +4 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/ix-icon.d.ts +11 -0
- package/dist/components/ix-icon.js +8 -0
- package/dist/components/ix-icon.js.map +1 -0
- package/dist/esm/app-globals-0f993ce5.js +5 -0
- package/dist/esm/app-globals-0f993ce5.js.map +1 -0
- package/dist/esm/icon-022f3b5e.js +242 -0
- package/dist/esm/icon-022f3b5e.js.map +1 -0
- package/dist/esm/icons-84dc9236.js +705 -0
- package/dist/esm/icons-84dc9236.js.map +1 -0
- package/dist/esm/index-8088fea1.js +1779 -0
- package/dist/esm/index-8088fea1.js.map +1 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/ix-icon.entry.js +4 -0
- package/dist/esm/ix-icon.entry.js.map +1 -0
- package/dist/esm/ix-icons.js +22 -0
- package/dist/esm/ix-icons.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/ix-icons/index.esm.js +2 -0
- package/dist/ix-icons/index.esm.js.map +1 -0
- package/dist/ix-icons/ix-icons.esm.js +2 -0
- package/dist/ix-icons/ix-icons.esm.js.map +1 -0
- package/dist/ix-icons/p-51684ec4.js +2 -0
- package/dist/ix-icons/p-51684ec4.js.map +1 -0
- package/dist/ix-icons/p-7d7f048e.js +2 -0
- package/dist/ix-icons/p-7d7f048e.js.map +1 -0
- package/dist/ix-icons/p-99baafb2.entry.js +2 -0
- package/dist/ix-icons/p-99baafb2.entry.js.map +1 -0
- package/dist/ix-icons/p-e1255160.js +2 -0
- package/dist/ix-icons/p-e1255160.js.map +1 -0
- package/dist/ix-icons/p-efdd4090.js +3 -0
- package/dist/ix-icons/p-efdd4090.js.map +1 -0
- package/dist/sample.json +703 -0
- package/dist/types/components/icon/icon.d.ts +32 -0
- package/dist/types/components/icon/icons.d.ts +700 -0
- package/dist/types/components/icon/meta-tag.d.ts +12 -0
- package/dist/types/components/icon/resolveIcon.d.ts +9 -0
- package/dist/types/components/icon/test/rocker-example.d.ts +1 -0
- package/dist/types/components.d.ts +63 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +1681 -0
- package/icons/index.d.ts +702 -0
- package/icons/index.js +702 -0
- package/icons/index.mjs +702 -0
- package/icons/package.json +8 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +21 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +70 -0
- package/svg/about-filled.svg +1 -0
- package/svg/about.svg +1 -0
- package/svg/add-application.svg +1 -0
- package/svg/add-circle-filled.svg +1 -0
- package/svg/add-circle.svg +1 -0
- package/svg/add-document-note.svg +1 -0
- package/svg/add-eye-filled.svg +1 -0
- package/svg/add-eye.svg +1 -0
- package/svg/add-task-list.svg +1 -0
- package/svg/add-task.svg +1 -0
- package/svg/add-user-filled.svg +1 -0
- package/svg/add-user.svg +1 -0
- package/svg/add.svg +1 -0
- package/svg/ai.svg +1 -0
- package/svg/alarm-bell-cancelled-filled.svg +1 -0
- package/svg/alarm-bell-cancelled.svg +1 -0
- package/svg/alarm-bell-filled.svg +1 -0
- package/svg/alarm-bell.svg +1 -0
- package/svg/alarm-clock-filled.svg +1 -0
- package/svg/alarm-clock.svg +1 -0
- package/svg/alarm-filled.svg +1 -0
- package/svg/alarm.svg +1 -0
- package/svg/analyze.svg +1 -0
- package/svg/anomaly-found.svg +1 -0
- package/svg/anomaly.svg +1 -0
- package/svg/app-menu.svg +1 -0
- package/svg/application-screen.svg +1 -0
- package/svg/applications.svg +1 -0
- package/svg/apps.svg +1 -0
- package/svg/arrow-diagonal-bottom-left.svg +1 -0
- package/svg/arrow-diagonal-bottom-right.svg +1 -0
- package/svg/arrow-diagonal-top-left.svg +1 -0
- package/svg/arrow-diagonal-top-right.svg +1 -0
- package/svg/arrow-down-right.svg +1 -0
- package/svg/arrow-down.svg +1 -0
- package/svg/arrow-left.svg +1 -0
- package/svg/arrow-right-down.svg +1 -0
- package/svg/arrow-right.svg +1 -0
- package/svg/arrow-up.svg +1 -0
- package/svg/attach.svg +1 -0
- package/svg/attachment-upload.svg +1 -0
- package/svg/audio-description1.svg +1 -0
- package/svg/audio-description2.svg +1 -0
- package/svg/audit-report.svg +1 -0
- package/svg/average.svg +1 -0
- package/svg/backup-filled.svg +1 -0
- package/svg/backup.svg +1 -0
- package/svg/bar-code.svg +1 -0
- package/svg/barchart.svg +1 -0
- package/svg/battery-check.svg +1 -0
- package/svg/battery-empty-question.svg +1 -0
- package/svg/battery-empty.svg +1 -0
- package/svg/battery-exclamation.svg +1 -0
- package/svg/battery-full-check.svg +1 -0
- package/svg/battery-full.svg +1 -0
- package/svg/battery-half.svg +1 -0
- package/svg/battery-low.svg +1 -0
- package/svg/battery-quarter.svg +1 -0
- package/svg/battery-slash.svg +1 -0
- package/svg/battery-three-quarter.svg +1 -0
- package/svg/battery-xmark.svg +1 -0
- package/svg/bezier-curve.svg +1 -0
- package/svg/binoculars-filled.svg +1 -0
- package/svg/binoculars.svg +1 -0
- package/svg/blazor.svg +1 -0
- package/svg/book.svg +1 -0
- package/svg/bookmark-filled.svg +1 -0
- package/svg/bookmark.svg +1 -0
- package/svg/boundary-signals.svg +1 -0
- package/svg/building1-filled.svg +1 -0
- package/svg/building1.svg +1 -0
- package/svg/building2-filled.svg +1 -0
- package/svg/building2.svg +1 -0
- package/svg/bulb-filled.svg +1 -0
- package/svg/bulb.svg +1 -0
- package/svg/calendar-filled.svg +1 -0
- package/svg/calendar-settings.svg +1 -0
- package/svg/calendar.svg +1 -0
- package/svg/cancel.svg +1 -0
- package/svg/cancelled.svg +1 -0
- package/svg/capacity-filled.svg +1 -0
- package/svg/capacity.svg +1 -0
- package/svg/capture.svg +1 -0
- package/svg/car-filled.svg +1 -0
- package/svg/car.svg +1 -0
- package/svg/card-layout-filled.svg +1 -0
- package/svg/card-layout.svg +1 -0
- package/svg/certificate-error-filled.svg +1 -0
- package/svg/certificate-error.svg +1 -0
- package/svg/certificate-exclamation-filled.svg +1 -0
- package/svg/certificate-exclamation.svg +1 -0
- package/svg/certificate-success-filled.svg +1 -0
- package/svg/certificate-success.svg +1 -0
- package/svg/chart-cursor.svg +1 -0
- package/svg/chart-curve-linear.svg +1 -0
- package/svg/chart-curve-spline.svg +1 -0
- package/svg/chart-curve-stepped.svg +1 -0
- package/svg/chart-diagram-add.svg +1 -0
- package/svg/chart-diagram.svg +1 -0
- package/svg/chart-diagrams.svg +1 -0
- package/svg/chart-labels-filled.svg +1 -0
- package/svg/chart-labels.svg +1 -0
- package/svg/check-in.svg +1 -0
- package/svg/check-out.svg +1 -0
- package/svg/check.svg +1 -0
- package/svg/checkbox-component-checked.svg +1 -0
- package/svg/checkbox-component-mixed.svg +1 -0
- package/svg/checkbox-component-unchecked.svg +1 -0
- package/svg/checkbox-filled.svg +1 -0
- package/svg/checkbox.svg +1 -0
- package/svg/checkboxes-filled.svg +1 -0
- package/svg/checkboxes.svg +1 -0
- package/svg/chevron-down-small.svg +1 -0
- package/svg/chevron-down.svg +1 -0
- package/svg/chevron-left-small.svg +1 -0
- package/svg/chevron-left.svg +1 -0
- package/svg/chevron-right-small.svg +1 -0
- package/svg/chevron-right.svg +1 -0
- package/svg/chevron-up-small.svg +1 -0
- package/svg/chevron-up.svg +1 -0
- package/svg/circle-dot-filled.svg +1 -0
- package/svg/circle-dot.svg +1 -0
- package/svg/circle-filled.svg +1 -0
- package/svg/circle-pause-filled.svg +1 -0
- package/svg/circle-pause.svg +1 -0
- package/svg/circle-play-filled.svg +1 -0
- package/svg/circle-play.svg +1 -0
- package/svg/circle-stop-filled.svg +1 -0
- package/svg/circle-stop.svg +1 -0
- package/svg/circle.svg +1 -0
- package/svg/clear-filter-filled.svg +1 -0
- package/svg/clear-filter.svg +1 -0
- package/svg/clear.svg +1 -0
- package/svg/clock-filled.svg +1 -0
- package/svg/clock.svg +1 -0
- package/svg/close-small.svg +1 -0
- package/svg/close.svg +1 -0
- package/svg/cloud-download-add-filled.svg +1 -0
- package/svg/cloud-download-add.svg +1 -0
- package/svg/cloud-download-filled.svg +1 -0
- package/svg/cloud-download-list-filled.svg +1 -0
- package/svg/cloud-download-list.svg +1 -0
- package/svg/cloud-download.svg +1 -0
- package/svg/cloud-fail-filled.svg +1 -0
- package/svg/cloud-fail.svg +1 -0
- package/svg/cloud-filled.svg +1 -0
- package/svg/cloud-new-filled.svg +1 -0
- package/svg/cloud-new.svg +1 -0
- package/svg/cloud-success-filled.svg +1 -0
- package/svg/cloud-success.svg +1 -0
- package/svg/cloud-upload-filled.svg +1 -0
- package/svg/cloud-upload.svg +1 -0
- package/svg/cloud.svg +1 -0
- package/svg/code.svg +1 -0
- package/svg/coffee-empty-filled.svg +1 -0
- package/svg/coffee-empty.svg +1 -0
- package/svg/coffee-filled.svg +1 -0
- package/svg/coffee.svg +1 -0
- package/svg/cogwheel-filled.svg +1 -0
- package/svg/cogwheel.svg +1 -0
- package/svg/combine.svg +1 -0
- package/svg/compact-disc-filled.svg +1 -0
- package/svg/compact-disc.svg +1 -0
- package/svg/compound-block.svg +1 -0
- package/svg/configuration.svg +1 -0
- package/svg/configure-filled.svg +1 -0
- package/svg/configure.svg +1 -0
- package/svg/connected.svg +1 -0
- package/svg/connector-chart-filled.svg +1 -0
- package/svg/connector-chart.svg +1 -0
- package/svg/connector-filled.svg +1 -0
- package/svg/connector-hex-filled.svg +1 -0
- package/svg/connector-hex.svg +1 -0
- package/svg/connector-rect-filled.svg +1 -0
- package/svg/connector-rect.svg +1 -0
- package/svg/connector-rhomb-filled.svg +1 -0
- package/svg/connector-rhomb.svg +1 -0
- package/svg/connector.svg +1 -0
- package/svg/consistency-check.svg +1 -0
- package/svg/contact-details-filled.svg +1 -0
- package/svg/contact-details.svg +1 -0
- package/svg/context-menu.svg +1 -0
- package/svg/controlled-device.svg +1 -0
- package/svg/controller-device.svg +1 -0
- package/svg/copy.svg +1 -0
- package/svg/corner-arrow-up-left.svg +1 -0
- package/svg/couch-filled.svg +1 -0
- package/svg/couch.svg +1 -0
- package/svg/create-plant-filled.svg +1 -0
- package/svg/create-plant.svg +1 -0
- package/svg/cut.svg +1 -0
- package/svg/cycle.svg +1 -0
- package/svg/data-egress.svg +1 -0
- package/svg/data-ingress-egress.svg +1 -0
- package/svg/data-ingress.svg +1 -0
- package/svg/database-filled.svg +1 -0
- package/svg/database.svg +1 -0
- package/svg/details.svg +1 -0
- package/svg/diagram-module-library.svg +1 -0
- package/svg/diagram-module-new.svg +1 -0
- package/svg/diagram-module.svg +1 -0
- package/svg/diamond.svg +1 -0
- package/svg/disconnected.svg +1 -0
- package/svg/disk-filled.svg +1 -0
- package/svg/disk-pen.svg +1 -0
- package/svg/disk.svg +1 -0
- package/svg/distribution.svg +1 -0
- package/svg/doc-document.svg +1 -0
- package/svg/document-bulk.svg +1 -0
- package/svg/document-fail.svg +1 -0
- package/svg/document-info.svg +1 -0
- package/svg/document-link.svg +1 -0
- package/svg/document-management.svg +1 -0
- package/svg/document-reference.svg +1 -0
- package/svg/document-settings.svg +1 -0
- package/svg/document-success.svg +1 -0
- package/svg/document.svg +1 -0
- package/svg/double-check.svg +1 -0
- package/svg/double-chevron-down.svg +1 -0
- package/svg/double-chevron-left.svg +1 -0
- package/svg/double-chevron-right.svg +1 -0
- package/svg/double-chevron-up.svg +1 -0
- package/svg/doublet-filled.svg +1 -0
- package/svg/doublet.svg +1 -0
- package/svg/download-add.svg +1 -0
- package/svg/download-list.svg +1 -0
- package/svg/download.svg +1 -0
- package/svg/drop.svg +1 -0
- package/svg/duplicate-document.svg +1 -0
- package/svg/duplicate.svg +1 -0
- package/svg/e-mail-filled.svg +1 -0
- package/svg/e-mail.svg +1 -0
- package/svg/earth-filled.svg +1 -0
- package/svg/earth.svg +1 -0
- package/svg/edit-plant.svg +1 -0
- package/svg/electrical-energy-filled.svg +1 -0
- package/svg/electrical-energy.svg +1 -0
- package/svg/ellipse-arc.svg +1 -0
- package/svg/ellipse-filled.svg +1 -0
- package/svg/ellipse.svg +1 -0
- package/svg/error-filled.svg +1 -0
- package/svg/error.svg +1 -0
- package/svg/explore-filled.svg +1 -0
- package/svg/explore.svg +1 -0
- package/svg/export.svg +1 -0
- package/svg/eye-cancelled-filled.svg +1 -0
- package/svg/eye-cancelled.svg +1 -0
- package/svg/eye-filled.svg +1 -0
- package/svg/eye.svg +1 -0
- package/svg/factory-reset-filled.svg +1 -0
- package/svg/factory-reset.svg +1 -0
- package/svg/filter-filled.svg +1 -0
- package/svg/filter-outline.svg +1 -0
- package/svg/filter.svg +1 -0
- package/svg/fit-to-screen.svg +1 -0
- package/svg/flag-filled.svg +1 -0
- package/svg/flag.svg +1 -0
- package/svg/folder-down-filled.svg +1 -0
- package/svg/folder-down.svg +1 -0
- package/svg/folder-filled.svg +1 -0
- package/svg/folder-new-filled.svg +1 -0
- package/svg/folder-new-outline.svg +1 -0
- package/svg/folder-new.svg +1 -0
- package/svg/folder-open-filled.svg +1 -0
- package/svg/folder-open-outline.svg +1 -0
- package/svg/folder-open.svg +1 -0
- package/svg/folder-outline.svg +1 -0
- package/svg/folder-up-filled.svg +1 -0
- package/svg/folder-up.svg +1 -0
- package/svg/folder.svg +1 -0
- package/svg/full-screeen-exit.svg +1 -0
- package/svg/full-screeen.svg +1 -0
- package/svg/full-screen-exit.svg +1 -0
- package/svg/full-screen.svg +1 -0
- package/svg/function-block-library.svg +1 -0
- package/svg/function-block-new.svg +1 -0
- package/svg/function-block.svg +1 -0
- package/svg/function-diagram-new.svg +1 -0
- package/svg/function-diagram.svg +1 -0
- package/svg/gauge-filled.svg +1 -0
- package/svg/gauge.svg +1 -0
- package/svg/gaugechart.svg +1 -0
- package/svg/global-plant-filled.svg +1 -0
- package/svg/global-plant.svg +1 -0
- package/svg/globe-filled.svg +1 -0
- package/svg/globe.svg +1 -0
- package/svg/goto.svg +1 -0
- package/svg/group.svg +1 -0
- package/svg/hard-reset.svg +1 -0
- package/svg/hardware-cabinet.svg +1 -0
- package/svg/health-filled.svg +1 -0
- package/svg/health.svg +1 -0
- package/svg/heart-filled.svg +1 -0
- package/svg/heart.svg +1 -0
- package/svg/hexagon-vertical-bars-database-filled.svg +1 -0
- package/svg/hexagon-vertical-bars-database.svg +1 -0
- package/svg/hexagon-vertical-bars-filled.svg +1 -0
- package/svg/hexagon-vertical-bars.svg +1 -0
- package/svg/hierarchy.svg +1 -0
- package/svg/highlight-filled.svg +1 -0
- package/svg/highlight.svg +1 -0
- package/svg/history-list.svg +1 -0
- package/svg/history.svg +1 -0
- package/svg/home-filled.svg +1 -0
- package/svg/home.svg +1 -0
- package/svg/hourglass.svg +1 -0
- package/svg/image-filled.svg +1 -0
- package/svg/image.svg +1 -0
- package/svg/import.svg +1 -0
- package/svg/info-feed.svg +1 -0
- package/svg/info-filled.svg +1 -0
- package/svg/info.svg +1 -0
- package/svg/ingestion-report.svg +1 -0
- package/svg/ingestion.svg +1 -0
- package/svg/ink-pen.svg +1 -0
- package/svg/inquiry-filled.svg +1 -0
- package/svg/inquiry-mail.svg +1 -0
- package/svg/inquiry.svg +1 -0
- package/svg/item-details-filled.svg +1 -0
- package/svg/item-details.svg +1 -0
- package/svg/label-filled.svg +1 -0
- package/svg/label.svg +1 -0
- package/svg/landing-page-logo.svg +1 -0
- package/svg/language-filled.svg +1 -0
- package/svg/language.svg +1 -0
- package/svg/layers-filled.svg +1 -0
- package/svg/layers.svg +1 -0
- package/svg/leaf.svg +1 -0
- package/svg/legal.svg +1 -0
- package/svg/library-new.svg +1 -0
- package/svg/library.svg +1 -0
- package/svg/license.svg +1 -0
- package/svg/light-dark.svg +1 -0
- package/svg/line-diagonal.svg +1 -0
- package/svg/link.svg +1 -0
- package/svg/list.svg +1 -0
- package/svg/live-schedule.svg +1 -0
- package/svg/location-filled.svg +1 -0
- package/svg/location-outline.svg +1 -0
- package/svg/location.svg +1 -0
- package/svg/lock-filled.svg +1 -0
- package/svg/lock-key-filled.svg +1 -0
- package/svg/lock-key.svg +1 -0
- package/svg/lock.svg +1 -0
- package/svg/log-in.svg +1 -0
- package/svg/log-out.svg +1 -0
- package/svg/log.svg +1 -0
- package/svg/logic-diagram.svg +1 -0
- package/svg/lower-limit.svg +1 -0
- package/svg/mail-filled.svg +1 -0
- package/svg/mail.svg +1 -0
- package/svg/maintenance-documents.svg +1 -0
- package/svg/maintenance-info.svg +1 -0
- package/svg/maintenance-warning-filled.svg +1 -0
- package/svg/maintenance-warning.svg +1 -0
- package/svg/maintenance.svg +1 -0
- package/svg/mandatory-done.svg +1 -0
- package/svg/mandatory.svg +1 -0
- package/svg/map.svg +1 -0
- package/svg/maximize.svg +1 -0
- package/svg/microphone-filled.svg +1 -0
- package/svg/microphone.svg +1 -0
- package/svg/minimize.svg +1 -0
- package/svg/minus.svg +1 -0
- package/svg/missing-symbol.svg +1 -0
- package/svg/mix.svg +1 -0
- package/svg/monitor-filled.svg +1 -0
- package/svg/monitor-trend.svg +1 -0
- package/svg/monitor.svg +1 -0
- package/svg/monitoring-add.svg +1 -0
- package/svg/monitoring.svg +1 -0
- package/svg/monitorings.svg +1 -0
- package/svg/moon-filled.svg +1 -0
- package/svg/moon.svg +1 -0
- package/svg/more-menu.svg +1 -0
- package/svg/mouse-click-filled.svg +1 -0
- package/svg/mouse-click.svg +1 -0
- package/svg/mouse-select-filled.svg +1 -0
- package/svg/mouse-select.svg +1 -0
- package/svg/mp4-document.svg +1 -0
- package/svg/namur-check-function-filled.svg +1 -0
- package/svg/namur-check-function.svg +1 -0
- package/svg/namur-failure-filled.svg +1 -0
- package/svg/namur-failure.svg +1 -0
- package/svg/namur-maintenance-required-filled.svg +1 -0
- package/svg/namur-maintenance-required.svg +1 -0
- package/svg/namur-ok-filled.svg +1 -0
- package/svg/namur-ok.svg +1 -0
- package/svg/namur-out-of-spec-filled.svg +1 -0
- package/svg/namur-out-of-spec.svg +1 -0
- package/svg/navigation-filled.svg +1 -0
- package/svg/navigation-left.svg +1 -0
- package/svg/navigation-right.svg +1 -0
- package/svg/navigation.svg +1 -0
- package/svg/new-indicator-filled.svg +1 -0
- package/svg/new-indicator.svg +1 -0
- package/svg/no-filter-filled.svg +1 -0
- package/svg/no-filter.svg +1 -0
- package/svg/no-image.svg +1 -0
- package/svg/note-filled.svg +1 -0
- package/svg/note.svg +1 -0
- package/svg/notification-filled.svg +1 -0
- package/svg/notification.svg +1 -0
- package/svg/notifications-filled.svg +1 -0
- package/svg/notifications.svg +1 -0
- package/svg/ontology-filled.svg +1 -0
- package/svg/ontology.svg +1 -0
- package/svg/open-external.svg +1 -0
- package/svg/open-file-filled.svg +1 -0
- package/svg/open-file.svg +1 -0
- package/svg/operate-plant-filled.svg +1 -0
- package/svg/operate-plant.svg +1 -0
- package/svg/optimize.svg +1 -0
- package/svg/p-and-i-symbols.svg +1 -0
- package/svg/p-i-diagram.svg +1 -0
- package/svg/pan.svg +1 -0
- package/svg/paste.svg +1 -0
- package/svg/pause.svg +1 -0
- package/svg/pc-tower-filled.svg +1 -0
- package/svg/pc-tower.svg +1 -0
- package/svg/pdf-document.svg +1 -0
- package/svg/pen-filled.svg +1 -0
- package/svg/pen.svg +1 -0
- package/svg/phone-filled.svg +1 -0
- package/svg/phone.svg +1 -0
- package/svg/photo-camera-add.svg +1 -0
- package/svg/photo-camera-cancelled-filled.svg +1 -0
- package/svg/photo-camera-cancelled.svg +1 -0
- package/svg/photo-camera-filled.svg +1 -0
- package/svg/photo-camera.svg +1 -0
- package/svg/photo-cameras.svg +1 -0
- package/svg/piechart-filled.svg +1 -0
- package/svg/piechart.svg +1 -0
- package/svg/pin-filled.svg +1 -0
- package/svg/pin.svg +1 -0
- package/svg/plant-filled.svg +1 -0
- package/svg/plant-handbook-filled.svg +1 -0
- package/svg/plant-handbook.svg +1 -0
- package/svg/plant-outline.svg +1 -0
- package/svg/plant-security.svg +1 -0
- package/svg/plant-settings-filled.svg +1 -0
- package/svg/plant-settings.svg +1 -0
- package/svg/plant-user-filled.svg +1 -0
- package/svg/plant-user.svg +1 -0
- package/svg/plant.svg +1 -0
- package/svg/plants-filled.svg +1 -0
- package/svg/plants.svg +1 -0
- package/svg/play-filled.svg +1 -0
- package/svg/play-pause-filled.svg +1 -0
- package/svg/play-pause.svg +1 -0
- package/svg/play-stepwise-filled.svg +1 -0
- package/svg/play-stepwise.svg +1 -0
- package/svg/play.svg +1 -0
- package/svg/plus-minus-times-divide.svg +1 -0
- package/svg/plus.svg +1 -0
- package/svg/point-up-filled.svg +1 -0
- package/svg/point-up.svg +1 -0
- package/svg/polar-plot.svg +1 -0
- package/svg/polygon-filled.svg +1 -0
- package/svg/polygon-line.svg +1 -0
- package/svg/polygon.svg +1 -0
- package/svg/ppt-document.svg +1 -0
- package/svg/print-filled.svg +1 -0
- package/svg/print.svg +1 -0
- package/svg/prio-high.svg +1 -0
- package/svg/prio-low.svg +1 -0
- package/svg/prio-middle.svg +1 -0
- package/svg/product-catalog.svg +1 -0
- package/svg/product-management.svg +1 -0
- package/svg/product.svg +1 -0
- package/svg/project-configuration.svg +1 -0
- package/svg/project-new.svg +1 -0
- package/svg/project-scenarios.svg +1 -0
- package/svg/project-server-filled.svg +1 -0
- package/svg/project-server.svg +1 -0
- package/svg/project.svg +1 -0
- package/svg/protocol.svg +1 -0
- package/svg/publish-document.svg +1 -0
- package/svg/publish.svg +1 -0
- package/svg/qr-code.svg +1 -0
- package/svg/quality-report.svg +1 -0
- package/svg/question-filled.svg +1 -0
- package/svg/question.svg +1 -0
- package/svg/radarchart.svg +1 -0
- package/svg/radio-waves-off.svg +1 -0
- package/svg/radio-waves-warning.svg +1 -0
- package/svg/radio-waves.svg +1 -0
- package/svg/random-filled.svg +1 -0
- package/svg/random.svg +1 -0
- package/svg/reboot.svg +1 -0
- package/svg/rectangle-filled.svg +1 -0
- package/svg/rectangle.svg +1 -0
- package/svg/redo.svg +1 -0
- package/svg/reference.svg +1 -0
- package/svg/refresh-cancelled.svg +1 -0
- package/svg/refresh.svg +1 -0
- package/svg/reload.svg +1 -0
- package/svg/remove-application.svg +1 -0
- package/svg/remove-eye-filled.svg +1 -0
- package/svg/remove-eye.svg +1 -0
- package/svg/rename.svg +1 -0
- package/svg/replace.svg +1 -0
- package/svg/report-barchart.svg +1 -0
- package/svg/report-linechart.svg +1 -0
- package/svg/report-text.svg +1 -0
- package/svg/reset.svg +1 -0
- package/svg/restore-backup-filled.svg +1 -0
- package/svg/restore-backup-pc.svg +1 -0
- package/svg/restore-backup.svg +1 -0
- package/svg/rhomb-filled.svg +1 -0
- package/svg/rhomb.svg +1 -0
- package/svg/road-filled.svg +1 -0
- package/svg/road.svg +1 -0
- package/svg/rocket-filled.svg +1 -0
- package/svg/rocket.svg +1 -0
- package/svg/route-target.svg +1 -0
- package/svg/route.svg +1 -0
- package/svg/scatterplot.svg +1 -0
- package/svg/scheduler-filled.svg +1 -0
- package/svg/scheduler.svg +1 -0
- package/svg/screen-filled.svg +1 -0
- package/svg/screen.svg +1 -0
- package/svg/screenshot-filled.svg +1 -0
- package/svg/screenshot.svg +1 -0
- package/svg/script-add.svg +1 -0
- package/svg/script.svg +1 -0
- package/svg/scripts.svg +1 -0
- package/svg/search.svg +1 -0
- package/svg/share-filled.svg +1 -0
- package/svg/share.svg +1 -0
- package/svg/shopping-cart-filled.svg +1 -0
- package/svg/shopping-cart.svg +1 -0
- package/svg/shout-filled.svg +1 -0
- package/svg/shout.svg +1 -0
- package/svg/sign-language.svg +1 -0
- package/svg/signal-strength-0.svg +1 -0
- package/svg/signal-strength-1.svg +1 -0
- package/svg/signal-strength-2.svg +1 -0
- package/svg/signal-strength-3.svg +1 -0
- package/svg/signal-strength-4.svg +1 -0
- package/svg/signal-strength-5.svg +1 -0
- package/svg/signal-strength-6.svg +1 -0
- package/svg/signal-strength-7.svg +1 -0
- package/svg/signal-strength-8.svg +1 -0
- package/svg/simit-component.svg +1 -0
- package/svg/simit-macro-component-editor.svg +1 -0
- package/svg/simit-macro.svg +1 -0
- package/svg/single-check.svg +1 -0
- package/svg/skip-back-filled.svg +1 -0
- package/svg/skip-back.svg +1 -0
- package/svg/skip-filled.svg +1 -0
- package/svg/skip.svg +1 -0
- package/svg/snowflake.svg +1 -0
- package/svg/sort-ascending.svg +1 -0
- package/svg/sort-descending.svg +1 -0
- package/svg/sort.svg +1 -0
- package/svg/sound-loud-filled.svg +1 -0
- package/svg/sound-loud.svg +1 -0
- package/svg/sound-mute-filled.svg +1 -0
- package/svg/sound-mute.svg +1 -0
- package/svg/sound-off-filled.svg +1 -0
- package/svg/sound-off.svg +1 -0
- package/svg/sound-quiet-filled.svg +1 -0
- package/svg/sound-quiet.svg +1 -0
- package/svg/spatial.svg +1 -0
- package/svg/split-horizontally.svg +1 -0
- package/svg/split-vertically.svg +1 -0
- package/svg/stamp-filled.svg +1 -0
- package/svg/stamp.svg +1 -0
- package/svg/standby.svg +1 -0
- package/svg/star-add-filled.svg +1 -0
- package/svg/star-add.svg +1 -0
- package/svg/star-cancelled-filled.svg +1 -0
- package/svg/star-cancelled.svg +1 -0
- package/svg/star-filled.svg +1 -0
- package/svg/star-list-filled.svg +1 -0
- package/svg/star-list.svg +1 -0
- package/svg/star.svg +1 -0
- package/svg/start-data-analysis.svg +1 -0
- package/svg/steering-user-filled.svg +1 -0
- package/svg/steering-user.svg +1 -0
- package/svg/steering.svg +1 -0
- package/svg/stethoscope.svg +1 -0
- package/svg/stop-filled.svg +1 -0
- package/svg/stop.svg +1 -0
- package/svg/success-filled.svg +1 -0
- package/svg/success.svg +1 -0
- package/svg/sun-filled.svg +1 -0
- package/svg/sun.svg +1 -0
- package/svg/support.svg +1 -0
- package/svg/surveillance-cancelled-filled.svg +1 -0
- package/svg/surveillance-cancelled.svg +1 -0
- package/svg/surveillance-filled.svg +1 -0
- package/svg/surveillance.svg +1 -0
- package/svg/svg-document.svg +1 -0
- package/svg/swap-left-right.svg +1 -0
- package/svg/switch-slider.svg +1 -0
- package/svg/table-columns.svg +1 -0
- package/svg/table-rows.svg +1 -0
- package/svg/table-settings.svg +1 -0
- package/svg/table.svg +1 -0
- package/svg/tag-filled.svg +1 -0
- package/svg/tag-plus-filled.svg +1 -0
- package/svg/tag-plus.svg +1 -0
- package/svg/tag.svg +1 -0
- package/svg/tasks-all.svg +1 -0
- package/svg/tasks-done.svg +1 -0
- package/svg/tasks-open.svg +1 -0
- package/svg/text-circle-rectangle-filled.svg +1 -0
- package/svg/text-circle-rectangle.svg +1 -0
- package/svg/text-document.svg +1 -0
- package/svg/text.svg +1 -0
- package/svg/threshold-cancelled.svg +1 -0
- package/svg/threshold-off.svg +1 -0
- package/svg/threshold-on.svg +1 -0
- package/svg/to-be-published.svg +1 -0
- package/svg/to-search.svg +1 -0
- package/svg/topic-filled.svg +1 -0
- package/svg/topic.svg +1 -0
- package/svg/touch-filled.svg +1 -0
- package/svg/touch.svg +1 -0
- package/svg/trashcan-filled.svg +1 -0
- package/svg/trashcan.svg +1 -0
- package/svg/tree.svg +1 -0
- package/svg/trend-downward-filled.svg +1 -0
- package/svg/trend-downward.svg +1 -0
- package/svg/trend-sideways-filled.svg +1 -0
- package/svg/trend-sideways.svg +1 -0
- package/svg/trend-upward-filled.svg +1 -0
- package/svg/trend-upward.svg +1 -0
- package/svg/trend.svg +1 -0
- package/svg/triangle-filled.svg +1 -0
- package/svg/triangle.svg +1 -0
- package/svg/truck-filled.svg +1 -0
- package/svg/truck.svg +1 -0
- package/svg/tulip-filled.svg +1 -0
- package/svg/tulip.svg +1 -0
- package/svg/txt-document.svg +1 -0
- package/svg/undo.svg +1 -0
- package/svg/ungroup.svg +1 -0
- package/svg/unlock-filled.svg +1 -0
- package/svg/unlock-plant-filled.svg +1 -0
- package/svg/unlock-plant.svg +1 -0
- package/svg/unlock.svg +1 -0
- package/svg/upload-document-note.svg +1 -0
- package/svg/upload-fail.svg +1 -0
- package/svg/upload-success.svg +1 -0
- package/svg/upload.svg +1 -0
- package/svg/upper-limit.svg +1 -0
- package/svg/user-check-filled.svg +1 -0
- package/svg/user-check.svg +1 -0
- package/svg/user-fail-filled.svg +1 -0
- package/svg/user-fail.svg +1 -0
- package/svg/user-filled.svg +1 -0
- package/svg/user-management-filled.svg +1 -0
- package/svg/user-management.svg +1 -0
- package/svg/user-profile-filled.svg +1 -0
- package/svg/user-profile.svg +1 -0
- package/svg/user-reading-reading.svg +1 -0
- package/svg/user-reading.svg +1 -0
- package/svg/user-settings-filled.svg +1 -0
- package/svg/user-settings.svg +1 -0
- package/svg/user.svg +1 -0
- package/svg/validate.svg +1 -0
- package/svg/vdi-folder.svg +1 -0
- package/svg/version-history.svg +1 -0
- package/svg/video-file-filled.svg +1 -0
- package/svg/video-file.svg +1 -0
- package/svg/warning-filled.svg +1 -0
- package/svg/warning-rhomb-filled.svg +1 -0
- package/svg/warning-rhomb.svg +1 -0
- package/svg/warning.svg +1 -0
- package/svg/water-bathing.svg +1 -0
- package/svg/water-fish.svg +1 -0
- package/svg/water-plant.svg +1 -0
- package/svg/water-sunbathing.svg +1 -0
- package/svg/waveform.svg +1 -0
- package/svg/webcam-cancelled-filled.svg +1 -0
- package/svg/webcam-cancelled.svg +1 -0
- package/svg/webcam-filled.svg +1 -0
- package/svg/webcam.svg +1 -0
- package/svg/wlan-off.svg +1 -0
- package/svg/wlan-strength-0.svg +1 -0
- package/svg/wlan-strength-1.svg +1 -0
- package/svg/wlan-strength-2.svg +1 -0
- package/svg/wlan-strength-3.svg +1 -0
- package/svg/work-case-filled.svg +1 -0
- package/svg/work-case.svg +1 -0
- package/svg/workspace.svg +1 -0
- package/svg/workspaces.svg +1 -0
- package/svg/x-axis-settings.svg +1 -0
- package/svg/xls-document.svg +1 -0
- package/svg/xml-document.svg +1 -0
- package/svg/y-axis-settings.svg +1 -0
- package/svg/youtube-filled.svg +1 -0
- package/svg/youtube.svg +1 -0
- package/svg/zoom-in.svg +1 -0
- package/svg/zoom-out.svg +1 -0
- package/svg/zoom-selection.svg +1 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* COPYRIGHT (c) Siemens AG 2018-2024 ALL RIGHTS RESERVED.
|
|
3
|
+
*/
|
|
4
|
+
function getV3PreviewMetaElement() {
|
|
5
|
+
return document.querySelector("meta[name='ix-icons:v3-preview']");
|
|
6
|
+
}
|
|
7
|
+
function getV3PreviewMetaContent() {
|
|
8
|
+
const v3PreviewMetaElement = getV3PreviewMetaElement();
|
|
9
|
+
if (v3PreviewMetaElement) {
|
|
10
|
+
return v3PreviewMetaElement.getAttribute('content').split(';');
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Provide custom svg path for icons
|
|
16
|
+
*
|
|
17
|
+
* <meta name="ix-icons:path" content="/build/svg" />
|
|
18
|
+
*/
|
|
19
|
+
export function getCustomAssetUrl() {
|
|
20
|
+
const assetPath = document.querySelector("meta[name='ix-icons:path']");
|
|
21
|
+
if (assetPath) {
|
|
22
|
+
const path = assetPath.getAttribute('content');
|
|
23
|
+
return path;
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Enable v3 preview features
|
|
29
|
+
*
|
|
30
|
+
* <meta name="ix-icons:v3-preview" content="svg-path-loading;" />
|
|
31
|
+
*/
|
|
32
|
+
export function isV3PreviewEnabled() {
|
|
33
|
+
const features = getV3PreviewMetaContent();
|
|
34
|
+
if (!features) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
if (features.includes('svg-path-loading')) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=meta-tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta-tag.js","sourceRoot":"","sources":["../../../src/components/icon/meta-tag.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS,uBAAuB;IAC9B,OAAO,QAAQ,CAAC,aAAa,CAAC,kCAAkC,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,uBAAuB;IAC9B,MAAM,oBAAoB,GAAG,uBAAuB,EAAE,CAAC;IACvD,IAAI,oBAAoB,EAAE,CAAC;QACzB,OAAO,oBAAoB,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjE,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,4BAA4B,CAAC,CAAC;IACvE,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,QAAQ,GAAG,uBAAuB,EAAE,CAAC;IAE3C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,QAAQ,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/*\n * COPYRIGHT (c) Siemens AG 2018-2024 ALL RIGHTS RESERVED.\n */\n\nfunction getV3PreviewMetaElement() {\n return document.querySelector(\"meta[name='ix-icons:v3-preview']\");\n}\n\nfunction getV3PreviewMetaContent() {\n const v3PreviewMetaElement = getV3PreviewMetaElement();\n if (v3PreviewMetaElement) {\n return v3PreviewMetaElement.getAttribute('content').split(';');\n }\n\n return null;\n}\n\n/**\n * Provide custom svg path for icons\n *\n * <meta name=\"ix-icons:path\" content=\"/build/svg\" />\n */\nexport function getCustomAssetUrl() {\n const assetPath = document.querySelector(\"meta[name='ix-icons:path']\");\n if (assetPath) {\n const path = assetPath.getAttribute('content');\n return path;\n }\n\n return false;\n}\n\n/**\n * Enable v3 preview features\n *\n * <meta name=\"ix-icons:v3-preview\" content=\"svg-path-loading;\" />\n */\nexport function isV3PreviewEnabled() {\n const features = getV3PreviewMetaContent();\n\n if (!features) {\n return false;\n }\n\n if (features.includes('svg-path-loading')) {\n return true;\n }\n\n return false;\n}\n"]}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: 2023 Siemens AG
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
import { getAssetPath } from "@stencil/core";
|
|
10
|
+
import { getCustomAssetUrl, isV3PreviewEnabled } from "./meta-tag";
|
|
11
|
+
let fetchCatch;
|
|
12
|
+
const requests = new Map();
|
|
13
|
+
let parser = null;
|
|
14
|
+
function toCamelCase(value) {
|
|
15
|
+
value = value.replace(/[\(\)\[\]\{\}\=\?\!\.\:,\-_\+\\\"#~\/]/g, ' ');
|
|
16
|
+
let returnValue = '';
|
|
17
|
+
let makeNextUppercase = true;
|
|
18
|
+
value = value.toLowerCase();
|
|
19
|
+
for (let i = 0; value.length > i; i++) {
|
|
20
|
+
let c = value.charAt(i);
|
|
21
|
+
if (c.match(/^\s+$/g) || c.match(/[\(\)\[\]\{\}\\\/]/g)) {
|
|
22
|
+
makeNextUppercase = true;
|
|
23
|
+
}
|
|
24
|
+
else if (makeNextUppercase) {
|
|
25
|
+
c = c.toUpperCase();
|
|
26
|
+
makeNextUppercase = false;
|
|
27
|
+
}
|
|
28
|
+
returnValue += c;
|
|
29
|
+
}
|
|
30
|
+
const normalized = returnValue.replace(/\s+/g, '');
|
|
31
|
+
return normalized.charAt(0).toUpperCase() + normalized.slice(1);
|
|
32
|
+
}
|
|
33
|
+
export const getIconCacheMap = () => {
|
|
34
|
+
if (typeof window === 'undefined') {
|
|
35
|
+
return new Map();
|
|
36
|
+
}
|
|
37
|
+
if (!fetchCatch) {
|
|
38
|
+
window.IxIcons = window.IxIcons || {};
|
|
39
|
+
fetchCatch = window.IxIcons.map = window.IxIcons.map || new Map();
|
|
40
|
+
}
|
|
41
|
+
return fetchCatch;
|
|
42
|
+
};
|
|
43
|
+
export const isSvgDataUrl = (url) => {
|
|
44
|
+
if (!url) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
if (typeof url !== 'string') {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return url.startsWith('data:image/svg+xml');
|
|
51
|
+
};
|
|
52
|
+
export function parseSVGDataContent(content) {
|
|
53
|
+
if (typeof window['DOMParser'] === 'undefined') {
|
|
54
|
+
console.warn('DOMParser not supported by your browser.');
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (parser === null) {
|
|
58
|
+
parser = new window['DOMParser']();
|
|
59
|
+
}
|
|
60
|
+
const svgDocument = parser.parseFromString(content, 'text/html');
|
|
61
|
+
const svgElement = svgDocument.querySelector('svg');
|
|
62
|
+
if (!svgElement) {
|
|
63
|
+
throw Error('No valid svg data provided');
|
|
64
|
+
}
|
|
65
|
+
return svgElement.outerHTML;
|
|
66
|
+
}
|
|
67
|
+
async function fetchSVG(url) {
|
|
68
|
+
const cache = getIconCacheMap();
|
|
69
|
+
if (cache.has(url)) {
|
|
70
|
+
return cache.get(url);
|
|
71
|
+
}
|
|
72
|
+
const response = await fetch(url);
|
|
73
|
+
const responseText = await response.text();
|
|
74
|
+
if (!response.ok) {
|
|
75
|
+
console.error(responseText);
|
|
76
|
+
throw Error(responseText);
|
|
77
|
+
}
|
|
78
|
+
const svgContent = parseSVGDataContent(responseText);
|
|
79
|
+
cache.set(url, svgContent);
|
|
80
|
+
return svgContent;
|
|
81
|
+
}
|
|
82
|
+
const urlRegex = /^(?:(?:https?|ftp):\/\/)?(?:\S+(?::\S*)?@)?(?:www\.)?(?:\S+\.\S+)(?:\S*)$/i;
|
|
83
|
+
function isValidUrl(url) {
|
|
84
|
+
return urlRegex.test(url);
|
|
85
|
+
}
|
|
86
|
+
function getAssetUrl(name) {
|
|
87
|
+
const customAssetUrl = getCustomAssetUrl();
|
|
88
|
+
if (customAssetUrl) {
|
|
89
|
+
return `${customAssetUrl}/${name}.svg`;
|
|
90
|
+
}
|
|
91
|
+
return getAssetPath(`svg/${name}.svg`);
|
|
92
|
+
}
|
|
93
|
+
async function getESMIcon(name) {
|
|
94
|
+
const esmIcon = await import('./icons');
|
|
95
|
+
let iconName = toCamelCase(name);
|
|
96
|
+
iconName = `icon${iconName}`;
|
|
97
|
+
return parseSVGDataContent(esmIcon[iconName]);
|
|
98
|
+
}
|
|
99
|
+
export async function resolveIcon(iconName) {
|
|
100
|
+
if (!iconName) {
|
|
101
|
+
throw Error('No icon name provided');
|
|
102
|
+
}
|
|
103
|
+
if (isSvgDataUrl(iconName)) {
|
|
104
|
+
return parseSVGDataContent(iconName);
|
|
105
|
+
}
|
|
106
|
+
if (isValidUrl(iconName)) {
|
|
107
|
+
try {
|
|
108
|
+
return fetchSVG(iconName);
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
throw error;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (isV3PreviewEnabled()) {
|
|
115
|
+
console.warn('Using V3 preview feature for loading icons.');
|
|
116
|
+
try {
|
|
117
|
+
const request = requests.get(iconName);
|
|
118
|
+
if (!request) {
|
|
119
|
+
const fetching = fetchSVG(getAssetUrl(iconName));
|
|
120
|
+
requests.set(iconName, fetching);
|
|
121
|
+
return fetching;
|
|
122
|
+
}
|
|
123
|
+
return request;
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
throw Error('Cannot resolve any icon');
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return getESMIcon(iconName);
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=resolveIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveIcon.js","sourceRoot":"","sources":["../../../src/components/icon/resolveIcon.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAQnE,IAAI,UAA+B,CAAC;AACpC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA2B,CAAC;AACpD,IAAI,MAAM,GAAG,IAAI,CAAC;AAElB,SAAS,WAAW,CAAC,KAAa;IAChC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,yCAAyC,EAAE,GAAG,CAAC,CAAC;IACtE,IAAI,WAAW,GAAG,EAAE,CAAC;IACrB,IAAI,iBAAiB,GAAG,IAAI,CAAC;IAC7B,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,EAAE,CAAC;YACxD,iBAAiB,GAAG,IAAI,CAAC;QAC3B,CAAC;aAAM,IAAI,iBAAiB,EAAE,CAAC;YAC7B,CAAC,GAAG,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,CAAC;YAClB,CAAC;YAED,OAAO,OAAO,CAAC;QACjB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,KAAK,CAAC,yBAAyB,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { getAssetPath } from '@stencil/core';\nimport { getCustomAssetUrl, isV3PreviewEnabled } from './meta-tag';\n\ndeclare global {\n interface Window {\n IxIcons: any;\n }\n}\n\nlet fetchCatch: Map<string, string>;\nconst requests = new Map<string, Promise<string>>();\nlet parser = null;\n\nfunction toCamelCase(value: string) {\n value = value.replace(/[\\(\\)\\[\\]\\{\\}\\=\\?\\!\\.\\:,\\-_\\+\\\\\\\"#~\\/]/g, ' ');\n let returnValue = '';\n let makeNextUppercase = true;\n value = value.toLowerCase();\n for (let i = 0; value.length > i; i++) {\n let c = value.charAt(i);\n if (c.match(/^\\s+$/g) || c.match(/[\\(\\)\\[\\]\\{\\}\\\\\\/]/g)) {\n makeNextUppercase = true;\n } else if (makeNextUppercase) {\n c = c.toUpperCase();\n makeNextUppercase = false;\n }\n returnValue += c;\n }\n const normalized = returnValue.replace(/\\s+/g, '');\n return normalized.charAt(0).toUpperCase() + normalized.slice(1);\n}\n\nexport const getIconCacheMap = (): Map<string, string> => {\n if (typeof window === 'undefined') {\n return new Map();\n }\n\n if (!fetchCatch) {\n window.IxIcons = window.IxIcons || {};\n fetchCatch = window.IxIcons.map = window.IxIcons.map || new Map();\n }\n return fetchCatch;\n};\n\nexport const isSvgDataUrl = (url: string) => {\n if (!url) {\n return false;\n }\n\n if (typeof url !== 'string') {\n return false;\n }\n\n return url.startsWith('data:image/svg+xml');\n};\n\nexport function parseSVGDataContent(content: string) {\n if (typeof window['DOMParser'] === 'undefined') {\n console.warn('DOMParser not supported by your browser.');\n return;\n }\n\n if (parser === null) {\n parser = new window['DOMParser']();\n }\n\n const svgDocument = parser.parseFromString(content, 'text/html');\n const svgElement = svgDocument.querySelector('svg') as HTMLElement;\n\n if (!svgElement) {\n throw Error('No valid svg data provided');\n }\n\n return svgElement.outerHTML;\n}\n\nasync function fetchSVG(url: string) {\n const cache = getIconCacheMap();\n\n if (cache.has(url)) {\n return cache.get(url);\n }\n\n const response = await fetch(url);\n const responseText = await response.text();\n\n if (!response.ok) {\n console.error(responseText);\n throw Error(responseText);\n }\n\n const svgContent = parseSVGDataContent(responseText);\n cache.set(url, svgContent);\n return svgContent;\n}\nconst urlRegex = /^(?:(?:https?|ftp):\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:www\\.)?(?:\\S+\\.\\S+)(?:\\S*)$/i;\n\nfunction isValidUrl(url: string) {\n return urlRegex.test(url);\n}\n\nfunction getAssetUrl(name: string) {\n const customAssetUrl = getCustomAssetUrl();\n if (customAssetUrl) {\n return `${customAssetUrl}/${name}.svg`;\n }\n\n return getAssetPath(`svg/${name}.svg`);\n}\n\nasync function getESMIcon(name: string) {\n const esmIcon = await import('./icons');\n let iconName = toCamelCase(name);\n iconName = `icon${iconName}`;\n\n return parseSVGDataContent(esmIcon[iconName]);\n}\n\nexport async function resolveIcon(iconName: string) {\n if (!iconName) {\n throw Error('No icon name provided');\n }\n\n if (isSvgDataUrl(iconName)) {\n return parseSVGDataContent(iconName);\n }\n\n if (isValidUrl(iconName)) {\n try {\n return fetchSVG(iconName);\n } catch (error) {\n throw error;\n }\n }\n\n if (isV3PreviewEnabled()) {\n console.warn('Using V3 preview feature for loading icons.');\n try {\n const request = requests.get(iconName);\n\n if (!request) {\n const fetching = fetchSVG(getAssetUrl(iconName));\n requests.set(iconName, fetching);\n return fetching;\n }\n\n return request;\n } catch (error) {\n throw Error('Cannot resolve any icon');\n }\n }\n\n return getESMIcon(iconName);\n}\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* COPYRIGHT (c) Siemens AG 2018-2023 ALL RIGHTS RESERVED.
|
|
3
|
+
*/
|
|
4
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
5
|
+
import { Icon } from "../icon";
|
|
6
|
+
import { rocket } from "./rocker-example";
|
|
7
|
+
//@ts-ignore
|
|
8
|
+
global.fetch = jest.fn(() => Promise.resolve({
|
|
9
|
+
ok: true,
|
|
10
|
+
text: () => Promise.resolve(`
|
|
11
|
+
<svg height="512px" version="1.1" viewBox="0 0 512 512" width="512px" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg">
|
|
12
|
+
<g fill="none" fill-rule="evenodd" id="Page-1" stroke="none" stroke-width="1">
|
|
13
|
+
<g id="icon" transform="translate(42.666667, 64.000000)">
|
|
14
|
+
<path d="M405.333333,1.42108547e-14 C396.316305,122.794806 364.316305,211.683695 309.333333,266.666667 C299.582265,276.417735 288.905446,285.33185 277.302879,293.409011 L277.302464,341.234872 L213.302464,405.234872 L174.248,336.891 L68.525,231.157 L7.10542736e-15,192 L64,128 L112.079613,128.000404 C120.083859,116.387258 128.94621,105.720457 138.666667,96 C193.649638,41.0170286 282.538527,9.01702859 405.333333,1.42108547e-14 Z M357.333333,47.9786667 L348.203556,49.3631108 C266.32942,62.2476147 206.763982,88.2424635 168.836556,126.169889 C146.004433,149.002012 128.637057,178.732412 116.876114,215.881246 L116.096,218.389333 L187.584,289.877333 L191.120585,288.76541 C224.531258,277.548675 251.975141,261.807487 273.818948,241.632769 L279.163444,236.496777 C317.09087,198.569351 343.085719,139.003914 355.970222,57.1297769 L357.333333,47.9786667 Z M75.9901363,269.368015 L30.7353023,314.622849 L0.565412939,284.452959 L45.8202469,239.198125 L75.9901363,269.368015 Z M121.24497,314.622849 L45.8202469,390.047572 L15.6503576,359.877683 L91.0750809,284.452959 L121.24497,314.622849 Z M136.329915,329.707793 L166.499804,359.877683 L121.24497,405.132517 L91.0750809,374.962627 L136.329915,329.707793 Z M245.333333,128 C263.006445,128 277.333333,142.326888 277.333333,160 C277.333333,177.673112 263.006445,192 245.333333,192 C227.660221,192 213.333333,177.673112 213.333333,160 C213.333333,142.326888 227.660221,128 245.333333,128 Z" id="Combined-Shape"></path>
|
|
15
|
+
</g>
|
|
16
|
+
</g>
|
|
17
|
+
</svg>
|
|
18
|
+
`),
|
|
19
|
+
}));
|
|
20
|
+
describe('ix-icon', () => {
|
|
21
|
+
beforeEach(() => {
|
|
22
|
+
//@ts-ignore
|
|
23
|
+
fetch.mockClear();
|
|
24
|
+
});
|
|
25
|
+
it('should render base64 data url svg via src attribute', async () => {
|
|
26
|
+
const page = await newSpecPage({
|
|
27
|
+
components: [Icon],
|
|
28
|
+
html: `<ix-icon name="${rocket}"></ix-icon>`,
|
|
29
|
+
});
|
|
30
|
+
expect(page.root.shadowRoot).toEqualHtml(`
|
|
31
|
+
<div class="svg-container">
|
|
32
|
+
<svg height="512px" version="1.1" viewBox="0 0 512 512" width="512px" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg">
|
|
33
|
+
<g fill="none" fill-rule="evenodd" id="Page-1" stroke="none" stroke-width="1">
|
|
34
|
+
<g id="icon" transform="translate(42.666667, 64.000000)">
|
|
35
|
+
<path d="M405.333333,1.42108547e-14 C396.316305,122.794806 364.316305,211.683695 309.333333,266.666667 C299.582265,276.417735 288.905446,285.33185 277.302879,293.409011 L277.302464,341.234872 L213.302464,405.234872 L174.248,336.891 L68.525,231.157 L7.10542736e-15,192 L64,128 L112.079613,128.000404 C120.083859,116.387258 128.94621,105.720457 138.666667,96 C193.649638,41.0170286 282.538527,9.01702859 405.333333,1.42108547e-14 Z M357.333333,47.9786667 L348.203556,49.3631108 C266.32942,62.2476147 206.763982,88.2424635 168.836556,126.169889 C146.004433,149.002012 128.637057,178.732412 116.876114,215.881246 L116.096,218.389333 L187.584,289.877333 L191.120585,288.76541 C224.531258,277.548675 251.975141,261.807487 273.818948,241.632769 L279.163444,236.496777 C317.09087,198.569351 343.085719,139.003914 355.970222,57.1297769 L357.333333,47.9786667 Z M75.9901363,269.368015 L30.7353023,314.622849 L0.565412939,284.452959 L45.8202469,239.198125 L75.9901363,269.368015 Z M121.24497,314.622849 L45.8202469,390.047572 L15.6503576,359.877683 L91.0750809,284.452959 L121.24497,314.622849 Z M136.329915,329.707793 L166.499804,359.877683 L121.24497,405.132517 L91.0750809,374.962627 L136.329915,329.707793 Z M245.333333,128 C263.006445,128 277.333333,142.326888 277.333333,160 C277.333333,177.673112 263.006445,192 245.333333,192 C227.660221,192 213.333333,177.673112 213.333333,160 C213.333333,142.326888 227.660221,128 245.333333,128 Z" id="Combined-Shape"></path>
|
|
36
|
+
</g>
|
|
37
|
+
</g>
|
|
38
|
+
</svg>
|
|
39
|
+
</div>
|
|
40
|
+
`);
|
|
41
|
+
});
|
|
42
|
+
it('should show error placeholder if svg is not found', async () => {
|
|
43
|
+
//@ts-ignore
|
|
44
|
+
global.fetch = jest.fn(() => Promise.resolve({
|
|
45
|
+
ok: false,
|
|
46
|
+
text: () => Promise.resolve(`ERROR!`),
|
|
47
|
+
}));
|
|
48
|
+
const page = await newSpecPage({
|
|
49
|
+
components: [Icon],
|
|
50
|
+
html: `<ix-icon name="/data/not-existing.svg"></ix-icon>`,
|
|
51
|
+
});
|
|
52
|
+
expect(page.root.shadowRoot).toEqualHtml(`
|
|
53
|
+
<div class=\"svg-container\">
|
|
54
|
+
<svg height=\"512\" viewBox=\"0 0 512 512\" width=\"512\" xmlns=\"http://www.w3.org/2000/svg\">
|
|
55
|
+
<path d=\"M384,0 L384,384 L0,384 L0,0 L384,0 Z M192,207.085 L57.751,341.333 L326.248,341.333 L192,207.085 Z M42.666,57.751 L42.666,326.248 L176.915,192 L42.666,57.751 Z M341.333,57.751 L207.085,192 L341.333,326.248 L341.333,57.751 Z M326.248,42.666 L57.751,42.666 L192,176.915 L326.248,42.666 Z\" fill-rule=\"evenodd\" transform=\"translate(64 64)\"></path>
|
|
56
|
+
</svg>
|
|
57
|
+
</div>
|
|
58
|
+
`);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=ix-icon.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ix-icon.spec.js","sourceRoot":"","sources":["../../../../src/components/icon/test/ix-icon.spec.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,YAAY;AACZ,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAC1B,OAAO,CAAC,OAAO,CAAC;IACd,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,GAAG,EAAE,CACT,OAAO,CAAC,OAAO,CAAC;;;;;;;;KAQjB,CAAC;CACH,CAAC,CACH,CAAC;AAEF,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,UAAU,CAAC,GAAG,EAAE;QACd,YAAY;QACZ,KAAK,CAAC,SAAS,EAAE,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE,KAAK,IAAI,EAAE;QACnE,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,IAAI,CAAC;YAClB,IAAI,EAAE,kBAAkB,MAAM,cAAc;SAC7C,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;KAUxC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;QACjE,YAAY;QACZ,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAC1B,OAAO,CAAC,OAAO,CAAC;YACd,EAAE,EAAE,KAAK;YACT,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;SACtC,CAAC,CACH,CAAC;QAEF,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,IAAI,CAAC;YAClB,IAAI,EAAE,mDAAmD;SAC1D,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC;;;;;;KAMxC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/*\n * COPYRIGHT (c) Siemens AG 2018-2023 ALL RIGHTS RESERVED.\n */\nimport { newSpecPage } from '@stencil/core/testing';\nimport { Icon } from '../icon';\nimport { rocket } from './rocker-example';\n\n//@ts-ignore\nglobal.fetch = jest.fn(() =>\n Promise.resolve({\n ok: true,\n text: () =>\n Promise.resolve(`\n <svg height=\"512px\" version=\"1.1\" viewBox=\"0 0 512 512\" width=\"512px\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://www.w3.org/2000/svg\">\n <g fill=\"none\" fill-rule=\"evenodd\" id=\"Page-1\" stroke=\"none\" stroke-width=\"1\">\n <g id=\"icon\" transform=\"translate(42.666667, 64.000000)\">\n <path d=\"M405.333333,1.42108547e-14 C396.316305,122.794806 364.316305,211.683695 309.333333,266.666667 C299.582265,276.417735 288.905446,285.33185 277.302879,293.409011 L277.302464,341.234872 L213.302464,405.234872 L174.248,336.891 L68.525,231.157 L7.10542736e-15,192 L64,128 L112.079613,128.000404 C120.083859,116.387258 128.94621,105.720457 138.666667,96 C193.649638,41.0170286 282.538527,9.01702859 405.333333,1.42108547e-14 Z M357.333333,47.9786667 L348.203556,49.3631108 C266.32942,62.2476147 206.763982,88.2424635 168.836556,126.169889 C146.004433,149.002012 128.637057,178.732412 116.876114,215.881246 L116.096,218.389333 L187.584,289.877333 L191.120585,288.76541 C224.531258,277.548675 251.975141,261.807487 273.818948,241.632769 L279.163444,236.496777 C317.09087,198.569351 343.085719,139.003914 355.970222,57.1297769 L357.333333,47.9786667 Z M75.9901363,269.368015 L30.7353023,314.622849 L0.565412939,284.452959 L45.8202469,239.198125 L75.9901363,269.368015 Z M121.24497,314.622849 L45.8202469,390.047572 L15.6503576,359.877683 L91.0750809,284.452959 L121.24497,314.622849 Z M136.329915,329.707793 L166.499804,359.877683 L121.24497,405.132517 L91.0750809,374.962627 L136.329915,329.707793 Z M245.333333,128 C263.006445,128 277.333333,142.326888 277.333333,160 C277.333333,177.673112 263.006445,192 245.333333,192 C227.660221,192 213.333333,177.673112 213.333333,160 C213.333333,142.326888 227.660221,128 245.333333,128 Z\" id=\"Combined-Shape\"></path>\n </g>\n </g>\n </svg>\n `),\n }),\n);\n\ndescribe('ix-icon', () => {\n beforeEach(() => {\n //@ts-ignore\n fetch.mockClear();\n });\n\n it('should render base64 data url svg via src attribute', async () => {\n const page = await newSpecPage({\n components: [Icon],\n html: `<ix-icon name=\"${rocket}\"></ix-icon>`,\n });\n expect(page.root.shadowRoot).toEqualHtml(`\n <div class=\"svg-container\">\n <svg height=\"512px\" version=\"1.1\" viewBox=\"0 0 512 512\" width=\"512px\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://www.w3.org/2000/svg\">\n <g fill=\"none\" fill-rule=\"evenodd\" id=\"Page-1\" stroke=\"none\" stroke-width=\"1\">\n <g id=\"icon\" transform=\"translate(42.666667, 64.000000)\">\n <path d=\"M405.333333,1.42108547e-14 C396.316305,122.794806 364.316305,211.683695 309.333333,266.666667 C299.582265,276.417735 288.905446,285.33185 277.302879,293.409011 L277.302464,341.234872 L213.302464,405.234872 L174.248,336.891 L68.525,231.157 L7.10542736e-15,192 L64,128 L112.079613,128.000404 C120.083859,116.387258 128.94621,105.720457 138.666667,96 C193.649638,41.0170286 282.538527,9.01702859 405.333333,1.42108547e-14 Z M357.333333,47.9786667 L348.203556,49.3631108 C266.32942,62.2476147 206.763982,88.2424635 168.836556,126.169889 C146.004433,149.002012 128.637057,178.732412 116.876114,215.881246 L116.096,218.389333 L187.584,289.877333 L191.120585,288.76541 C224.531258,277.548675 251.975141,261.807487 273.818948,241.632769 L279.163444,236.496777 C317.09087,198.569351 343.085719,139.003914 355.970222,57.1297769 L357.333333,47.9786667 Z M75.9901363,269.368015 L30.7353023,314.622849 L0.565412939,284.452959 L45.8202469,239.198125 L75.9901363,269.368015 Z M121.24497,314.622849 L45.8202469,390.047572 L15.6503576,359.877683 L91.0750809,284.452959 L121.24497,314.622849 Z M136.329915,329.707793 L166.499804,359.877683 L121.24497,405.132517 L91.0750809,374.962627 L136.329915,329.707793 Z M245.333333,128 C263.006445,128 277.333333,142.326888 277.333333,160 C277.333333,177.673112 263.006445,192 245.333333,192 C227.660221,192 213.333333,177.673112 213.333333,160 C213.333333,142.326888 227.660221,128 245.333333,128 Z\" id=\"Combined-Shape\"></path>\n </g>\n </g>\n </svg>\n </div>\n `);\n });\n\n it('should show error placeholder if svg is not found', async () => {\n //@ts-ignore\n global.fetch = jest.fn(() =>\n Promise.resolve({\n ok: false,\n text: () => Promise.resolve(`ERROR!`),\n }),\n );\n\n const page = await newSpecPage({\n components: [Icon],\n html: `<ix-icon name=\"/data/not-existing.svg\"></ix-icon>`,\n });\n\n expect(page.root.shadowRoot).toEqualHtml(`\n <div class=\\\"svg-container\\\">\n <svg height=\\\"512\\\" viewBox=\\\"0 0 512 512\\\" width=\\\"512\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\n <path d=\\\"M384,0 L384,384 L0,384 L0,0 L384,0 Z M192,207.085 L57.751,341.333 L326.248,341.333 L192,207.085 Z M42.666,57.751 L42.666,326.248 L176.915,192 L42.666,57.751 Z M341.333,57.751 L207.085,192 L341.333,326.248 L341.333,57.751 Z M326.248,42.666 L57.751,42.666 L192,176.915 L326.248,42.666 Z\\\" fill-rule=\\\"evenodd\\\" transform=\\\"translate(64 64)\\\"></path>\n </svg>\n </div>\n `);\n });\n});\n"]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* COPYRIGHT (c) Siemens AG 2018-2023 ALL RIGHTS RESERVED.
|
|
3
|
+
*/
|
|
4
|
+
import * as metaTag from "./../meta-tag";
|
|
5
|
+
import { resolveIcon } from "../resolveIcon";
|
|
6
|
+
const exampleSvg = `
|
|
7
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
8
|
+
<svg width="512px" height="512px" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
9
|
+
<title>add</title>
|
|
10
|
+
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
11
|
+
<g id="Shape" fill="#000000" transform="translate(65.929697, 65.929697)">
|
|
12
|
+
<polygon points="211.189225 2.36847579e-14 211.189225 168.95138 380.140606 168.95138 380.140606 211.189225 211.189225 211.189225 211.189225 380.140606 168.95138 380.140606 168.95138 211.189225 -1.42108547e-14 211.189225 -1.42108547e-14 168.95138 168.95138 168.95138 168.95138 -1.42108547e-14"></polygon>
|
|
13
|
+
</g>
|
|
14
|
+
</g>
|
|
15
|
+
</svg>
|
|
16
|
+
`;
|
|
17
|
+
const invalidexampleSvg = `
|
|
18
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
19
|
+
<script>
|
|
20
|
+
alert('Test!');
|
|
21
|
+
</script>
|
|
22
|
+
`;
|
|
23
|
+
jest.mock('../meta-tag');
|
|
24
|
+
jest.mock('../icons', () => ({
|
|
25
|
+
iconStar: exampleSvg,
|
|
26
|
+
}));
|
|
27
|
+
let fetch = (global.fetch = jest.fn((url) => {
|
|
28
|
+
console.log(url);
|
|
29
|
+
if (url === '/svg/bulb.svg') {
|
|
30
|
+
return Promise.resolve({
|
|
31
|
+
text: () => Promise.resolve(exampleSvg),
|
|
32
|
+
ok: true,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
if (url === 'http://localhost/test.svg') {
|
|
36
|
+
return Promise.resolve({
|
|
37
|
+
text: () => Promise.resolve(exampleSvg),
|
|
38
|
+
ok: true,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (url === 'http://localhost/invalid.svg') {
|
|
42
|
+
return Promise.resolve({
|
|
43
|
+
text: () => Promise.resolve(invalidexampleSvg),
|
|
44
|
+
ok: true,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}));
|
|
48
|
+
describe('resolve icon', () => {
|
|
49
|
+
beforeEach(() => {
|
|
50
|
+
fetch.mockClear();
|
|
51
|
+
});
|
|
52
|
+
it('should resolve svg from name', async () => {
|
|
53
|
+
const icon = 'star';
|
|
54
|
+
const data = await resolveIcon(icon);
|
|
55
|
+
expect(data).toBe(`<svg width=\"512px\" height=\"512px\" viewBox=\"0 0 512 512\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"> <title>add</title> <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"> <g id=\"Shape\" fill=\"#000000\" transform=\"translate(65.929697, 65.929697)\"> <polygon points=\"211.189225 2.36847579e-14 211.189225 168.95138 380.140606 168.95138 380.140606 211.189225 211.189225 211.189225 211.189225 380.140606 168.95138 380.140606 168.95138 211.189225 -1.42108547e-14 211.189225 -1.42108547e-14 168.95138 168.95138 168.95138 168.95138 -1.42108547e-14\"></polygon> </g> </g> </svg>`);
|
|
56
|
+
});
|
|
57
|
+
it('resolve by v3 preview feature flat', async () => {
|
|
58
|
+
metaTag.isV3PreviewEnabled = jest.fn(() => true);
|
|
59
|
+
const icon = 'bulb';
|
|
60
|
+
const data = await resolveIcon(icon);
|
|
61
|
+
expect(data).toBe(`<svg width=\"512px\" height=\"512px\" viewBox=\"0 0 512 512\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"> <title>add</title> <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"> <g id=\"Shape\" fill=\"#000000\" transform=\"translate(65.929697, 65.929697)\"> <polygon points=\"211.189225 2.36847579e-14 211.189225 168.95138 380.140606 168.95138 380.140606 211.189225 211.189225 211.189225 211.189225 380.140606 168.95138 380.140606 168.95138 211.189225 -1.42108547e-14 211.189225 -1.42108547e-14 168.95138 168.95138 168.95138 168.95138 -1.42108547e-14\"></polygon> </g> </g> </svg>`);
|
|
62
|
+
});
|
|
63
|
+
it('should resolve svg from src', async () => {
|
|
64
|
+
const expectedName = await resolveIcon('http://localhost/test.svg');
|
|
65
|
+
expect(expectedName).toEqual(`<svg width=\"512px\" height=\"512px\" viewBox=\"0 0 512 512\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"> <title>add</title> <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"> <g id=\"Shape\" fill=\"#000000\" transform=\"translate(65.929697, 65.929697)\"> <polygon points=\"211.189225 2.36847579e-14 211.189225 168.95138 380.140606 168.95138 380.140606 211.189225 211.189225 211.189225 211.189225 380.140606 168.95138 380.140606 168.95138 211.189225 -1.42108547e-14 211.189225 -1.42108547e-14 168.95138 168.95138 168.95138 168.95138 -1.42108547e-14\"></polygon> </g> </g> </svg>`);
|
|
66
|
+
});
|
|
67
|
+
it('should not resolve invalid svg from src', async () => {
|
|
68
|
+
const icon = 'http://localhost/invalid.svg';
|
|
69
|
+
await expect(resolveIcon(icon)).rejects.toThrow('No valid svg data provided');
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=resolveIcon.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveIcon.spec.js","sourceRoot":"","sources":["../../../../src/components/icon/test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resolveIcon';\nconst exampleSvg = `\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg width=\"512px\" height=\"512px\" viewBox=\"0 0 512 512\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <title>add</title>\n <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <g id=\"Shape\" fill=\"#000000\" transform=\"translate(65.929697, 65.929697)\">\n <polygon points=\"211.189225 2.36847579e-14 211.189225 168.95138 380.140606 168.95138 380.140606 211.189225 211.189225 211.189225 211.189225 380.140606 168.95138 380.140606 168.95138 211.189225 -1.42108547e-14 211.189225 -1.42108547e-14 168.95138 168.95138 168.95138 168.95138 -1.42108547e-14\"></polygon>\n </g>\n </g>\n</svg>\n`;\n\nconst invalidexampleSvg = `\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<script>\n alert('Test!');\n</script>\n`;\n\njest.mock('../meta-tag');\njest.mock('../icons', () => ({\n iconStar: exampleSvg,\n}));\nlet fetch = (global.fetch = jest.fn((url: string) => {\n console.log(url);\n if (url === '/svg/bulb.svg') {\n return Promise.resolve({\n text: () => Promise.resolve(exampleSvg),\n ok: true,\n });\n }\n\n if (url === 'http://localhost/test.svg') {\n return Promise.resolve({\n text: () => Promise.resolve(exampleSvg),\n ok: true,\n });\n }\n\n if (url === 'http://localhost/invalid.svg') {\n return Promise.resolve({\n text: () => Promise.resolve(invalidexampleSvg),\n ok: true,\n });\n }\n}) as jest.Mock);\n\ndescribe('resolve icon', () => {\n beforeEach(() => {\n fetch.mockClear();\n });\n\n it('should resolve svg from name', async () => {\n const icon = 'star';\n const data = await resolveIcon(icon);\n\n expect(data).toBe(\n `<svg width=\\\"512px\\\" height=\\\"512px\\\" viewBox=\\\"0 0 512 512\\\" version=\\\"1.1\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\"> <title>add</title> <g id=\\\"Page-1\\\" stroke=\\\"none\\\" stroke-width=\\\"1\\\" fill=\\\"none\\\" fill-rule=\\\"evenodd\\\"> <g id=\\\"Shape\\\" fill=\\\"#000000\\\" transform=\\\"translate(65.929697, 65.929697)\\\"> <polygon points=\\\"211.189225 2.36847579e-14 211.189225 168.95138 380.140606 168.95138 380.140606 211.189225 211.189225 211.189225 211.189225 380.140606 168.95138 380.140606 168.95138 211.189225 -1.42108547e-14 211.189225 -1.42108547e-14 168.95138 168.95138 168.95138 168.95138 -1.42108547e-14\\\"></polygon> </g> </g> </svg>`,\n );\n });\n\n it('resolve by v3 preview feature flat', async () => {\n (metaTag as any).isV3PreviewEnabled = jest.fn(() => true);\n\n const icon = 'bulb';\n const data = await resolveIcon(icon);\n\n expect(data).toBe(\n `<svg width=\\\"512px\\\" height=\\\"512px\\\" viewBox=\\\"0 0 512 512\\\" version=\\\"1.1\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\"> <title>add</title> <g id=\\\"Page-1\\\" stroke=\\\"none\\\" stroke-width=\\\"1\\\" fill=\\\"none\\\" fill-rule=\\\"evenodd\\\"> <g id=\\\"Shape\\\" fill=\\\"#000000\\\" transform=\\\"translate(65.929697, 65.929697)\\\"> <polygon points=\\\"211.189225 2.36847579e-14 211.189225 168.95138 380.140606 168.95138 380.140606 211.189225 211.189225 211.189225 211.189225 380.140606 168.95138 380.140606 168.95138 211.189225 -1.42108547e-14 211.189225 -1.42108547e-14 168.95138 168.95138 168.95138 168.95138 -1.42108547e-14\\\"></polygon> </g> </g> </svg>`,\n );\n });\n\n it('should resolve svg from src', async () => {\n const expectedName = await resolveIcon('http://localhost/test.svg');\n\n expect(expectedName).toEqual(\n `<svg width=\\\"512px\\\" height=\\\"512px\\\" viewBox=\\\"0 0 512 512\\\" version=\\\"1.1\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\"> <title>add</title> <g id=\\\"Page-1\\\" stroke=\\\"none\\\" stroke-width=\\\"1\\\" fill=\\\"none\\\" fill-rule=\\\"evenodd\\\"> <g id=\\\"Shape\\\" fill=\\\"#000000\\\" transform=\\\"translate(65.929697, 65.929697)\\\"> <polygon points=\\\"211.189225 2.36847579e-14 211.189225 168.95138 380.140606 168.95138 380.140606 211.189225 211.189225 211.189225 211.189225 380.140606 168.95138 380.140606 168.95138 211.189225 -1.42108547e-14 211.189225 -1.42108547e-14 168.95138 168.95138 168.95138 168.95138 -1.42108547e-14\\\"></polygon> </g> </g> </svg>`,\n );\n });\n\n it('should not resolve invalid svg from src', async () => {\n const icon = 'http://localhost/invalid.svg';\n\n await expect(resolveIcon(icon)).rejects.toThrow('No valid svg data provided');\n });\n});\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* COPYRIGHT (c) Siemens AG 2018-2023 ALL RIGHTS RESERVED.
|
|
3
|
+
*/
|
|
4
|
+
export const rocket = "data:image/svg+xml;utf8,<?xml version='1.0' encoding='UTF-8'?><svg width='512px' height='512px' viewBox='0 0 512 512' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'><g id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'><g id='icon' transform='translate(42.666667, 64.000000)'><path d='M405.333333,1.42108547e-14 C396.316305,122.794806 364.316305,211.683695 309.333333,266.666667 C299.582265,276.417735 288.905446,285.33185 277.302879,293.409011 L277.302464,341.234872 L213.302464,405.234872 L174.248,336.891 L68.525,231.157 L7.10542736e-15,192 L64,128 L112.079613,128.000404 C120.083859,116.387258 128.94621,105.720457 138.666667,96 C193.649638,41.0170286 282.538527,9.01702859 405.333333,1.42108547e-14 Z M357.333333,47.9786667 L348.203556,49.3631108 C266.32942,62.2476147 206.763982,88.2424635 168.836556,126.169889 C146.004433,149.002012 128.637057,178.732412 116.876114,215.881246 L116.096,218.389333 L187.584,289.877333 L191.120585,288.76541 C224.531258,277.548675 251.975141,261.807487 273.818948,241.632769 L279.163444,236.496777 C317.09087,198.569351 343.085719,139.003914 355.970222,57.1297769 L357.333333,47.9786667 Z M75.9901363,269.368015 L30.7353023,314.622849 L0.565412939,284.452959 L45.8202469,239.198125 L75.9901363,269.368015 Z M121.24497,314.622849 L45.8202469,390.047572 L15.6503576,359.877683 L91.0750809,284.452959 L121.24497,314.622849 Z M136.329915,329.707793 L166.499804,359.877683 L121.24497,405.132517 L91.0750809,374.962627 L136.329915,329.707793 Z M245.333333,128 C263.006445,128 277.333333,142.326888 277.333333,160 C277.333333,177.673112 263.006445,192 245.333333,192 C227.660221,192 213.333333,177.673112 213.333333,160 C213.333333,142.326888 227.660221,128 245.333333,128 Z' id='Combined-Shape'/></g></g></svg>";
|
|
5
|
+
//# sourceMappingURL=rocker-example.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rocker-example.js","sourceRoot":"","sources":["../../../../src/components/icon/test/rocker-example.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GACjB,sxDAAsxD,CAAC","sourcesContent":["/*\n * COPYRIGHT (c) Siemens AG 2018-2023 ALL RIGHTS RESERVED.\n */\nexport const rocket =\n \"data:image/svg+xml;utf8,<?xml version='1.0' encoding='UTF-8'?><svg width='512px' height='512px' viewBox='0 0 512 512' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'><g id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'><g id='icon' transform='translate(42.666667, 64.000000)'><path d='M405.333333,1.42108547e-14 C396.316305,122.794806 364.316305,211.683695 309.333333,266.666667 C299.582265,276.417735 288.905446,285.33185 277.302879,293.409011 L277.302464,341.234872 L213.302464,405.234872 L174.248,336.891 L68.525,231.157 L7.10542736e-15,192 L64,128 L112.079613,128.000404 C120.083859,116.387258 128.94621,105.720457 138.666667,96 C193.649638,41.0170286 282.538527,9.01702859 405.333333,1.42108547e-14 Z M357.333333,47.9786667 L348.203556,49.3631108 C266.32942,62.2476147 206.763982,88.2424635 168.836556,126.169889 C146.004433,149.002012 128.637057,178.732412 116.876114,215.881246 L116.096,218.389333 L187.584,289.877333 L191.120585,288.76541 C224.531258,277.548675 251.975141,261.807487 273.818948,241.632769 L279.163444,236.496777 C317.09087,198.569351 343.085719,139.003914 355.970222,57.1297769 L357.333333,47.9786667 Z M75.9901363,269.368015 L30.7353023,314.622849 L0.565412939,284.452959 L45.8202469,239.198125 L75.9901363,269.368015 Z M121.24497,314.622849 L45.8202469,390.047572 L15.6503576,359.877683 L91.0750809,284.452959 L121.24497,314.622849 Z M136.329915,329.707793 L166.499804,359.877683 L121.24497,405.132517 L91.0750809,374.962627 L136.329915,329.707793 Z M245.333333,128 C263.006445,128 277.333333,142.326888 277.333333,160 C277.333333,177.673112 263.006445,192 245.333333,192 C227.660221,192 213.333333,177.673112 213.333333,160 C213.333333,142.326888 227.660221,128 245.333333,128 Z' id='Combined-Shape'/></g></g></svg>\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,wBAAwB,CAAC","sourcesContent":["export type { Components, JSX } from './components';\nexport * from './components/icon/icon';\n"]}
|