@webquark/core 1.1.0-dev.1 → 1.1.0-dev.3
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/dist/cjs/{Leaflet.GoogleMutant-BCs2oiE0.js → Leaflet.GoogleMutant-i4bYl6qy.js} +1 -2
- package/dist/cjs/{action.props-Bxf6g2CW.js → action.props-CkEZpMY6.js} +1 -1
- package/dist/cjs/chevron-up-Dysp_9UJ.js +30 -0
- package/dist/cjs/{index-D5SQkd__.js → index-B7ex88C2.js} +98 -20
- package/dist/cjs/index.cjs.js +3 -0
- package/dist/cjs/leaflet-maplibre-gl-BJKExsns.js +1031 -0
- package/dist/{esm/leaflet-src-BeeM-7Ku.js → cjs/leaflet-src-mrRg-Srs.js} +38 -7
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/q-alert.cjs.entry.js +1 -1
- package/dist/cjs/q-avatar.cjs.entry.js +1 -1
- package/dist/cjs/q-button_2.cjs.entry.js +2 -2
- package/dist/cjs/q-card.cjs.entry.js +1 -1
- package/dist/cjs/q-carousel.cjs.entry.js +1 -1
- package/dist/cjs/q-chip.cjs.entry.js +2 -2
- package/dist/cjs/q-conversation-bubble.cjs.entry.js +1 -1
- package/dist/cjs/q-data-table.cjs.entry.js +3 -2
- package/dist/cjs/q-dialog.cjs.entry.js +1 -1
- package/dist/cjs/q-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/q-form.cjs.entry.js +1 -1
- package/dist/cjs/q-icon.cjs.entry.js +63 -4
- package/dist/cjs/q-input_2.cjs.entry.js +2 -2
- package/dist/cjs/q-link.cjs.entry.js +2 -2
- package/dist/cjs/q-map.cjs.entry.js +184 -122
- package/dist/cjs/q-navbar.cjs.entry.js +1 -1
- package/dist/cjs/q-pagination.cjs.entry.js +1 -1
- package/dist/cjs/q-panel.cjs.entry.js +1 -1
- package/dist/cjs/q-quantity-selector.cjs.entry.js +1 -1
- package/dist/cjs/q-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/q-reel.cjs.entry.js +1 -1
- package/dist/cjs/q-scrollable.cjs.entry.js +1 -1
- package/dist/cjs/q-sidepanel.cjs.entry.js +190 -5
- package/dist/cjs/q-step-diagram-item.cjs.entry.js +1 -1
- package/dist/cjs/q-step-diagram.cjs.entry.js +1 -1
- package/dist/cjs/q-syntax-box.cjs.entry.js +57 -2
- package/dist/cjs/q-tabs.cjs.entry.js +1 -1
- package/dist/cjs/q-textarea.cjs.entry.js +1 -1
- package/dist/cjs/q-thumbnail.cjs.entry.js +1 -1
- package/dist/cjs/q-toast.cjs.entry.js +1 -1
- package/dist/cjs/q-toggle.cjs.entry.js +1 -1
- package/dist/cjs/q-toolbar.cjs.entry.js +1 -1
- package/dist/cjs/registry-BhkCNgxt.js +179 -0
- package/dist/cjs/webquark.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/data-display/data-table/internals/render-sort-indicator.js +2 -1
- package/dist/collection/components/data-display/syntax-box/syntax-box.js +2 -1
- package/dist/collection/components/inputs/input/input.css +13 -0
- package/dist/collection/components/layout/sidepanel/internals/nav-items.js +6 -2
- package/dist/collection/components/layout/sidepanel/sidepanel.css +23 -0
- package/dist/collection/components/layout/sidepanel/sidepanel.js +20 -1
- package/dist/collection/components/media/icon/icon.js +67 -6
- package/dist/collection/components/media/icon/internals/registry.js +171 -0
- package/dist/collection/components/media/icon/internals/registry.unit.test.js +42 -0
- package/dist/collection/components/media/icon/internals/render-definition.js +24 -0
- package/dist/collection/index.js +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/{p-Dd8ZWrLX.js → p-7oXL29Gu.js} +1 -1
- package/dist/components/p-BvBRW3dl.js +1 -0
- package/dist/components/p-BygmcFxM.js +1 -0
- package/dist/components/{p-xNd-aY2K.js → p-C8fq-feq.js} +1 -1
- package/dist/components/p-CFuqfXuv.js +9 -0
- package/dist/components/{p-DCICQbw4.js → p-CQofbR9q.js} +1 -1
- package/dist/components/p-CVtof65h.js +1 -0
- package/dist/components/{p-D-SCwJg6.js → p-Czf3kP0S.js} +1 -1
- package/dist/components/p-DYMWBqU1.js +5 -0
- package/dist/components/{p-DH-PVHhr.js → p-DuX-9GOi.js} +1 -1
- package/dist/components/{p-CBVOdtO_.js → p-I81wUKud.js} +1 -1
- package/dist/components/p-g9vOVxQ4.js +13 -0
- package/dist/components/{p-CXcle-2Q.js → p-vv3X99Ji.js} +1 -1
- package/dist/components/q-alert.js +1 -1
- package/dist/components/q-avatar.js +1 -1
- package/dist/components/q-button.js +1 -1
- package/dist/components/q-card.js +1 -1
- package/dist/components/q-carousel.js +1 -1
- package/dist/components/q-chip.js +1 -1
- package/dist/components/q-conversation-bubble.js +1 -1
- package/dist/components/q-data-table.js +1 -1
- package/dist/components/q-dialog.js +1 -1
- package/dist/components/q-dropdown.js +1 -1
- package/dist/components/q-form.js +1 -1
- package/dist/components/q-icon.js +1 -1
- package/dist/components/q-input.js +1 -1
- package/dist/components/q-link.js +1 -1
- package/dist/components/q-map.js +1 -1
- package/dist/components/q-navbar.js +1 -1
- package/dist/components/q-pagination.js +1 -1
- package/dist/components/q-panel.js +1 -1
- package/dist/components/q-progress.js +1 -1
- package/dist/components/q-quantity-selector.js +1 -1
- package/dist/components/q-radio-group.js +1 -1
- package/dist/components/q-reel.js +1 -1
- package/dist/components/q-scrollable.js +1 -1
- package/dist/components/q-sidepanel.js +13 -1
- package/dist/components/q-step-diagram-item.js +1 -1
- package/dist/components/q-step-diagram.js +1 -1
- package/dist/components/q-syntax-box.js +13 -1
- package/dist/components/q-tabs.js +1 -1
- package/dist/components/q-textarea.js +1 -1
- package/dist/components/q-thumbnail.js +1 -1
- package/dist/components/q-toast.js +1 -1
- package/dist/components/q-toggle.js +1 -1
- package/dist/components/q-toolbar.js +1 -1
- package/dist/components/q-tooltip.js +1 -1
- package/dist/esm/{Leaflet.GoogleMutant-BlvymWLE.js → Leaflet.GoogleMutant-MpxOb4Jm.js} +1 -2
- package/dist/esm/{action.props-CzaBbbcQ.js → action.props-CJoxGHR7.js} +1 -1
- package/dist/esm/chevron-up-g9vOVxQ4.js +27 -0
- package/dist/esm/{index-DOk7gYkf.js → index-VFWyFa-_.js} +98 -20
- package/dist/esm/index.js +1 -0
- package/dist/esm/leaflet-maplibre-gl-BVDAAs7w.js +1026 -0
- package/dist/{cjs/leaflet-src-B0ls4IKq.js → esm/leaflet-src-DYMWBqU1.js} +33 -8
- package/dist/esm/loader.js +3 -3
- package/dist/esm/q-alert.entry.js +1 -1
- package/dist/esm/q-avatar.entry.js +1 -1
- package/dist/esm/q-button_2.entry.js +2 -2
- package/dist/esm/q-card.entry.js +1 -1
- package/dist/esm/q-carousel.entry.js +1 -1
- package/dist/esm/q-chip.entry.js +2 -2
- package/dist/esm/q-conversation-bubble.entry.js +1 -1
- package/dist/esm/q-data-table.entry.js +3 -2
- package/dist/esm/q-dialog.entry.js +1 -1
- package/dist/esm/q-dropdown.entry.js +1 -1
- package/dist/esm/q-form.entry.js +1 -1
- package/dist/esm/q-icon.entry.js +63 -4
- package/dist/esm/q-input_2.entry.js +2 -2
- package/dist/esm/q-link.entry.js +2 -2
- package/dist/esm/q-map.entry.js +184 -122
- package/dist/esm/q-navbar.entry.js +1 -1
- package/dist/esm/q-pagination.entry.js +1 -1
- package/dist/esm/q-panel.entry.js +1 -1
- package/dist/esm/q-quantity-selector.entry.js +1 -1
- package/dist/esm/q-radio-group.entry.js +1 -1
- package/dist/esm/q-reel.entry.js +1 -1
- package/dist/esm/q-scrollable.entry.js +1 -1
- package/dist/esm/q-sidepanel.entry.js +190 -5
- package/dist/esm/q-step-diagram-item.entry.js +1 -1
- package/dist/esm/q-step-diagram.entry.js +1 -1
- package/dist/esm/q-syntax-box.entry.js +57 -2
- package/dist/esm/q-tabs.entry.js +1 -1
- package/dist/esm/q-textarea.entry.js +1 -1
- package/dist/esm/q-thumbnail.entry.js +1 -1
- package/dist/esm/q-toast.entry.js +1 -1
- package/dist/esm/q-toggle.entry.js +1 -1
- package/dist/esm/q-toolbar.entry.js +1 -1
- package/dist/esm/registry-BvBRW3dl.js +173 -0
- package/dist/esm/webquark.js +4 -4
- package/dist/loader/index.d.ts +1 -1
- package/dist/playground/build/index.esm.js +1 -1
- package/dist/playground/build/{p-6f1b98c2.entry.js → p-0053ec76.entry.js} +1 -1
- package/dist/playground/build/{p-33cfbd33.entry.js → p-0363c0e6.entry.js} +1 -1
- package/dist/{webquark/p-4557f558.entry.js → playground/build/p-0e3dbe01.entry.js} +1 -1
- package/dist/{webquark/p-cddadb39.entry.js → playground/build/p-13329777.entry.js} +1 -1
- package/dist/playground/build/{p-6deac326.entry.js → p-1c9a82b8.entry.js} +1 -1
- package/dist/{webquark/p-0aeed0be.entry.js → playground/build/p-2e2b3ca9.entry.js} +1 -1
- package/dist/playground/build/{p-09e29cf9.entry.js → p-316a92e2.entry.js} +1 -1
- package/dist/{webquark/p-48a8413d.entry.js → playground/build/p-38b92be6.entry.js} +1 -1
- package/dist/{webquark/p-33a45980.entry.js → playground/build/p-41421759.entry.js} +1 -1
- package/dist/playground/build/{p-590cde02.entry.js → p-42831108.entry.js} +1 -1
- package/dist/playground/build/{p-011bab4c.entry.js → p-50ca27f7.entry.js} +1 -1
- package/dist/playground/build/{p-ad1c341c.entry.js → p-5c08aa94.entry.js} +1 -1
- package/dist/playground/build/{p-b8aa6763.entry.js → p-611ef3e0.entry.js} +1 -1
- package/dist/playground/build/{p-254555b1.entry.js → p-684292dd.entry.js} +1 -1
- package/dist/playground/build/p-6c0bc4b9.entry.js +13 -0
- package/dist/playground/build/{p-28cc0172.entry.js → p-7081c96b.entry.js} +1 -1
- package/dist/{webquark/p-4d5d0313.entry.js → playground/build/p-789eb3c9.entry.js} +1 -1
- package/dist/playground/build/{p-dda5be3e.entry.js → p-8077aa3f.entry.js} +1 -1
- package/dist/playground/build/{p-c2032ee1.entry.js → p-885572ee.entry.js} +1 -1
- package/dist/playground/build/p-8ada8fc6.entry.js +1 -0
- package/dist/{webquark/p-711576c8.entry.js → playground/build/p-8d0aa5a7.entry.js} +1 -1
- package/dist/playground/build/{p-93ffb8ab.entry.js → p-8ec7d250.entry.js} +1 -1
- package/dist/{webquark/p-1d1ec52e.entry.js → playground/build/p-9978ae38.entry.js} +1 -1
- package/dist/playground/build/p-BvBRW3dl.js +1 -0
- package/dist/playground/build/p-CFuqfXuv.js +9 -0
- package/dist/playground/build/p-DYMWBqU1.js +5 -0
- package/dist/playground/build/{p-DD6AOr35.js → p-DoS2fiWw.js} +1 -1
- package/dist/playground/build/p-DuX-9GOi.js +1 -0
- package/dist/playground/build/p-VFWyFa-_.js +3 -0
- package/dist/playground/build/{p-f51a7a3c.entry.js → p-b5066051.entry.js} +1 -1
- package/dist/playground/build/p-b99541cd.entry.js +1 -0
- package/dist/{webquark/p-13b7bd40.entry.js → playground/build/p-ca1a1d25.entry.js} +1 -1
- package/dist/playground/build/p-d837603c.entry.js +1 -0
- package/dist/playground/build/{p-b8a75199.entry.js → p-e0e6b68f.entry.js} +1 -1
- package/dist/playground/build/{p-a054f314.entry.js → p-e15e6d76.entry.js} +1 -1
- package/dist/playground/build/p-e272dd45.entry.js +1 -0
- package/dist/{webquark/p-94413975.entry.js → playground/build/p-e8003179.entry.js} +1 -1
- package/dist/playground/build/p-e974c1f8.entry.js +13 -0
- package/dist/playground/build/p-g9vOVxQ4.js +13 -0
- package/dist/playground/build/webquark.esm.js +1 -1
- package/dist/types/components/layout/sidepanel/sidepanel.d.ts +2 -0
- package/dist/types/components/layout/sidepanel/sidepanel.types.d.ts +4 -0
- package/dist/types/components/media/icon/icon.d.ts +6 -3
- package/dist/types/components/media/icon/icon.types.d.ts +25 -0
- package/dist/types/components/media/icon/internals/registry.d.ts +11 -0
- package/dist/types/components/media/icon/internals/registry.unit.test.d.ts +1 -0
- package/dist/types/components/media/icon/internals/render-definition.d.ts +2 -0
- package/dist/types/components.d.ts +14 -6
- package/dist/types/index.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +73 -55
- package/dist/webquark/index.esm.js +1 -1
- package/dist/webquark/{p-6f1b98c2.entry.js → p-0053ec76.entry.js} +1 -1
- package/dist/webquark/{p-33cfbd33.entry.js → p-0363c0e6.entry.js} +1 -1
- package/dist/{playground/build/p-4557f558.entry.js → webquark/p-0e3dbe01.entry.js} +1 -1
- package/dist/{playground/build/p-cddadb39.entry.js → webquark/p-13329777.entry.js} +1 -1
- package/dist/webquark/{p-6deac326.entry.js → p-1c9a82b8.entry.js} +1 -1
- package/dist/{playground/build/p-0aeed0be.entry.js → webquark/p-2e2b3ca9.entry.js} +1 -1
- package/dist/webquark/{p-09e29cf9.entry.js → p-316a92e2.entry.js} +1 -1
- package/dist/{playground/build/p-48a8413d.entry.js → webquark/p-38b92be6.entry.js} +1 -1
- package/dist/{playground/build/p-33a45980.entry.js → webquark/p-41421759.entry.js} +1 -1
- package/dist/webquark/{p-590cde02.entry.js → p-42831108.entry.js} +1 -1
- package/dist/webquark/{p-011bab4c.entry.js → p-50ca27f7.entry.js} +1 -1
- package/dist/webquark/{p-ad1c341c.entry.js → p-5c08aa94.entry.js} +1 -1
- package/dist/webquark/{p-b8aa6763.entry.js → p-611ef3e0.entry.js} +1 -1
- package/dist/webquark/{p-254555b1.entry.js → p-684292dd.entry.js} +1 -1
- package/dist/webquark/p-6c0bc4b9.entry.js +13 -0
- package/dist/webquark/{p-28cc0172.entry.js → p-7081c96b.entry.js} +1 -1
- package/dist/{playground/build/p-4d5d0313.entry.js → webquark/p-789eb3c9.entry.js} +1 -1
- package/dist/webquark/{p-dda5be3e.entry.js → p-8077aa3f.entry.js} +1 -1
- package/dist/webquark/{p-c2032ee1.entry.js → p-885572ee.entry.js} +1 -1
- package/dist/webquark/p-8ada8fc6.entry.js +1 -0
- package/dist/{playground/build/p-711576c8.entry.js → webquark/p-8d0aa5a7.entry.js} +1 -1
- package/dist/webquark/{p-93ffb8ab.entry.js → p-8ec7d250.entry.js} +1 -1
- package/dist/{playground/build/p-1d1ec52e.entry.js → webquark/p-9978ae38.entry.js} +1 -1
- package/dist/webquark/p-BvBRW3dl.js +1 -0
- package/dist/webquark/p-CFuqfXuv.js +9 -0
- package/dist/webquark/p-DYMWBqU1.js +5 -0
- package/dist/webquark/{p-DD6AOr35.js → p-DoS2fiWw.js} +1 -1
- package/dist/webquark/p-DuX-9GOi.js +1 -0
- package/dist/webquark/p-VFWyFa-_.js +3 -0
- package/dist/webquark/{p-f51a7a3c.entry.js → p-b5066051.entry.js} +1 -1
- package/dist/webquark/p-b99541cd.entry.js +1 -0
- package/dist/{playground/build/p-13b7bd40.entry.js → webquark/p-ca1a1d25.entry.js} +1 -1
- package/dist/webquark/p-d837603c.entry.js +1 -0
- package/dist/webquark/{p-b8a75199.entry.js → p-e0e6b68f.entry.js} +1 -1
- package/dist/webquark/{p-a054f314.entry.js → p-e15e6d76.entry.js} +1 -1
- package/dist/webquark/p-e272dd45.entry.js +1 -0
- package/dist/{playground/build/p-94413975.entry.js → webquark/p-e8003179.entry.js} +1 -1
- package/dist/webquark/p-e974c1f8.entry.js +13 -0
- package/dist/webquark/p-g9vOVxQ4.js +13 -0
- package/dist/webquark/webquark.esm.js +1 -1
- package/package.json +24 -16
- package/scripts/webquark-serve.js +6 -8
- package/dist/cjs/leaflet-maplibre-gl-RCEffFEM.js +0 -434
- package/dist/cjs/leaflet-src-BX4jwTf5.js +0 -33
- package/dist/components/p-2bWqVyTo.js +0 -1
- package/dist/components/p-BEBDDqVT.js +0 -1
- package/dist/components/p-BeeM-7Ku.js +0 -5
- package/dist/components/p-Ccj0labf.js +0 -1
- package/dist/components/p-DiOrwkX8.js +0 -1
- package/dist/esm/leaflet-maplibre-gl-Cgb-1z8Q.js +0 -432
- package/dist/esm/leaflet-src-BR13bdVA.js +0 -30
- package/dist/playground/build/p-0571c3ae.entry.js +0 -1
- package/dist/playground/build/p-2bWqVyTo.js +0 -1
- package/dist/playground/build/p-56644a7b.entry.js +0 -1
- package/dist/playground/build/p-58724642.entry.js +0 -1
- package/dist/playground/build/p-6cf356da.entry.js +0 -1
- package/dist/playground/build/p-9d14b8ec.entry.js +0 -1
- package/dist/playground/build/p-BEBDDqVT.js +0 -1
- package/dist/playground/build/p-BeeM-7Ku.js +0 -5
- package/dist/playground/build/p-DNFGt02p.js +0 -1
- package/dist/playground/build/p-DOk7gYkf.js +0 -2
- package/dist/playground/build/p-cfaffa33.entry.js +0 -1
- package/dist/webquark/p-0571c3ae.entry.js +0 -1
- package/dist/webquark/p-2bWqVyTo.js +0 -1
- package/dist/webquark/p-56644a7b.entry.js +0 -1
- package/dist/webquark/p-58724642.entry.js +0 -1
- package/dist/webquark/p-6cf356da.entry.js +0 -1
- package/dist/webquark/p-9d14b8ec.entry.js +0 -1
- package/dist/webquark/p-BEBDDqVT.js +0 -1
- package/dist/webquark/p-BeeM-7Ku.js +0 -5
- package/dist/webquark/p-DNFGt02p.js +0 -1
- package/dist/webquark/p-DOk7gYkf.js +0 -2
- package/dist/webquark/p-cfaffa33.entry.js +0 -1
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
const REGISTRY_STATE_KEY = Symbol.for('@webquark/core:q-icon-registry:v1');
|
|
2
|
+
const ICON_NAME_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$/;
|
|
3
|
+
const ATTRIBUTE_NAME_PATTERN = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/;
|
|
4
|
+
const MAX_ICON_NAME_LENGTH = 128;
|
|
5
|
+
const MAX_NODE_DEPTH = 16;
|
|
6
|
+
const MAX_NODE_COUNT = 512;
|
|
7
|
+
const SAFE_SVG_ELEMENTS = new Set([
|
|
8
|
+
'circle',
|
|
9
|
+
'clipPath',
|
|
10
|
+
'defs',
|
|
11
|
+
'ellipse',
|
|
12
|
+
'g',
|
|
13
|
+
'line',
|
|
14
|
+
'linearGradient',
|
|
15
|
+
'mask',
|
|
16
|
+
'path',
|
|
17
|
+
'polygon',
|
|
18
|
+
'polyline',
|
|
19
|
+
'radialGradient',
|
|
20
|
+
'rect',
|
|
21
|
+
'stop',
|
|
22
|
+
'symbol',
|
|
23
|
+
'use',
|
|
24
|
+
]);
|
|
25
|
+
function getRuntimeState() {
|
|
26
|
+
const globalRecord = globalThis;
|
|
27
|
+
const existing = globalRecord[REGISTRY_STATE_KEY];
|
|
28
|
+
if (existing?.version === 1 && existing.registry instanceof Map && typeof existing.strict === 'boolean') {
|
|
29
|
+
return existing;
|
|
30
|
+
}
|
|
31
|
+
const state = {
|
|
32
|
+
version: 1,
|
|
33
|
+
registry: new Map(),
|
|
34
|
+
strict: false,
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(globalRecord, REGISTRY_STATE_KEY, {
|
|
37
|
+
configurable: false,
|
|
38
|
+
enumerable: false,
|
|
39
|
+
writable: false,
|
|
40
|
+
value: state,
|
|
41
|
+
});
|
|
42
|
+
return state;
|
|
43
|
+
}
|
|
44
|
+
function isRecord(value) {
|
|
45
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
46
|
+
}
|
|
47
|
+
function containsExternalResourceReference(value) {
|
|
48
|
+
const references = Array.from(value.matchAll(/url\s*\(([^)]*)\)/gi));
|
|
49
|
+
return references.some(([, rawReference]) => {
|
|
50
|
+
const reference = rawReference.trim().replace(/^(['"])(.*)\1$/, '$2').trim();
|
|
51
|
+
return !reference.startsWith('#');
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function assertPositiveDimension(value, field, context) {
|
|
55
|
+
if (value !== undefined && (typeof value !== 'number' || !Number.isFinite(value) || value <= 0)) {
|
|
56
|
+
throw new TypeError(`${context}.${field} must be a positive finite number.`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function cloneAttributes(value, context) {
|
|
60
|
+
if (!isRecord(value)) {
|
|
61
|
+
throw new TypeError(`${context} must be an object of string SVG attributes.`);
|
|
62
|
+
}
|
|
63
|
+
const attributes = {};
|
|
64
|
+
for (const [name, rawValue] of Object.entries(value)) {
|
|
65
|
+
if (!ATTRIBUTE_NAME_PATTERN.test(name) || name.toLowerCase().startsWith('on')) {
|
|
66
|
+
throw new TypeError(`${context} contains an unsafe SVG attribute name: ${name}.`);
|
|
67
|
+
}
|
|
68
|
+
if (name.toLowerCase() === 'style' || name.toLowerCase() === 'src') {
|
|
69
|
+
throw new TypeError(`${context} contains an unsupported SVG attribute: ${name}.`);
|
|
70
|
+
}
|
|
71
|
+
if (typeof rawValue !== 'string') {
|
|
72
|
+
throw new TypeError(`${context}.${name} must be a string.`);
|
|
73
|
+
}
|
|
74
|
+
const normalizedValue = rawValue.trim().toLowerCase();
|
|
75
|
+
if (normalizedValue.includes('javascript:')) {
|
|
76
|
+
throw new TypeError(`${context}.${name} contains an unsafe SVG attribute value.`);
|
|
77
|
+
}
|
|
78
|
+
if ((name.toLowerCase() === 'href' || name.toLowerCase() === 'xlink:href') && !normalizedValue.startsWith('#')) {
|
|
79
|
+
throw new TypeError(`${context}.${name} must reference an element in the same SVG.`);
|
|
80
|
+
}
|
|
81
|
+
if (containsExternalResourceReference(rawValue)) {
|
|
82
|
+
throw new TypeError(`${context}.${name} must not reference an external resource.`);
|
|
83
|
+
}
|
|
84
|
+
attributes[name] = rawValue;
|
|
85
|
+
}
|
|
86
|
+
return Object.freeze(attributes);
|
|
87
|
+
}
|
|
88
|
+
function cloneNode(value, context, depth, nodeCounter) {
|
|
89
|
+
if (!Array.isArray(value) || (value.length !== 2 && value.length !== 3)) {
|
|
90
|
+
throw new TypeError(`${context} must be a [tagName, attributes, children?] tuple.`);
|
|
91
|
+
}
|
|
92
|
+
if (depth > MAX_NODE_DEPTH) {
|
|
93
|
+
throw new TypeError(`${context} exceeds the maximum icon node depth of ${MAX_NODE_DEPTH}.`);
|
|
94
|
+
}
|
|
95
|
+
nodeCounter.value += 1;
|
|
96
|
+
if (nodeCounter.value > MAX_NODE_COUNT) {
|
|
97
|
+
throw new TypeError(`Icon definitions may contain at most ${MAX_NODE_COUNT} SVG nodes.`);
|
|
98
|
+
}
|
|
99
|
+
const [tagName, rawAttributes, rawChildren] = value;
|
|
100
|
+
if (typeof tagName !== 'string' || !SAFE_SVG_ELEMENTS.has(tagName)) {
|
|
101
|
+
throw new TypeError(`${context} contains an unsupported SVG element: ${String(tagName)}.`);
|
|
102
|
+
}
|
|
103
|
+
const attributes = cloneAttributes(rawAttributes, `${context}[1]`);
|
|
104
|
+
if (rawChildren === undefined) {
|
|
105
|
+
return Object.freeze([tagName, attributes]);
|
|
106
|
+
}
|
|
107
|
+
if (!Array.isArray(rawChildren)) {
|
|
108
|
+
throw new TypeError(`${context}[2] must be an array of SVG nodes.`);
|
|
109
|
+
}
|
|
110
|
+
const children = Object.freeze(rawChildren.map((child, index) => (cloneNode(child, `${context}[2][${index}]`, depth + 1, nodeCounter))));
|
|
111
|
+
return Object.freeze([tagName, attributes, children]);
|
|
112
|
+
}
|
|
113
|
+
export function prepareQIconDefinition(value, context = 'Icon definition') {
|
|
114
|
+
if (!isRecord(value) || !Array.isArray(value.node)) {
|
|
115
|
+
throw new TypeError(`${context} must contain a node array.`);
|
|
116
|
+
}
|
|
117
|
+
assertPositiveDimension(value.size, 'size', context);
|
|
118
|
+
assertPositiveDimension(value.width, 'width', context);
|
|
119
|
+
assertPositiveDimension(value.height, 'height', context);
|
|
120
|
+
if ((value.width === undefined) !== (value.height === undefined)) {
|
|
121
|
+
throw new TypeError(`${context}.width and ${context}.height must be provided together.`);
|
|
122
|
+
}
|
|
123
|
+
if (value.name !== undefined && typeof value.name !== 'string') {
|
|
124
|
+
throw new TypeError(`${context}.name must be a string when provided.`);
|
|
125
|
+
}
|
|
126
|
+
const nodeCounter = { value: 0 };
|
|
127
|
+
const node = Object.freeze(value.node.map((child, index) => (cloneNode(child, `${context}.node[${index}]`, 1, nodeCounter))));
|
|
128
|
+
const attributes = value.attributes === undefined
|
|
129
|
+
? undefined
|
|
130
|
+
: cloneAttributes(value.attributes, `${context}.attributes`);
|
|
131
|
+
const definition = {
|
|
132
|
+
...(value.name === undefined ? {} : { name: value.name }),
|
|
133
|
+
node,
|
|
134
|
+
...(value.size === undefined ? {} : { size: value.size }),
|
|
135
|
+
...(value.width === undefined ? {} : { width: value.width, height: value.height }),
|
|
136
|
+
...(attributes === undefined ? {} : { attributes }),
|
|
137
|
+
};
|
|
138
|
+
return Object.freeze(definition);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Atomically replaces the complete icon registry. Call once with an app-owned
|
|
142
|
+
* manifest before defining or bootstrapping WebQuark components.
|
|
143
|
+
*/
|
|
144
|
+
export function registerQIcons(registry) {
|
|
145
|
+
if (!isRecord(registry)) {
|
|
146
|
+
throw new TypeError('QIcon registry must be an object keyed by icon name.');
|
|
147
|
+
}
|
|
148
|
+
const nextRegistry = new Map();
|
|
149
|
+
for (const [rawName, definition] of Object.entries(registry)) {
|
|
150
|
+
const name = rawName.trim();
|
|
151
|
+
if (name !== rawName || name.length > MAX_ICON_NAME_LENGTH || !ICON_NAME_PATTERN.test(name)) {
|
|
152
|
+
throw new TypeError(`Invalid q-icon registry name: ${JSON.stringify(rawName)}.`);
|
|
153
|
+
}
|
|
154
|
+
nextRegistry.set(name, prepareQIconDefinition(definition, `Icon definition ${JSON.stringify(name)}`));
|
|
155
|
+
}
|
|
156
|
+
getRuntimeState().registry = nextRegistry;
|
|
157
|
+
}
|
|
158
|
+
/** Configures whether unknown icon names may use URL and fetch fallbacks. */
|
|
159
|
+
export function configureQIcons(configuration) {
|
|
160
|
+
if (!isRecord(configuration) || typeof configuration.strict !== 'boolean') {
|
|
161
|
+
throw new TypeError('QIcon configuration must provide a boolean strict value.');
|
|
162
|
+
}
|
|
163
|
+
getRuntimeState().strict = configuration.strict;
|
|
164
|
+
}
|
|
165
|
+
export function resolveRegisteredQIcon(name) {
|
|
166
|
+
const normalizedName = name?.trim();
|
|
167
|
+
return normalizedName ? getRuntimeState().registry.get(normalizedName) : undefined;
|
|
168
|
+
}
|
|
169
|
+
export function isQIconStrictMode() {
|
|
170
|
+
return getRuntimeState().strict;
|
|
171
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
2
|
+
import { configureQIcons, isQIconStrictMode, registerQIcons, resolveRegisteredQIcon, } from "./registry";
|
|
3
|
+
const CIRCLE = {
|
|
4
|
+
name: 'circle',
|
|
5
|
+
size: 24,
|
|
6
|
+
node: [['circle', { cx: '12', cy: '12', r: '10' }]],
|
|
7
|
+
};
|
|
8
|
+
describe('q-icon registry', () => {
|
|
9
|
+
afterEach(() => {
|
|
10
|
+
registerQIcons({});
|
|
11
|
+
configureQIcons({ strict: false });
|
|
12
|
+
});
|
|
13
|
+
it('replaces the whole registry atomically', () => {
|
|
14
|
+
registerQIcons({ circle: CIRCLE });
|
|
15
|
+
expect(resolveRegisteredQIcon('circle')).toEqual(CIRCLE);
|
|
16
|
+
registerQIcons({ dot: { size: 24, node: [['circle', { cx: '12', cy: '12', r: '2' }]] } });
|
|
17
|
+
expect(resolveRegisteredQIcon('circle')).toBeUndefined();
|
|
18
|
+
expect(resolveRegisteredQIcon('dot')).toBeDefined();
|
|
19
|
+
});
|
|
20
|
+
it('does not register or import a global icon catalog', () => {
|
|
21
|
+
registerQIcons({ circle: CIRCLE });
|
|
22
|
+
expect(resolveRegisteredQIcon('circle')).toBeDefined();
|
|
23
|
+
expect(resolveRegisteredQIcon('activity')).toBeUndefined();
|
|
24
|
+
expect(resolveRegisteredQIcon('alarm-clock')).toBeUndefined();
|
|
25
|
+
});
|
|
26
|
+
it('rejects unsafe definitions without replacing the existing registry', () => {
|
|
27
|
+
registerQIcons({ circle: CIRCLE });
|
|
28
|
+
expect(() => registerQIcons({
|
|
29
|
+
unsafe: {
|
|
30
|
+
size: 24,
|
|
31
|
+
node: [['use', { href: 'https://example.com/icons.svg#unsafe' }]],
|
|
32
|
+
},
|
|
33
|
+
})).toThrow(/same SVG/);
|
|
34
|
+
expect(resolveRegisteredQIcon('circle')).toBeDefined();
|
|
35
|
+
expect(resolveRegisteredQIcon('unsafe')).toBeUndefined();
|
|
36
|
+
});
|
|
37
|
+
it('requires an explicit boolean strict-mode setting', () => {
|
|
38
|
+
configureQIcons({ strict: true });
|
|
39
|
+
expect(isQIconStrictMode()).toBe(true);
|
|
40
|
+
expect(() => configureQIcons({})).toThrow(/boolean strict/);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
function renderNode(node) {
|
|
3
|
+
const [tagName, attributes, children] = node;
|
|
4
|
+
return h(tagName, attributes, children?.map(renderNode));
|
|
5
|
+
}
|
|
6
|
+
export function renderQIconDefinition(definition) {
|
|
7
|
+
const width = definition.width ?? definition.size ?? 24;
|
|
8
|
+
const height = definition.height ?? definition.size ?? 24;
|
|
9
|
+
const attributes = {
|
|
10
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
11
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
12
|
+
fill: 'none',
|
|
13
|
+
stroke: 'currentColor',
|
|
14
|
+
'stroke-width': '2',
|
|
15
|
+
'stroke-linecap': 'round',
|
|
16
|
+
'stroke-linejoin': 'round',
|
|
17
|
+
...definition.attributes,
|
|
18
|
+
width: '100%',
|
|
19
|
+
height: '100%',
|
|
20
|
+
'aria-hidden': 'true',
|
|
21
|
+
focusable: 'false',
|
|
22
|
+
};
|
|
23
|
+
return h('svg', attributes, definition.node.map(renderNode));
|
|
24
|
+
}
|
package/dist/collection/index.js
CHANGED
|
@@ -11,4 +11,5 @@ export { format } from './utils/utils';
|
|
|
11
11
|
export { identifyItems, reconcileByIdentity, } from './utils/collection-identity';
|
|
12
12
|
export { Q_MAP_DEFAULT_CLUSTER_GROUP, Q_MAP_MARKER_CALLOUT_PLACEMENTS, Q_MAP_MARKER_CALLOUT_STAT_LAYOUTS, Q_MAP_MARKER_CALLOUT_VISIBILITIES, Q_MAP_MARKER_KINDS, Q_MAP_MARKER_RINGS, Q_MAP_MARKER_SIZES, Q_MAP_MARKER_VARIANTS, Q_MAP_RASTER_TILE_LOADING_POLICIES, } from './components/data-display/map/map.types';
|
|
13
13
|
export { getDataTableCellSlotName, getDataTableCellValue, getDataTableItemKey, } from './components/data-display/data-table/data-table-cell';
|
|
14
|
+
export { configureQIcons, registerQIcons, } from './components/media/icon/internals/registry';
|
|
14
15
|
export { toast } from './components/overlays/toast/toast-controller';
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-
|
|
1
|
+
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-CVtof65h.js";export{f as format}from"./p-BJiYCN3i.js";export{i as identifyItems,r as reconcileByIdentity}from"./p-CGZPmEUB.js";export{Q as Q_MAP_DEFAULT_CLUSTER_GROUP,a as Q_MAP_MARKER_CALLOUT_PLACEMENTS,b as Q_MAP_MARKER_CALLOUT_STAT_LAYOUTS,c as Q_MAP_MARKER_CALLOUT_VISIBILITIES,d as Q_MAP_MARKER_KINDS,e as Q_MAP_MARKER_RINGS,f as Q_MAP_MARKER_SIZES,g as Q_MAP_MARKER_VARIANTS,h as Q_MAP_RASTER_TILE_LOADING_POLICIES}from"./p-WJHaLJS_.js";export{g as getDataTableCellSlotName,a as getDataTableCellValue,b as getDataTableItemKey}from"./p-DmqVhVoj.js";export{c as configureQIcons,r as registerQIcons}from"./p-BvBRW3dl.js";export{t as toast}from"./p-BIIQL66b.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as a,p as e,H as t,c as i,h as r}from"./p-
|
|
1
|
+
import{t as a,p as e,H as t,c as i,h as r}from"./p-CVtof65h.js";const s=e(class extends t{constructor(a){super(),!1!==a&&this.__registerHost(),this.__attachShadow(),this.qDismiss=i(this,"qDismiss")}get el(){return this}heading;variant="info";dismissible=!1;dismissLabel="Dismiss alert";announcement="off";qDismiss;hasIcon=!1;hasActions=!1;componentWillLoad(){this.hasIcon=null!==this.el.querySelector('[slot="icon"]'),this.hasActions=null!==this.el.querySelector('[slot="actions"]')}handleSlotChange=a=>{const e=a.target;"icon"===e.name?this.hasIcon=e.assignedNodes({flatten:!0}).length>0:"actions"===e.name&&(this.hasActions=e.assignedNodes({flatten:!0}).length>0)};render(){const a="assertive"===this.announcement?{role:"alert",ariaLive:"assertive"}:"polite"===this.announcement?{role:"status",ariaLive:"polite"}:{role:void 0,ariaLive:void 0};return r("div",{key:"d1cc6ab33b533de24bdd6f4dbb98cff2bf85d107",class:{alert:!0,[`variant-${this.variant}`]:!0},part:"container",role:a.role,"aria-live":a.ariaLive,"aria-atomic":"off"===this.announcement?void 0:"true"},r("span",{key:"e5a437890608457c1e15a3821846b39b8f0e7ce7",class:{icon:!0,"has-content":this.hasIcon},part:"icon","aria-hidden":"true"},r("slot",{key:"a6b7dc0b189f239e734399f971ad818b0228b2ef",name:"icon",onSlotchange:this.handleSlotChange})),r("div",{key:"1cb380d62fc3356ccfa86e4ca333dc5d824e7e71",class:"content",part:"content"},this.heading&&r("div",{key:"5e239f840b484afe88ef5805b1a8919d7af2be76",class:"heading",part:"heading"},this.heading),r("div",{key:"063fe5b15f7dc4b1d22780b6c978b7c8246be529",class:"message",part:"message"},r("slot",{key:"3e921f605cea18e78a4a8f9332d98af36515bb0c"}))),r("div",{key:"0d6ef9fbbbd572b6e4082229dd7632ccd6013c3c",class:{actions:!0,"has-content":this.hasActions},part:"actions"},r("slot",{key:"9ade3fbb81b8fe2638fec6bc00b7728f5e5f8370",name:"actions",onSlotchange:this.handleSlotChange})),this.dismissible&&r("button",{key:"b7a3bed1bd3eb4f69f565090c9aa7874c1ace221",class:"dismiss-button",part:"dismiss-button",type:"button","aria-label":this.dismissLabel.trim()||"Dismiss alert",onClick:()=>this.qDismiss.emit()},r("span",{key:"859f84931af9b266d5ddda36a3046b65305ea198","aria-hidden":"true"},"×")))}static get style(){return":host{display:block;box-sizing:border-box;color:var(--q-alert-fg, var(--q-fg-base, #f9fafb));font-family:var(--q-font-family, inherit)}.alert{--_q-alert-accent:var(--q-color-primary, #60a5fa);--_q-alert-bg:color-mix(in srgb, var(--_q-alert-accent) 12%, transparent);--_q-alert-border:color-mix(in srgb, var(--_q-alert-accent) 55%, transparent);display:flex;align-items:start;gap:var(--q-alert-gap, 10px);box-sizing:border-box;width:100%;padding:var(--q-alert-padding, 12px 14px);border:var(--q-alert-border, 1px solid var(--_q-alert-border));border-left:var(--q-alert-accent-border, 3px solid var(--_q-alert-accent));border-radius:var(--q-alert-radius, var(--q-radius-md, 7px));background:var(--q-alert-bg, var(--_q-alert-bg))}.alert.variant-success{--_q-alert-accent:var(--q-color-success, #34d399)}.alert.variant-warning{--_q-alert-accent:var(--q-color-warning, #fbbf24)}.alert.variant-danger{--_q-alert-accent:var(--q-color-danger, #f87171)}.icon,.actions{display:none}.icon.has-content{display:inline-flex;align-items:center;justify-content:center;min-width:1.25rem;min-height:1.25rem;color:var(--_q-alert-accent)}.content{flex:1 1 auto;min-width:0}.heading{margin-bottom:var(--q-alert-heading-gap, 2px);color:var(--q-alert-heading-fg, currentColor);font-size:var(--q-alert-heading-size, var(--q-font-size-base, 0.9rem));font-weight:var(--q-alert-heading-weight, var(--q-font-weight-bold, 600));line-height:1.4}.message{color:var(--q-alert-message-fg, var(--q-fg-muted, #d1d5db));font-size:var(--q-alert-message-size, var(--q-font-size-sm, 0.8125rem));line-height:1.5}.actions{align-items:center;gap:var(--q-alert-actions-gap, 8px)}.actions.has-content{display:inline-flex}.dismiss-button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--q-alert-dismiss-size, 28px);height:var(--q-alert-dismiss-size, 28px);margin:-4px -6px -4px 0;padding:0;color:var(--q-alert-dismiss-fg, currentColor);border:0;border-radius:var(--q-alert-dismiss-radius, var(--q-radius-sm, 4px));background:transparent;font:inherit;font-size:1.25rem;line-height:1;cursor:pointer}.dismiss-button:hover{background:var( --q-alert-dismiss-hover-bg, color-mix(in srgb, currentColor 8%, transparent) )}.dismiss-button:focus-visible{outline:var(--q-focus-ring, 2px solid var(--q-color-primary, #60a5fa));outline-offset:1px}@media (max-width: 480px){.alert{flex-wrap:wrap}.actions.has-content{flex:1 0 100%}}"}},[769,"q-alert",{heading:[1],variant:[513],dismissible:[4],dismissLabel:[1,"dismiss-label"],announcement:[1],hasIcon:[32],hasActions:[32]}]);function n(){"undefined"!=typeof customElements&&["q-alert"].forEach((e=>{"q-alert"===e&&(customElements.get(a(e))||customElements.define(a(e),s))}))}n();export{s as Q,n as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=Symbol.for("@webquark/core:q-icon-registry:v1"),r=/^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$/,t=/^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/,n=new Set(["circle","clipPath","defs","ellipse","g","line","linearGradient","mask","path","polygon","polyline","radialGradient","rect","stop","symbol","use"]);function o(){const r=globalThis,t=r[e];if(1===t?.version&&t.registry instanceof Map&&"boolean"==typeof t.strict)return t;const n={version:1,registry:new Map,strict:!1};return Object.defineProperty(r,e,{configurable:!1,enumerable:!1,writable:!1,value:n}),n}function i(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function a(e){return Array.from(e.matchAll(/url\s*\(([^)]*)\)/gi)).some((([,e])=>!e.trim().replace(/^(['"])(.*)\1$/,"$2").trim().startsWith("#")))}function s(e,r,t){if(void 0!==e&&("number"!=typeof e||!Number.isFinite(e)||e<=0))throw new TypeError(`${t}.${r} must be a positive finite number.`)}function c(e,r){if(!i(e))throw new TypeError(`${r} must be an object of string SVG attributes.`);const n={};for(const[o,i]of Object.entries(e)){if(!t.test(o)||o.toLowerCase().startsWith("on"))throw new TypeError(`${r} contains an unsafe SVG attribute name: ${o}.`);if("style"===o.toLowerCase()||"src"===o.toLowerCase())throw new TypeError(`${r} contains an unsupported SVG attribute: ${o}.`);if("string"!=typeof i)throw new TypeError(`${r}.${o} must be a string.`);const e=i.trim().toLowerCase();if(e.includes("javascript:"))throw new TypeError(`${r}.${o} contains an unsafe SVG attribute value.`);if(("href"===o.toLowerCase()||"xlink:href"===o.toLowerCase())&&!e.startsWith("#"))throw new TypeError(`${r}.${o} must reference an element in the same SVG.`);if(a(i))throw new TypeError(`${r}.${o} must not reference an external resource.`);n[o]=i}return Object.freeze(n)}function u(e,r,t,o){if(!Array.isArray(e)||2!==e.length&&3!==e.length)throw new TypeError(`${r} must be a [tagName, attributes, children?] tuple.`);if(t>16)throw new TypeError(`${r} exceeds the maximum icon node depth of 16.`);if(o.value+=1,o.value>512)throw new TypeError("Icon definitions may contain at most 512 SVG nodes.");const[i,a,s]=e;if("string"!=typeof i||!n.has(i))throw new TypeError(`${r} contains an unsupported SVG element: ${String(i)}.`);const f=c(a,`${r}[1]`);if(void 0===s)return Object.freeze([i,f]);if(!Array.isArray(s))throw new TypeError(`${r}[2] must be an array of SVG nodes.`);const p=Object.freeze(s.map(((e,n)=>u(e,`${r}[2][${n}]`,t+1,o))));return Object.freeze([i,f,p])}function f(e,r="Icon definition"){if(!i(e)||!Array.isArray(e.node))throw new TypeError(`${r} must contain a node array.`);if(s(e.size,"size",r),s(e.width,"width",r),s(e.height,"height",r),void 0===e.width!=(void 0===e.height))throw new TypeError(`${r}.width and ${r}.height must be provided together.`);if(void 0!==e.name&&"string"!=typeof e.name)throw new TypeError(`${r}.name must be a string when provided.`);const t={value:0},n=Object.freeze(e.node.map(((e,n)=>u(e,`${r}.node[${n}]`,1,t)))),o=void 0===e.attributes?void 0:c(e.attributes,`${r}.attributes`),a={...void 0===e.name?{}:{name:e.name},node:n,...void 0===e.size?{}:{size:e.size},...void 0===e.width?{}:{width:e.width,height:e.height},...void 0===o?{}:{attributes:o}};return Object.freeze(a)}function p(e){if(!i(e))throw new TypeError("QIcon registry must be an object keyed by icon name.");const t=new Map;for(const[n,o]of Object.entries(e)){const e=n.trim();if(e!==n||e.length>128||!r.test(e))throw new TypeError(`Invalid q-icon registry name: ${JSON.stringify(n)}.`);t.set(e,f(o,`Icon definition ${JSON.stringify(e)}`))}o().registry=t}function w(e){if(!i(e)||"boolean"!=typeof e.strict)throw new TypeError("QIcon configuration must provide a boolean strict value.");o().strict=e.strict}function y(e){const r=e?.trim();return r?o().registry.get(r):void 0}function b(){return o().strict}export{y as a,w as c,b as i,f as p,p as r}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as t,t as i,p as e,H as s}from"./p-CVtof65h.js";import{a as n,p as r,i as o}from"./p-BvBRW3dl.js";function a(i){const[e,s,n]=i;return t(e,s,n?.map(a))}const c=new Set(["script","foreignobject","iframe","object","embed","link","meta"]),h=/<\s*(script|foreignObject|iframe|object|embed|link|meta)\b[\s\S]*?(?:<\/\s*\1\s*>|\/\s*>)/gi,l=/\s+on[a-z]+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,d=/\s+(style|tabindex)\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,f=/\s+(xlink:href|href)\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,u=/\s+[a-z_:.-]+\s*=\s*("[^"]*javascript:[^"]*"|'[^']*javascript:[^']*'|[^\s>]*javascript:[^\s>]*)/gi;function g(t){return/<svg[\s>]/i.test(t)?t.replace(h,"").replace(l,"").replace(d,"").replace(u,"").replace(f,((t,i,e)=>String(e).replace(/^['"]|['"]$/g,"").trim().toLowerCase().startsWith("#")?t:"")).replace(/<svg\b([^>]*)>/i,((t,i)=>`<svg${String(i).replace(/\s+aria-hidden\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/\s+focusable\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"")} aria-hidden="true" focusable="false">`)).trim():""}const m=[".png",".jpg",".jpeg",".webp",".gif",".ico"];function p(t,i){const e=t?.trim();return e||i}const v=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}get el(){return this}name;definition;lib="lucide";localPath="/assets/icons/";libVersion;fetchTimeout=8e3;size="md";color="currentColor";label;svgContent="";isBinary=!1;resolvedUrl="";hasError=!1;resolvedDefinition;fetchId=0;watchHandler(){this.loadIcon()}componentWillLoad(){this.loadIcon()}componentWillRender(){this.syncHostState()}componentDidRender(){this.syncHostState()}componentDidLoad(){this.syncHostState()}componentDidUpdate(){this.syncHostState()}get accessibleLabel(){const t=this.label?.trim();return t||void 0}handleImageError=()=>{this.hasError=!0,this.syncHostState()};syncHostState(){if(!this.el)return;const t=function(t){const i=t?String(t).trim():"md";return"sm"===i?"16px":"md"===i?"24px":"lg"===i?"32px":/^\d+$/.test(i)?`${i}px`:i}(this.size),i=this.accessibleLabel;this.el.style.width=t,this.el.style.height=t,this.el.style.color=this.color,this.el.classList.toggle("q-icon-error",this.hasError),this.el.classList.toggle("q-icon-binary",!this.hasError&&this.isBinary),this.el.classList.toggle("q-icon-svg",!this.hasError&&!this.isBinary),i?(this.el.setAttribute("role","img"),this.el.setAttribute("aria-label",i),this.el.setAttribute("aria-hidden","false")):(this.el.removeAttribute("role"),this.el.removeAttribute("aria-label"),this.el.setAttribute("aria-hidden","true"))}async loadIcon(){const t=++this.fetchId;this.hasError=!1,this.resolvedDefinition=void 0,this.syncHostState();const i=this.definition??n(this.name);if(i){try{this.resolvedDefinition=this.definition?r(i,"q-icon definition"):i,this.svgContent="",this.resolvedUrl="",this.isBinary=!1}catch(t){console.error(t),this.hasError=!0}return void this.syncHostState()}if(!this.name)return this.svgContent="",this.resolvedUrl="",this.isBinary=!1,void this.syncHostState();if(o())return this.svgContent="",this.resolvedUrl="",this.isBinary=!1,this.hasError=!0,void this.syncHostState();const e=function(t){const i=t.name.trim();if("lucide"===t.library)return`https://cdn.jsdelivr.net/npm/lucide-static@${p(t.libraryVersion,"0.416.0")}/icons/${encodeURIComponent(i)}.svg`;if("font-awesome"===t.library||"fontawesome"===t.library)return`https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@${p(t.libraryVersion,"6.7.2")}/svgs/solid/${encodeURIComponent(i)}.svg`;if("local"===t.library){let e=t.localPath||"/assets/icons/";return e.endsWith("/")||(e+="/"),`${e}${i}${i.includes(".")?"":".svg"}`}if(t.library.includes("{name}"))return t.library.replace("{name}",i);let e=t.library;return e.endsWith("/")||(e+="/"),`${e}${i}`}({name:this.name,library:this.lib,localPath:this.localPath,libraryVersion:this.libVersion});if(function(t){const i=t.toLowerCase();return m.some((t=>i.endsWith(t)))}(e))this.fetchId===t&&(this.isBinary=!0,this.resolvedUrl=e,this.svgContent="",this.syncHostState());else{this.fetchId===t&&(this.isBinary=!1,this.resolvedUrl="",this.syncHostState());try{const i=function(t,i=("undefined"!=typeof window?window.location:void 0)){if(!i||/^https?:\/\//i.test(t)||t.startsWith("data:"))return t;const e=i.origin&&"null"!==i.origin?i.origin:"http://localhost";try{return new URL(t,e).href}catch(i){return t}}(e),s=await async function(t,i){const e=Number.isFinite(i)&&i>0?i:8e3,s="undefined"!=typeof AbortController?new AbortController:void 0,n=s?setTimeout((()=>s.abort()),e):void 0;try{const i=await fetch(t,s?{signal:s.signal}:void 0);if(!i.ok)throw new Error(`Failed to load icon SVG from ${t} (status: ${i.status})`);return await i.text()}finally{void 0!==n&&clearTimeout(n)}}(i,this.fetchTimeout),n=function(t){if("undefined"==typeof DOMParser||"undefined"==typeof XMLSerializer)return g(t);const i=(new DOMParser).parseFromString(t,"image/svg+xml"),e=i.querySelector("parsererror"),s=i.documentElement;if(e||!s||"svg"!==s.tagName.toLowerCase())return g(t);const n=t=>{const i=t.tagName.toLowerCase();c.has(i)?t.remove():(Array.from(t.attributes).forEach((e=>{const s=e.name.toLowerCase(),n=e.value.trim().toLowerCase();(s.startsWith("on")||"style"===s||"tabindex"===s||n.startsWith("javascript:")||n.includes("url(javascript:")||("href"===s||"xlink:href"===s)&&"use"===i&&!n.startsWith("#"))&&t.removeAttribute(e.name)})),Array.from(t.children).forEach(n))};return n(s),s.setAttribute("aria-hidden","true"),s.setAttribute("focusable","false"),(new XMLSerializer).serializeToString(s)}(s);if(!n)throw new Error(`Failed to sanitize icon SVG from ${i}`);this.fetchId===t&&(this.svgContent=n,this.syncHostState())}catch(i){console.error(i),this.fetchId===t&&(this.hasError=!0,this.svgContent="",this.syncHostState())}}}render(){return this.hasError?t("div",{class:"icon-fallback",part:"fallback"},t("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",focusable:"false"},t("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),t("line",{x1:"9",y1:"9",x2:"15",y2:"15"}),t("line",{x1:"15",y1:"9",x2:"9",y2:"15"}))):this.resolvedDefinition?t("div",{class:"svg-container",part:"svg"},function(i){const e={xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${i.width??i.size??24} ${i.height??i.size??24}`,fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...i.attributes,width:"100%",height:"100%","aria-hidden":"true",focusable:"false"};return t("svg",e,i.node.map(a))}(this.resolvedDefinition)):this.isBinary?t("img",{src:this.resolvedUrl,alt:"","aria-hidden":"true",part:"image",style:{width:"100%",height:"100%",objectFit:"contain"},onError:this.handleImageError}):t("div",{class:"svg-container",part:"svg",innerHTML:this.svgContent})}static get watchers(){return{name:[{watchHandler:0}],definition:[{watchHandler:0}],lib:[{watchHandler:0}],localPath:[{watchHandler:0}],libVersion:[{watchHandler:0}]}}static get style(){return":host{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;vertical-align:middle;line-height:1}.svg-container{display:inline-flex;width:100%;height:100%;align-items:center;justify-content:center}.svg-container svg{width:100% !important;height:100% !important;stroke-width:var(--q-icon-stroke-width, 2.1) !important;display:block}.icon-fallback{display:inline-flex;align-items:center;justify-content:center;color:var(--q-color-danger, #f87171);opacity:0.8;width:100%;height:100%}.icon-fallback svg{width:100%;height:100%;stroke-width:var(--q-icon-stroke-width, 2.1);display:block}"}},[513,"q-icon",{name:[1],definition:[16],lib:[1],localPath:[1,"local-path"],libVersion:[1,"lib-version"],fetchTimeout:[2,"fetch-timeout"],size:[8],color:[1],label:[1],svgContent:[32],isBinary:[32],resolvedUrl:[32],hasError:[32],resolvedDefinition:[32]},void 0,{name:[{watchHandler:0}],definition:[{watchHandler:0}],lib:[{watchHandler:0}],localPath:[{watchHandler:0}],libVersion:[{watchHandler:0}]}]);function w(){"undefined"!=typeof customElements&&["q-icon"].forEach((t=>{"q-icon"===t&&(customElements.get(i(t))||customElements.define(i(t),v))}))}w();export{v as Q,w as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as r,p as s,H as e,h as a}from"./p-
|
|
1
|
+
import{t as r,p as s,H as e,h as a}from"./p-CVtof65h.js";import{c as i}from"./p-ByfrUWx1.js";const o=2*Math.PI*52,t=new Set(["sm","md","lg"]),l=s(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.__attachShadow()}value=0;label;indeterminate=!1;ariaValueText=null;variant="linear";size="md";tone="primary";ariaLabel=null;render(){const r=Number.isFinite(this.value)?this.value:0,s=Math.min(Math.max(r,0),100);return"circular"==("circular"===this.variant?"circular":"linear")?this.renderCircular(s):this.renderLinear(s)}renderLinear(r){return a("div",{class:"progress-linear",style:this.customSizeStyle(),...this.progressAttributes(r,this.ariaValueText?.trim()||`${r}%`),part:"container track"},a("span",{class:{"progress-linear__fill":!0,"is-indeterminate":this.indeterminate},style:this.indeterminate?void 0:{width:`${r}%`},part:"fill"}))}renderCircular(r){const s=void 0!==this.label?this.label:`${r}%`,e=i(s,"var(--q-progress-font-size, var(--_q-progress-font-size))",5),t=this.indeterminate?.75*o:o-r/100*o;return a("div",{class:"progress-circular",style:this.customSizeStyle(),...this.progressAttributes(r,this.ariaValueText?.trim()||s),part:"container"},a("svg",{class:"progress-circular__svg",viewBox:"0 0 120 120"},a("g",{class:"progress-circular__rings"},a("circle",{class:"progress-circular__track",cx:60,cy:60,r:52,part:"track"}),a("circle",{class:"progress-circular__fill",cx:60,cy:60,r:52,"stroke-dasharray":o,"stroke-dashoffset":t,part:"fill"})),!this.indeterminate&&a("text",{class:"progress-circular__label",x:"50%",y:"50%",style:e,part:"label"},s)))}progressAttributes(r,s){return{role:"progressbar","aria-label":this.ariaLabel?.trim()||"Progress","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":this.indeterminate?void 0:r,"aria-valuetext":this.indeterminate?void 0:s}}customSizeStyle(){if("string"==typeof this.size&&t.has(this.size))return;const r="number"==typeof this.size?this.size:Number(this.size);return Number.isFinite(r)?{"--_q-progress-custom-size":`${Math.max(0,r)}px`}:void 0}static get style(){return":host{display:block;width:100%;min-width:0;box-sizing:border-box;--_q-progress-linear-height:var(--q-progress-linear-height-md, 6px);--_q-progress-circular-size:var(--q-progress-circular-size-md, 120px);--_q-progress-stroke-width:var( --q-progress-circular-stroke-width-md, 8px );--_q-progress-font-size:var( --q-progress-circular-font-size-md, var(--q-font-size-lg, 1rem) );--_q-progress-track-color:var(--q-bg-surface-3, #22304d);--_q-progress-tone-color:var(--q-color-primary, #60a5fa)}:host([hidden]){display:none}:host([variant='circular']){display:inline-block;width:auto;--_q-progress-track-color:var(--q-border-color, #374151)}:host([size='sm']){--_q-progress-linear-height:var(--q-progress-linear-height-sm, 4px);--_q-progress-circular-size:var(--q-progress-circular-size-sm, 64px);--_q-progress-stroke-width:var( --q-progress-circular-stroke-width-sm, 6px );--_q-progress-font-size:var( --q-progress-circular-font-size-sm, var(--q-font-size-sm, 0.7rem) )}:host([size='lg']){--_q-progress-linear-height:var(--q-progress-linear-height-lg, 8px);--_q-progress-circular-size:var(--q-progress-circular-size-lg, 180px);--_q-progress-stroke-width:var( --q-progress-circular-stroke-width-lg, 10px );--_q-progress-font-size:var( --q-progress-circular-font-size-lg, calc(var(--q-font-size-lg, 1rem) * 1.5) )}:host([tone='neutral']){--_q-progress-tone-color:var(--q-fg-muted, #9ca3af)}:host([tone='primary']){--_q-progress-tone-color:var(--q-color-primary, #60a5fa)}:host([tone='success']){--_q-progress-tone-color:var(--q-color-success, #34d399)}:host([tone='warning']){--_q-progress-tone-color:var(--q-color-warning, #fbbf24)}:host([tone='danger']){--_q-progress-tone-color:var(--q-color-danger, #f87171)}.progress-linear{position:relative;width:100%;height:var( --q-progress-linear-height, var( --q-progress-bar-height, var(--_q-progress-custom-size, var(--_q-progress-linear-height)) ) );overflow:hidden;border-radius:var( --q-progress-linear-radius, var(--q-progress-bar-radius, 999px) );background:var( --q-progress-track-color, var(--q-progress-bar-track-color, var(--_q-progress-track-color)) )}.progress-linear__fill{display:block;height:100%;border-radius:inherit;background:var( --q-progress-fill-color, var(--q-progress-bar-fill-color, var(--_q-progress-tone-color)) );transition:width var( --q-progress-transition, var(--q-progress-bar-transition, var(--q-transition-normal, 250ms ease)) )}.progress-linear__fill.is-indeterminate{width:42%;animation:q-progress-linear-indeterminate var( --q-progress-indeterminate-duration, var(--q-progress-bar-indeterminate-duration, 1.4s) ) ease-in-out infinite}.progress-circular{width:var( --q-progress-circular-size, var( --q-progress-size, var(--_q-progress-custom-size, var(--_q-progress-circular-size)) ) );height:var( --q-progress-circular-size, var( --q-progress-size, var(--_q-progress-custom-size, var(--_q-progress-circular-size)) ) )}.progress-circular__svg{display:block;width:100%;height:100%}.progress-circular__rings{transform:rotate(-90deg);transform-origin:center}.progress-circular__track,.progress-circular__fill{fill:none;stroke-width:var( --q-progress-circular-stroke-width, var(--q-progress-stroke-width, var(--_q-progress-stroke-width)) )}.progress-circular__track{stroke:var(--q-progress-track-color, var(--_q-progress-track-color))}.progress-circular__fill{stroke:var( --q-progress-fill-color, var(--_q-progress-tone-color) );stroke-linecap:var(--q-progress-circular-linecap, round);transition:stroke-dashoffset var(--q-progress-transition, var(--q-transition-normal, 250ms ease))}.progress-circular__label{fill:var(--q-fg-base, #f9fafb);font-family:var(--q-font-family, inherit);font-size:var( --q-progress-circular-font-size, var(--q-progress-font-size, var(--_q-progress-font-size)) );font-weight:var( --q-progress-circular-font-weight, var(--q-progress-font-weight, var(--q-font-weight-bold, 600)) );text-anchor:middle;dominant-baseline:central}:host([variant='circular'][indeterminate]) .progress-circular__rings{animation:q-progress-circular-indeterminate var(--q-progress-indeterminate-duration, 1.4s) linear infinite}@keyframes q-progress-linear-indeterminate{0%{transform:translateX(-110%)}100%{transform:translateX(255%)}}@keyframes q-progress-circular-indeterminate{0%{transform:rotate(-90deg)}100%{transform:rotate(270deg)}}@media (prefers-reduced-motion: reduce){.progress-linear__fill,.progress-circular__fill{transition:none}.progress-linear__fill.is-indeterminate,:host([variant='circular'][indeterminate]) .progress-circular__rings{animation-duration:2.8s}}"}},[513,"q-progress",{value:[2],label:[1],indeterminate:[516],ariaValueText:[1,"aria-valuetext"],variant:[513],size:[520],tone:[513],ariaLabel:[1,"aria-label"]}]);function n(){"undefined"!=typeof customElements&&["q-progress"].forEach((s=>{"q-progress"===s&&(customElements.get(r(s))||customElements.define(r(s),l))}))}n();export{l as Q,n as d}
|