@synergy-design-system/components 1.0.0-main.2 → 1.0.0-main.20
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 +9 -0
- package/README.md +150 -1
- package/dist/chunks/chunk.23HTU3YE.js +189 -0
- package/dist/chunks/chunk.23HTU3YE.js.map +7 -0
- package/dist/chunks/chunk.27VJRQCE.js +224 -0
- package/dist/chunks/chunk.27VJRQCE.js.map +7 -0
- package/dist/chunks/chunk.2XZKXVMR.js +44 -0
- package/dist/chunks/chunk.2XZKXVMR.js.map +7 -0
- package/dist/chunks/chunk.36BORWIU.js +351 -0
- package/dist/chunks/chunk.36BORWIU.js.map +7 -0
- package/dist/chunks/chunk.4CBN5LPQ.js +137 -0
- package/dist/chunks/chunk.4CBN5LPQ.js.map +7 -0
- package/dist/chunks/chunk.4I6M5V6O.js +56 -0
- package/dist/chunks/chunk.4I6M5V6O.js.map +7 -0
- package/dist/chunks/chunk.4XAK6MOQ.js +45 -0
- package/dist/chunks/chunk.4XAK6MOQ.js.map +7 -0
- package/dist/chunks/chunk.4ZURABYO.js +24 -0
- package/dist/chunks/chunk.4ZURABYO.js.map +7 -0
- package/dist/chunks/chunk.6C4JXZZN.js +15 -0
- package/dist/chunks/chunk.6C4JXZZN.js.map +7 -0
- package/dist/chunks/chunk.7IH6VY33.js +12 -0
- package/dist/chunks/chunk.7IH6VY33.js.map +7 -0
- package/dist/chunks/chunk.A3SKDWCT.js +42 -0
- package/dist/chunks/chunk.A3SKDWCT.js.map +7 -0
- package/dist/chunks/chunk.A6SRE7EI.js +280 -0
- package/dist/chunks/chunk.A6SRE7EI.js.map +7 -0
- package/dist/chunks/chunk.AFEABUNX.js +107 -0
- package/dist/chunks/chunk.AFEABUNX.js.map +7 -0
- package/dist/chunks/chunk.C7624ITA.js +30 -0
- package/dist/chunks/chunk.C7624ITA.js.map +7 -0
- package/dist/chunks/chunk.CLAMILD3.js +175 -0
- package/dist/chunks/chunk.CLAMILD3.js.map +7 -0
- package/dist/chunks/chunk.CODFHJDI.js +360 -0
- package/dist/chunks/chunk.CODFHJDI.js.map +7 -0
- package/dist/chunks/chunk.CRL545VA.js +63 -0
- package/dist/chunks/chunk.CRL545VA.js.map +7 -0
- package/dist/chunks/chunk.DJOAQ4JU.js +36 -0
- package/dist/chunks/chunk.DJOAQ4JU.js.map +7 -0
- package/dist/chunks/chunk.E2GBU3G6.js +12 -0
- package/dist/chunks/chunk.E2GBU3G6.js.map +7 -0
- package/dist/chunks/chunk.F4MKRDFE.js +127 -0
- package/dist/chunks/chunk.F4MKRDFE.js.map +7 -0
- package/dist/chunks/chunk.F4MRQLNL.js +25 -0
- package/dist/chunks/chunk.F4MRQLNL.js.map +7 -0
- package/dist/chunks/chunk.FVSP4LXX.js +138 -0
- package/dist/chunks/chunk.FVSP4LXX.js.map +7 -0
- package/dist/chunks/chunk.GDNBN76M.js +86 -0
- package/dist/chunks/chunk.GDNBN76M.js.map +7 -0
- package/dist/chunks/chunk.GNAJOKCJ.js +32 -0
- package/dist/chunks/chunk.GNAJOKCJ.js.map +7 -0
- package/dist/chunks/chunk.H5LJXPMK.js +12 -0
- package/dist/chunks/chunk.H5LJXPMK.js.map +7 -0
- package/dist/chunks/chunk.HC2BCHTH.js +480 -0
- package/dist/chunks/chunk.HC2BCHTH.js.map +7 -0
- package/dist/chunks/chunk.HD5XNRL6.js +12 -0
- package/dist/chunks/chunk.HD5XNRL6.js.map +7 -0
- package/dist/chunks/chunk.JBYBQ5TQ.js +132 -0
- package/dist/chunks/chunk.JBYBQ5TQ.js.map +7 -0
- package/dist/chunks/chunk.JHXCBOUD.js +123 -0
- package/dist/chunks/chunk.JHXCBOUD.js.map +7 -0
- package/dist/chunks/chunk.KXVHGSJZ.js +12 -0
- package/dist/chunks/chunk.KXVHGSJZ.js.map +7 -0
- package/dist/chunks/chunk.MMHKLOBP.js +12 -0
- package/dist/chunks/chunk.MMHKLOBP.js.map +7 -0
- package/dist/chunks/chunk.MNMITYTH.js +184 -0
- package/dist/chunks/chunk.MNMITYTH.js.map +7 -0
- package/dist/chunks/chunk.N2I6HVX3.js +71 -0
- package/dist/chunks/chunk.N2I6HVX3.js.map +7 -0
- package/dist/chunks/chunk.NKIYFJN2.js +1 -0
- package/dist/chunks/chunk.NKIYFJN2.js.map +7 -0
- package/dist/chunks/chunk.O7USYXBT.js +23 -0
- package/dist/chunks/chunk.O7USYXBT.js.map +7 -0
- package/dist/chunks/chunk.OVVMSN4D.js +37 -0
- package/dist/chunks/chunk.OVVMSN4D.js.map +7 -0
- package/dist/chunks/chunk.OXUFFH57.js +318 -0
- package/dist/chunks/chunk.OXUFFH57.js.map +7 -0
- package/dist/chunks/chunk.P2LNG2PZ.js +275 -0
- package/dist/chunks/chunk.P2LNG2PZ.js.map +7 -0
- package/dist/chunks/chunk.PJO6TM3T.js +10 -0
- package/dist/chunks/chunk.PJO6TM3T.js.map +7 -0
- package/dist/chunks/chunk.QAOCPWQU.js +12 -0
- package/dist/chunks/chunk.QAOCPWQU.js.map +7 -0
- package/dist/chunks/chunk.QPGMTMMJ.js +12 -0
- package/dist/chunks/chunk.QPGMTMMJ.js.map +7 -0
- package/dist/chunks/chunk.R6VNLE6N.js +11 -0
- package/dist/chunks/chunk.R6VNLE6N.js.map +7 -0
- package/dist/chunks/chunk.RSONAU45.js +33 -0
- package/dist/chunks/chunk.RSONAU45.js.map +7 -0
- package/dist/chunks/chunk.S545KS4R.js +111 -0
- package/dist/chunks/chunk.S545KS4R.js.map +7 -0
- package/dist/chunks/chunk.SGXORY4I.js +12 -0
- package/dist/chunks/chunk.SGXORY4I.js.map +7 -0
- package/dist/chunks/chunk.V6VND4OF.js +49 -0
- package/dist/chunks/chunk.V6VND4OF.js.map +7 -0
- package/dist/chunks/chunk.VZ7S7YYN.js +34 -0
- package/dist/chunks/chunk.VZ7S7YYN.js.map +7 -0
- package/dist/chunks/chunk.W46CFM2R.js +90 -0
- package/dist/chunks/chunk.W46CFM2R.js.map +7 -0
- package/dist/chunks/chunk.WFAJR3FN.js +25 -0
- package/dist/chunks/chunk.WFAJR3FN.js.map +7 -0
- package/dist/chunks/chunk.WJBBJ5U3.js +32 -0
- package/dist/chunks/chunk.WJBBJ5U3.js.map +7 -0
- package/dist/chunks/chunk.WUT3EE6L.js +12 -0
- package/dist/chunks/chunk.WUT3EE6L.js.map +7 -0
- package/dist/chunks/chunk.X3WNKQPZ.js +212 -0
- package/dist/chunks/chunk.X3WNKQPZ.js.map +7 -0
- package/dist/chunks/chunk.XGXFE6IF.js +49 -0
- package/dist/chunks/chunk.XGXFE6IF.js.map +7 -0
- package/dist/chunks/chunk.YBIBWRKC.js +19 -0
- package/dist/chunks/chunk.YBIBWRKC.js.map +7 -0
- package/dist/chunks/chunk.YTS5TRJZ.js +376 -0
- package/dist/chunks/chunk.YTS5TRJZ.js.map +7 -0
- package/dist/chunks/chunk.Z3RZUTQU.js +42 -0
- package/dist/chunks/chunk.Z3RZUTQU.js.map +7 -0
- package/dist/components/button/button.component.d.ts +123 -0
- package/dist/components/button/button.component.js +26 -0
- package/dist/components/button/button.component.js.map +7 -0
- package/dist/components/button/button.custom.styles.d.ts +2 -0
- package/dist/components/button/button.custom.styles.js +8 -0
- package/dist/components/button/button.custom.styles.js.map +7 -0
- package/dist/components/button/button.d.ts +8 -0
- package/dist/components/button/button.js +27 -0
- package/dist/components/button/button.js.map +7 -0
- package/dist/components/button/button.styles.d.ts +2 -0
- package/dist/components/button/button.styles.js +10 -0
- package/dist/components/button/button.styles.js.map +7 -0
- package/dist/components/button-group/button-group.component.d.ts +28 -0
- package/dist/components/button-group/button-group.component.js +11 -0
- package/dist/components/button-group/button-group.component.js.map +7 -0
- package/dist/components/button-group/button-group.d.ts +8 -0
- package/dist/components/button-group/button-group.js +12 -0
- package/dist/components/button-group/button-group.js.map +7 -0
- package/dist/components/button-group/button-group.styles.d.ts +2 -0
- package/dist/components/button-group/button-group.styles.js +9 -0
- package/dist/components/button-group/button-group.styles.js.map +7 -0
- package/dist/components/checkbox/checkbox.component.d.ts +93 -0
- package/dist/components/checkbox/checkbox.component.js +22 -0
- package/dist/components/checkbox/checkbox.component.js.map +7 -0
- package/dist/components/checkbox/checkbox.custom.styles.d.ts +2 -0
- package/dist/components/checkbox/checkbox.custom.styles.js +8 -0
- package/dist/components/checkbox/checkbox.custom.styles.js.map +7 -0
- package/dist/components/checkbox/checkbox.d.ts +8 -0
- package/dist/components/checkbox/checkbox.js +23 -0
- package/dist/components/checkbox/checkbox.js.map +7 -0
- package/dist/components/checkbox/checkbox.styles.d.ts +2 -0
- package/dist/components/checkbox/checkbox.styles.js +10 -0
- package/dist/components/checkbox/checkbox.styles.js.map +7 -0
- package/dist/components/icon/icon.component.d.ts +42 -0
- package/dist/components/icon/icon.component.js +17 -0
- package/dist/components/icon/icon.component.js.map +7 -0
- package/dist/components/icon/icon.custom.styles.d.ts +2 -0
- package/dist/components/icon/icon.custom.styles.js +8 -0
- package/dist/components/icon/icon.custom.styles.js.map +7 -0
- package/dist/components/icon/icon.d.ts +8 -0
- package/dist/components/icon/icon.js +18 -0
- package/dist/components/icon/icon.js.map +7 -0
- package/dist/components/icon/icon.styles.d.ts +2 -0
- package/dist/components/icon/icon.styles.js +10 -0
- package/dist/components/icon/icon.styles.js.map +7 -0
- package/dist/components/icon/library.d.ts +19 -0
- package/dist/components/icon/library.default.d.ts +3 -0
- package/dist/components/icon/library.default.js +9 -0
- package/dist/components/icon/library.default.js.map +7 -0
- package/dist/components/icon/library.js +19 -0
- package/dist/components/icon/library.js.map +7 -0
- package/dist/components/icon/library.system.d.ts +3 -0
- package/dist/components/icon/library.system.js +8 -0
- package/dist/components/icon/library.system.js.map +7 -0
- package/dist/components/input/input.component.d.ts +175 -0
- package/dist/components/input/input.component.js +26 -0
- package/dist/components/input/input.component.js.map +7 -0
- package/dist/components/input/input.custom.styles.d.ts +2 -0
- package/dist/components/input/input.custom.styles.js +8 -0
- package/dist/components/input/input.custom.styles.js.map +7 -0
- package/dist/components/input/input.d.ts +8 -0
- package/dist/components/input/input.js +27 -0
- package/dist/components/input/input.js.map +7 -0
- package/dist/components/input/input.styles.d.ts +2 -0
- package/dist/components/input/input.styles.js +11 -0
- package/dist/components/input/input.styles.js.map +7 -0
- package/dist/components/radio/radio.component.d.ts +53 -0
- package/dist/components/radio/radio.component.js +20 -0
- package/dist/components/radio/radio.component.js.map +7 -0
- package/dist/components/radio/radio.custom.styles.d.ts +2 -0
- package/dist/components/radio/radio.custom.styles.js +8 -0
- package/dist/components/radio/radio.custom.styles.js.map +7 -0
- package/dist/components/radio/radio.d.ts +8 -0
- package/dist/components/radio/radio.js +21 -0
- package/dist/components/radio/radio.js.map +7 -0
- package/dist/components/radio/radio.styles.d.ts +2 -0
- package/dist/components/radio/radio.styles.js +10 -0
- package/dist/components/radio/radio.styles.js.map +7 -0
- package/dist/components/radio-button/radio-button.component.d.ts +53 -0
- package/dist/components/radio-button/radio-button.component.js +15 -0
- package/dist/components/radio-button/radio-button.component.js.map +7 -0
- package/dist/components/radio-button/radio-button.d.ts +8 -0
- package/dist/components/radio-button/radio-button.js +16 -0
- package/dist/components/radio-button/radio-button.js.map +7 -0
- package/dist/components/radio-button/radio-button.styles.d.ts +2 -0
- package/dist/components/radio-button/radio-button.styles.js +11 -0
- package/dist/components/radio-button/radio-button.styles.js.map +7 -0
- package/dist/components/radio-group/radio-group.component.d.ts +89 -0
- package/dist/components/radio-group/radio-group.component.js +18 -0
- package/dist/components/radio-group/radio-group.component.js.map +7 -0
- package/dist/components/radio-group/radio-group.custom.styles.d.ts +2 -0
- package/dist/components/radio-group/radio-group.custom.styles.js +8 -0
- package/dist/components/radio-group/radio-group.custom.styles.js.map +7 -0
- package/dist/components/radio-group/radio-group.d.ts +8 -0
- package/dist/components/radio-group/radio-group.js +19 -0
- package/dist/components/radio-group/radio-group.js.map +7 -0
- package/dist/components/radio-group/radio-group.styles.d.ts +2 -0
- package/dist/components/radio-group/radio-group.styles.js +11 -0
- package/dist/components/radio-group/radio-group.styles.js.map +7 -0
- package/dist/components/spinner/spinner.component.d.ts +20 -0
- package/dist/components/spinner/spinner.component.js +13 -0
- package/dist/components/spinner/spinner.component.js.map +7 -0
- package/dist/components/spinner/spinner.styles.d.ts +2 -0
- package/dist/components/spinner/spinner.styles.js +9 -0
- package/dist/components/spinner/spinner.styles.js.map +7 -0
- package/dist/components/switch/switch.component.d.ts +86 -0
- package/dist/components/switch/switch.component.js +15 -0
- package/dist/components/switch/switch.component.js.map +7 -0
- package/dist/components/switch/switch.custom.styles.d.ts +2 -0
- package/dist/components/switch/switch.custom.styles.js +8 -0
- package/dist/components/switch/switch.custom.styles.js.map +7 -0
- package/dist/components/switch/switch.d.ts +8 -0
- package/dist/components/switch/switch.js +16 -0
- package/dist/components/switch/switch.js.map +7 -0
- package/dist/components/switch/switch.styles.d.ts +2 -0
- package/dist/components/switch/switch.styles.js +10 -0
- package/dist/components/switch/switch.styles.js.map +7 -0
- package/dist/components/textarea/textarea.component.d.ts +131 -0
- package/dist/components/textarea/textarea.component.js +17 -0
- package/dist/components/textarea/textarea.component.js.map +7 -0
- package/dist/components/textarea/textarea.custom.styles.d.ts +2 -0
- package/dist/components/textarea/textarea.custom.styles.js +8 -0
- package/dist/components/textarea/textarea.custom.styles.js.map +7 -0
- package/dist/components/textarea/textarea.d.ts +8 -0
- package/dist/components/textarea/textarea.js +18 -0
- package/dist/components/textarea/textarea.js.map +7 -0
- package/dist/components/textarea/textarea.styles.d.ts +2 -0
- package/dist/components/textarea/textarea.styles.js +11 -0
- package/dist/components/textarea/textarea.styles.js.map +7 -0
- package/dist/custom-elements.json +4462 -0
- package/dist/events/events.d.ts +8 -0
- package/dist/events/syn-blur.d.ts +6 -0
- package/dist/events/syn-change.d.ts +6 -0
- package/dist/events/syn-clear.d.ts +6 -0
- package/dist/events/syn-error.d.ts +8 -0
- package/dist/events/syn-focus.d.ts +6 -0
- package/dist/events/syn-input.d.ts +6 -0
- package/dist/events/syn-invalid.d.ts +6 -0
- package/dist/events/syn-load.d.ts +6 -0
- package/dist/internal/default-value.d.ts +2 -0
- package/dist/internal/form.d.ts +73 -0
- package/dist/internal/slot.d.ts +23 -0
- package/dist/internal/synergy-element.d.ts +47 -0
- package/dist/internal/test/form-control-base-tests.d.ts +7 -0
- package/dist/internal/test.d.ts +28 -0
- package/dist/internal/watch.d.ts +26 -0
- package/dist/styles/component.styles.d.ts +2 -0
- package/dist/styles/form-control.custom.styles.d.ts +2 -0
- package/dist/styles/form-control.styles.d.ts +2 -0
- package/dist/synergy-autoloader.d.ts +4 -0
- package/dist/synergy-autoloader.js +41 -0
- package/dist/synergy-autoloader.js.map +7 -0
- package/dist/synergy.d.ts +14 -0
- package/dist/synergy.js +104 -0
- package/dist/synergy.js.map +7 -0
- package/dist/translations/de.d.ts +3 -0
- package/dist/translations/de.js +46 -0
- package/dist/translations/de.js.map +7 -0
- package/dist/translations/en.d.ts +3 -0
- package/dist/translations/en.js +8 -0
- package/dist/translations/en.js.map +7 -0
- package/dist/utilities/base-path.d.ts +18 -0
- package/dist/utilities/base-path.js +10 -0
- package/dist/utilities/base-path.js.map +7 -0
- package/dist/utilities/form.d.ts +11 -0
- package/dist/utilities/form.js +11 -0
- package/dist/utilities/form.js.map +7 -0
- package/dist/utilities/icon-library.d.ts +1 -0
- package/dist/utilities/icon-library.js +14 -0
- package/dist/utilities/icon-library.js.map +7 -0
- package/dist/utilities/localize.d.ts +33 -0
- package/dist/utilities/localize.js +11 -0
- package/dist/utilities/localize.js.map +7 -0
- package/dist/vscode.html-custom-data.json +760 -0
- package/dist/web-types.json +1596 -0
- package/package.json +61 -29
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/icon/library.ts"],
|
|
4
|
+
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport defaultLibrary from './library.default.js';\nimport systemLibrary from './library.system.js';\nimport type SynIcon from '../icon/icon.js';\n\nexport type IconLibraryResolver = (name: string) => string;\nexport type IconLibraryMutator = (svg: SVGElement) => void;\nexport interface IconLibrary {\n name: string;\n resolver: IconLibraryResolver;\n mutator?: IconLibraryMutator;\n spriteSheet?: boolean;\n}\n\nlet registry: IconLibrary[] = [defaultLibrary, systemLibrary];\nlet watchedIcons: SynIcon[] = [];\n\n/** Adds an icon to the list of watched icons. */\nexport function watchIcon(icon: SynIcon) {\n watchedIcons.push(icon);\n}\n\n/** Removes an icon from the list of watched icons. */\nexport function unwatchIcon(icon: SynIcon) {\n watchedIcons = watchedIcons.filter(el => el !== icon);\n}\n\n/** Returns a library from the registry. */\nexport function getIconLibrary(name?: string) {\n return registry.find(lib => lib.name === name);\n}\n\n/** Adds an icon library to the registry, or overrides an existing one. */\nexport function registerIconLibrary(name: string, options: Omit<IconLibrary, 'name'>) {\n unregisterIconLibrary(name);\n registry.push({\n name,\n resolver: options.resolver,\n mutator: options.mutator,\n spriteSheet: options.spriteSheet\n });\n\n // Redraw watched icons\n watchedIcons.forEach(icon => {\n if (icon.library === name) {\n icon.setIcon();\n }\n });\n}\n\n/** Removes an icon library from the registry. */\nexport function unregisterIconLibrary(name: string) {\n registry = registry.filter(lib => lib.name !== name);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAmBA,IAAI,WAA0B,CAAC,yBAAgB,sBAAa;AAC5D,IAAI,eAA0B,CAAC;AAGxB,SAAS,UAAU,MAAe;AACvC,eAAa,KAAK,IAAI;AACxB;AAGO,SAAS,YAAY,MAAe;AACzC,iBAAe,aAAa,OAAO,QAAM,OAAO,IAAI;AACtD;AAGO,SAAS,eAAe,MAAe;AAC5C,SAAO,SAAS,KAAK,SAAO,IAAI,SAAS,IAAI;AAC/C;AAGO,SAAS,oBAAoB,MAAc,SAAoC;AACpF,wBAAsB,IAAI;AAC1B,WAAS,KAAK;AAAA,IACZ;AAAA,IACA,UAAU,QAAQ;AAAA,IAClB,SAAS,QAAQ;AAAA,IACjB,aAAa,QAAQ;AAAA,EACvB,CAAC;AAGD,eAAa,QAAQ,UAAQ;AAC3B,QAAI,KAAK,YAAY,MAAM;AACzB,WAAK,QAAQ;AAAA,IACf;AAAA,EACF,CAAC;AACH;AAGO,SAAS,sBAAsB,MAAc;AAClD,aAAW,SAAS,OAAO,SAAO,IAAI,SAAS,IAAI;AACrD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
component_styles_default
|
|
3
|
+
} from "./chunk.O7USYXBT.js";
|
|
4
|
+
|
|
5
|
+
// src/components/button-group/button-group.styles.ts
|
|
6
|
+
import { css } from "lit";
|
|
7
|
+
var button_group_styles_default = css`
|
|
8
|
+
/* stylelint-disable */
|
|
9
|
+
${component_styles_default}
|
|
10
|
+
|
|
11
|
+
:host {
|
|
12
|
+
display: inline-block;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.button-group {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-wrap: nowrap;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
button_group_styles_default
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=chunk.4ZURABYO.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/button-group/button-group.styles.ts"],
|
|
4
|
+
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport { css } from 'lit';\nimport componentStyles from '../../styles/component.styles.js';\n\nexport default css`\n\t/* stylelint-disable */\n ${componentStyles}\n\n :host {\n display: inline-block;\n }\n\n .button-group {\n display: flex;\n flex-wrap: nowrap;\n }\n`;\n"],
|
|
5
|
+
"mappings": ";;;;;AAMA,SAAS,WAAW;AAGpB,IAAO,8BAAQ;AAAA;AAAA,IAEX,wBAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getBasePath
|
|
3
|
+
} from "./chunk.C7624ITA.js";
|
|
4
|
+
|
|
5
|
+
// src/components/icon/library.default.ts
|
|
6
|
+
var library = {
|
|
7
|
+
name: "default",
|
|
8
|
+
resolver: (name) => getBasePath(`assets/icons/${name}.svg`)
|
|
9
|
+
};
|
|
10
|
+
var library_default_default = library;
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
library_default_default
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=chunk.6C4JXZZN.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/icon/library.default.ts"],
|
|
4
|
+
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport { getBasePath } from '../../utilities/base-path.js';\nimport type { IconLibrary } from './library.js';\n\nconst library: IconLibrary = {\n name: 'default',\n resolver: name => getBasePath(`assets/icons/${name}.svg`)\n};\n\nexport default library;\n"],
|
|
5
|
+
"mappings": ";;;;;AASA,IAAM,UAAuB;AAAA,EAC3B,MAAM;AAAA,EACN,UAAU,UAAQ,YAAY,gBAAgB,IAAI,MAAM;AAC1D;AAEA,IAAO,0BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/radio/radio.ts"],
|
|
4
|
+
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport SynRadio from './radio.component.js';\n\nexport * from './radio.component.js';\nexport default SynRadio;\n\nSynRadio.define('syn-radio');\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'syn-radio': SynRadio;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AASA,IAAO,gBAAQ;AAEf,SAAS,OAAO,WAAW;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// src/translations/en.ts
|
|
2
|
+
import { registerTranslation } from "@shoelace-style/localize";
|
|
3
|
+
var translation = {
|
|
4
|
+
$code: "en",
|
|
5
|
+
$name: "English",
|
|
6
|
+
$dir: "ltr",
|
|
7
|
+
carousel: "Carousel",
|
|
8
|
+
clearEntry: "Clear entry",
|
|
9
|
+
close: "Close",
|
|
10
|
+
copied: "Copied",
|
|
11
|
+
copy: "Copy",
|
|
12
|
+
currentValue: "Current value",
|
|
13
|
+
error: "Error",
|
|
14
|
+
goToSlide: (slide, count) => `Go to slide ${slide} of ${count}`,
|
|
15
|
+
hidePassword: "Hide password",
|
|
16
|
+
loading: "Loading",
|
|
17
|
+
nextSlide: "Next slide",
|
|
18
|
+
numOptionsSelected: (num) => {
|
|
19
|
+
if (num === 0)
|
|
20
|
+
return "No options selected";
|
|
21
|
+
if (num === 1)
|
|
22
|
+
return "1 option selected";
|
|
23
|
+
return `${num} options selected`;
|
|
24
|
+
},
|
|
25
|
+
previousSlide: "Previous slide",
|
|
26
|
+
progress: "Progress",
|
|
27
|
+
remove: "Remove",
|
|
28
|
+
resize: "Resize",
|
|
29
|
+
scrollToEnd: "Scroll to end",
|
|
30
|
+
scrollToStart: "Scroll to start",
|
|
31
|
+
selectAColorFromTheScreen: "Select a color from the screen",
|
|
32
|
+
showPassword: "Show password",
|
|
33
|
+
slideNum: (slide) => `Slide ${slide}`,
|
|
34
|
+
toggleColorFormat: "Toggle color format"
|
|
35
|
+
};
|
|
36
|
+
registerTranslation(translation);
|
|
37
|
+
var en_default = translation;
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
en_default
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=chunk.A3SKDWCT.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/translations/en.ts"],
|
|
4
|
+
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport { registerTranslation } from '@shoelace-style/localize';\nimport type { Translation } from '../utilities/localize.js';\n\nconst translation: Translation = {\n $code: 'en',\n $name: 'English',\n $dir: 'ltr',\n\n carousel: 'Carousel',\n clearEntry: 'Clear entry',\n close: 'Close',\n copied: 'Copied',\n copy: 'Copy',\n currentValue: 'Current value',\n error: 'Error',\n goToSlide: (slide, count) => `Go to slide ${slide} of ${count}`,\n hidePassword: 'Hide password',\n loading: 'Loading',\n nextSlide: 'Next slide',\n numOptionsSelected: num => {\n if (num === 0) return 'No options selected';\n if (num === 1) return '1 option selected';\n return `${num} options selected`;\n },\n previousSlide: 'Previous slide',\n progress: 'Progress',\n remove: 'Remove',\n resize: 'Resize',\n scrollToEnd: 'Scroll to end',\n scrollToStart: 'Scroll to start',\n selectAColorFromTheScreen: 'Select a color from the screen',\n showPassword: 'Show password',\n slideNum: slide => `Slide ${slide}`,\n toggleColorFormat: 'Toggle color format'\n};\n\nregisterTranslation(translation);\n\nexport default translation;\n"],
|
|
5
|
+
"mappings": ";AAMA,SAAS,2BAA2B;AAGpC,IAAM,cAA2B;AAAA,EAC/B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AAAA,EAEN,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,cAAc;AAAA,EACd,OAAO;AAAA,EACP,WAAW,CAAC,OAAO,UAAU,eAAe,KAAK,OAAO,KAAK;AAAA,EAC7D,cAAc;AAAA,EACd,SAAS;AAAA,EACT,WAAW;AAAA,EACX,oBAAoB,SAAO;AACzB,QAAI,QAAQ;AAAG,aAAO;AACtB,QAAI,QAAQ;AAAG,aAAO;AACtB,WAAO,GAAG,GAAG;AAAA,EACf;AAAA,EACA,eAAe;AAAA,EACf,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,eAAe;AAAA,EACf,2BAA2B;AAAA,EAC3B,cAAc;AAAA,EACd,UAAU,WAAS,SAAS,KAAK;AAAA,EACjC,mBAAmB;AACrB;AAEA,oBAAoB,WAAW;AAE/B,IAAO,aAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SynSpinner
|
|
3
|
+
} from "./chunk.WJBBJ5U3.js";
|
|
4
|
+
import {
|
|
5
|
+
LocalizeController
|
|
6
|
+
} from "./chunk.R6VNLE6N.js";
|
|
7
|
+
import {
|
|
8
|
+
HasSlotController
|
|
9
|
+
} from "./chunk.XGXFE6IF.js";
|
|
10
|
+
import {
|
|
11
|
+
FormControlController,
|
|
12
|
+
validValidityState
|
|
13
|
+
} from "./chunk.P2LNG2PZ.js";
|
|
14
|
+
import {
|
|
15
|
+
SynIcon
|
|
16
|
+
} from "./chunk.CLAMILD3.js";
|
|
17
|
+
import {
|
|
18
|
+
watch
|
|
19
|
+
} from "./chunk.VZ7S7YYN.js";
|
|
20
|
+
import {
|
|
21
|
+
button_styles_default
|
|
22
|
+
} from "./chunk.YTS5TRJZ.js";
|
|
23
|
+
import {
|
|
24
|
+
SynergyElement
|
|
25
|
+
} from "./chunk.CRL545VA.js";
|
|
26
|
+
import {
|
|
27
|
+
__decorateClass
|
|
28
|
+
} from "./chunk.DJOAQ4JU.js";
|
|
29
|
+
|
|
30
|
+
// src/components/button/button.component.ts
|
|
31
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
32
|
+
import { html, literal } from "lit/static-html.js";
|
|
33
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
34
|
+
import { property, query, state } from "lit/decorators.js";
|
|
35
|
+
var SynButton = class extends SynergyElement {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(...arguments);
|
|
38
|
+
this.formControlController = new FormControlController(this, {
|
|
39
|
+
form: (input) => {
|
|
40
|
+
if (input.hasAttribute("form")) {
|
|
41
|
+
const doc = input.getRootNode();
|
|
42
|
+
const formId = input.getAttribute("form");
|
|
43
|
+
return doc.getElementById(formId);
|
|
44
|
+
}
|
|
45
|
+
return input.closest("form");
|
|
46
|
+
},
|
|
47
|
+
assumeInteractionOn: ["click"]
|
|
48
|
+
});
|
|
49
|
+
this.hasSlotController = new HasSlotController(this, "[default]", "prefix", "suffix");
|
|
50
|
+
this.localize = new LocalizeController(this);
|
|
51
|
+
this.hasFocus = false;
|
|
52
|
+
this.invalid = false;
|
|
53
|
+
this.title = "";
|
|
54
|
+
this.variant = "outline";
|
|
55
|
+
this.size = "medium";
|
|
56
|
+
this.caret = false;
|
|
57
|
+
this.disabled = false;
|
|
58
|
+
this.loading = false;
|
|
59
|
+
this.type = "button";
|
|
60
|
+
this.name = "";
|
|
61
|
+
this.value = "";
|
|
62
|
+
this.href = "";
|
|
63
|
+
this.rel = "noreferrer noopener";
|
|
64
|
+
}
|
|
65
|
+
/** Gets the validity state object */
|
|
66
|
+
get validity() {
|
|
67
|
+
if (this.isButton()) {
|
|
68
|
+
return this.button.validity;
|
|
69
|
+
}
|
|
70
|
+
return validValidityState;
|
|
71
|
+
}
|
|
72
|
+
/** Gets the validation message */
|
|
73
|
+
get validationMessage() {
|
|
74
|
+
if (this.isButton()) {
|
|
75
|
+
return this.button.validationMessage;
|
|
76
|
+
}
|
|
77
|
+
return "";
|
|
78
|
+
}
|
|
79
|
+
firstUpdated() {
|
|
80
|
+
if (this.isButton()) {
|
|
81
|
+
this.formControlController.updateValidity();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
handleBlur() {
|
|
85
|
+
this.hasFocus = false;
|
|
86
|
+
this.emit("syn-blur");
|
|
87
|
+
}
|
|
88
|
+
handleFocus() {
|
|
89
|
+
this.hasFocus = true;
|
|
90
|
+
this.emit("syn-focus");
|
|
91
|
+
}
|
|
92
|
+
handleClick() {
|
|
93
|
+
if (this.type === "submit") {
|
|
94
|
+
this.formControlController.submit(this);
|
|
95
|
+
}
|
|
96
|
+
if (this.type === "reset") {
|
|
97
|
+
this.formControlController.reset(this);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
handleInvalid(event) {
|
|
101
|
+
this.formControlController.setValidity(false);
|
|
102
|
+
this.formControlController.emitInvalidEvent(event);
|
|
103
|
+
}
|
|
104
|
+
isButton() {
|
|
105
|
+
return this.href ? false : true;
|
|
106
|
+
}
|
|
107
|
+
isLink() {
|
|
108
|
+
return this.href ? true : false;
|
|
109
|
+
}
|
|
110
|
+
handleDisabledChange() {
|
|
111
|
+
if (this.isButton()) {
|
|
112
|
+
this.formControlController.setValidity(this.disabled);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/** Simulates a click on the button. */
|
|
116
|
+
click() {
|
|
117
|
+
this.button.click();
|
|
118
|
+
}
|
|
119
|
+
/** Sets focus on the button. */
|
|
120
|
+
focus(options) {
|
|
121
|
+
this.button.focus(options);
|
|
122
|
+
}
|
|
123
|
+
/** Removes focus from the button. */
|
|
124
|
+
blur() {
|
|
125
|
+
this.button.blur();
|
|
126
|
+
}
|
|
127
|
+
/** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */
|
|
128
|
+
checkValidity() {
|
|
129
|
+
if (this.isButton()) {
|
|
130
|
+
return this.button.checkValidity();
|
|
131
|
+
}
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
/** Gets the associated form, if one exists. */
|
|
135
|
+
getForm() {
|
|
136
|
+
return this.formControlController.getForm();
|
|
137
|
+
}
|
|
138
|
+
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
139
|
+
reportValidity() {
|
|
140
|
+
if (this.isButton()) {
|
|
141
|
+
return this.button.reportValidity();
|
|
142
|
+
}
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
/** Sets a custom validation message. Pass an empty string to restore validity. */
|
|
146
|
+
setCustomValidity(message) {
|
|
147
|
+
if (this.isButton()) {
|
|
148
|
+
this.button.setCustomValidity(message);
|
|
149
|
+
this.formControlController.updateValidity();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
render() {
|
|
153
|
+
const isLink = this.isLink();
|
|
154
|
+
const tag = isLink ? literal`a` : literal`button`;
|
|
155
|
+
return html`
|
|
156
|
+
<${tag}
|
|
157
|
+
part="base"
|
|
158
|
+
class=${classMap({
|
|
159
|
+
button: true,
|
|
160
|
+
"button--primary": true,
|
|
161
|
+
"button--text": this.variant === "text",
|
|
162
|
+
"button--small": this.size === "small",
|
|
163
|
+
"button--medium": this.size === "medium",
|
|
164
|
+
"button--large": this.size === "large",
|
|
165
|
+
"button--caret": this.caret,
|
|
166
|
+
"button--disabled": this.disabled,
|
|
167
|
+
"button--focused": this.hasFocus,
|
|
168
|
+
"button--loading": this.loading,
|
|
169
|
+
"button--filled": this.variant === "filled",
|
|
170
|
+
"button--outline": this.variant === "outline",
|
|
171
|
+
"button--rtl": this.localize.dir() === "rtl",
|
|
172
|
+
"button--has-label": this.hasSlotController.test("[default]"),
|
|
173
|
+
"button--has-prefix": this.hasSlotController.test("prefix"),
|
|
174
|
+
"button--has-suffix": this.hasSlotController.test("suffix")
|
|
175
|
+
})}
|
|
176
|
+
?disabled=${ifDefined(isLink ? void 0 : this.disabled)}
|
|
177
|
+
type=${ifDefined(isLink ? void 0 : this.type)}
|
|
178
|
+
title=${this.title}
|
|
179
|
+
name=${ifDefined(isLink ? void 0 : this.name)}
|
|
180
|
+
value=${ifDefined(isLink ? void 0 : this.value)}
|
|
181
|
+
href=${ifDefined(isLink ? this.href : void 0)}
|
|
182
|
+
target=${ifDefined(isLink ? this.target : void 0)}
|
|
183
|
+
download=${ifDefined(isLink ? this.download : void 0)}
|
|
184
|
+
rel=${ifDefined(isLink ? this.rel : void 0)}
|
|
185
|
+
role=${ifDefined(isLink ? void 0 : "button")}
|
|
186
|
+
aria-disabled=${this.disabled ? "true" : "false"}
|
|
187
|
+
tabindex=${this.disabled ? "-1" : "0"}
|
|
188
|
+
@blur=${this.handleBlur}
|
|
189
|
+
@focus=${this.handleFocus}
|
|
190
|
+
@invalid=${this.isButton() ? this.handleInvalid : null}
|
|
191
|
+
@click=${this.handleClick}
|
|
192
|
+
>
|
|
193
|
+
<slot name="prefix" part="prefix" class="button__prefix"></slot>
|
|
194
|
+
<slot part="label" class="button__label"></slot>
|
|
195
|
+
<slot name="suffix" part="suffix" class="button__suffix"></slot>
|
|
196
|
+
${this.caret ? html` <syn-icon part="caret" class="button__caret" library="system" name="caret"></syn-icon> ` : ""}
|
|
197
|
+
${this.loading ? html`<syn-spinner part="spinner"></syn-spinner>` : ""}
|
|
198
|
+
</${tag}>
|
|
199
|
+
`;
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
SynButton.styles = button_styles_default;
|
|
203
|
+
SynButton.dependencies = {
|
|
204
|
+
"syn-icon": SynIcon,
|
|
205
|
+
"syn-spinner": SynSpinner
|
|
206
|
+
};
|
|
207
|
+
__decorateClass([
|
|
208
|
+
query(".button")
|
|
209
|
+
], SynButton.prototype, "button", 2);
|
|
210
|
+
__decorateClass([
|
|
211
|
+
state()
|
|
212
|
+
], SynButton.prototype, "hasFocus", 2);
|
|
213
|
+
__decorateClass([
|
|
214
|
+
state()
|
|
215
|
+
], SynButton.prototype, "invalid", 2);
|
|
216
|
+
__decorateClass([
|
|
217
|
+
property()
|
|
218
|
+
], SynButton.prototype, "title", 2);
|
|
219
|
+
__decorateClass([
|
|
220
|
+
property({ reflect: true })
|
|
221
|
+
], SynButton.prototype, "variant", 2);
|
|
222
|
+
__decorateClass([
|
|
223
|
+
property({ reflect: true })
|
|
224
|
+
], SynButton.prototype, "size", 2);
|
|
225
|
+
__decorateClass([
|
|
226
|
+
property({ type: Boolean, reflect: true })
|
|
227
|
+
], SynButton.prototype, "caret", 2);
|
|
228
|
+
__decorateClass([
|
|
229
|
+
property({ type: Boolean, reflect: true })
|
|
230
|
+
], SynButton.prototype, "disabled", 2);
|
|
231
|
+
__decorateClass([
|
|
232
|
+
property({ type: Boolean, reflect: true })
|
|
233
|
+
], SynButton.prototype, "loading", 2);
|
|
234
|
+
__decorateClass([
|
|
235
|
+
property()
|
|
236
|
+
], SynButton.prototype, "type", 2);
|
|
237
|
+
__decorateClass([
|
|
238
|
+
property()
|
|
239
|
+
], SynButton.prototype, "name", 2);
|
|
240
|
+
__decorateClass([
|
|
241
|
+
property()
|
|
242
|
+
], SynButton.prototype, "value", 2);
|
|
243
|
+
__decorateClass([
|
|
244
|
+
property()
|
|
245
|
+
], SynButton.prototype, "href", 2);
|
|
246
|
+
__decorateClass([
|
|
247
|
+
property()
|
|
248
|
+
], SynButton.prototype, "target", 2);
|
|
249
|
+
__decorateClass([
|
|
250
|
+
property()
|
|
251
|
+
], SynButton.prototype, "rel", 2);
|
|
252
|
+
__decorateClass([
|
|
253
|
+
property()
|
|
254
|
+
], SynButton.prototype, "download", 2);
|
|
255
|
+
__decorateClass([
|
|
256
|
+
property()
|
|
257
|
+
], SynButton.prototype, "form", 2);
|
|
258
|
+
__decorateClass([
|
|
259
|
+
property({ attribute: "formaction" })
|
|
260
|
+
], SynButton.prototype, "formAction", 2);
|
|
261
|
+
__decorateClass([
|
|
262
|
+
property({ attribute: "formenctype" })
|
|
263
|
+
], SynButton.prototype, "formEnctype", 2);
|
|
264
|
+
__decorateClass([
|
|
265
|
+
property({ attribute: "formmethod" })
|
|
266
|
+
], SynButton.prototype, "formMethod", 2);
|
|
267
|
+
__decorateClass([
|
|
268
|
+
property({ attribute: "formnovalidate", type: Boolean })
|
|
269
|
+
], SynButton.prototype, "formNoValidate", 2);
|
|
270
|
+
__decorateClass([
|
|
271
|
+
property({ attribute: "formtarget" })
|
|
272
|
+
], SynButton.prototype, "formTarget", 2);
|
|
273
|
+
__decorateClass([
|
|
274
|
+
watch("disabled", { waitUntilFirstUpdate: true })
|
|
275
|
+
], SynButton.prototype, "handleDisabledChange", 1);
|
|
276
|
+
|
|
277
|
+
export {
|
|
278
|
+
SynButton
|
|
279
|
+
};
|
|
280
|
+
//# sourceMappingURL=chunk.A6SRE7EI.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/button/button.component.ts"],
|
|
4
|
+
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport { classMap } from 'lit/directives/class-map.js';\nimport { FormControlController, validValidityState } from '../../internal/form.js';\nimport { HasSlotController } from '../../internal/slot.js';\nimport { html, literal } from 'lit/static-html.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { LocalizeController } from '../../utilities/localize.js';\nimport { property, query, state } from 'lit/decorators.js';\nimport { watch } from '../../internal/watch.js';\nimport SynergyElement from '../../internal/synergy-element.js';\nimport SynIcon from '../icon/icon.component.js';\nimport SynSpinner from '../spinner/spinner.component.js';\nimport styles from './button.styles.js';\nimport type { CSSResultGroup } from 'lit';\nimport type { SynergyFormControl } from '../../internal/synergy-element.js';\n\n/**\n * @summary Buttons represent actions that are available to the user.\n * @documentation https://synergy.style/components/button\n * @status stable\n * @since 2.0\n *\n * @dependency syn-icon\n * @dependency syn-spinner\n *\n * @event syn-blur - Emitted when the button loses focus.\n * @event syn-focus - Emitted when the button gains focus.\n * @event syn-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n *\n * @slot - The button's label.\n * @slot prefix - A presentational prefix icon or similar element.\n * @slot suffix - A presentational suffix icon or similar element.\n *\n * @csspart base - The component's base wrapper.\n * @csspart prefix - The container that wraps the prefix.\n * @csspart label - The button's label.\n * @csspart suffix - The container that wraps the suffix.\n * @csspart caret - The button's caret icon, an `<syn-icon>` element.\n * @csspart spinner - The spinner that shows when the button is in the loading state.\n */\nexport default class SynButton extends SynergyElement implements SynergyFormControl {\n static styles: CSSResultGroup = styles;\n static dependencies = {\n 'syn-icon': SynIcon,\n 'syn-spinner': SynSpinner\n };\n\n private readonly formControlController = new FormControlController(this, {\n form: input => {\n // Buttons support a form attribute that points to an arbitrary form, so if this attribute is set we need to query\n // the form from the same root using its id\n if (input.hasAttribute('form')) {\n const doc = input.getRootNode() as Document | ShadowRoot;\n const formId = input.getAttribute('form')!;\n return doc.getElementById(formId) as HTMLFormElement;\n }\n\n // Fall back to the closest containing form\n return input.closest('form');\n },\n assumeInteractionOn: ['click']\n });\n private readonly hasSlotController = new HasSlotController(this, '[default]', 'prefix', 'suffix');\n private readonly localize = new LocalizeController(this);\n\n @query('.button') button: HTMLButtonElement | HTMLLinkElement;\n\n @state() private hasFocus = false;\n @state() invalid = false;\n @property() title = ''; // make reactive to pass through\n\n /** The button's theme variant. */\n @property({ reflect: true }) variant: 'filled' | 'outline' | 'text' = 'outline';\n\n /** The button's size. */\n @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Draws the button with a caret. Used to indicate that the button triggers a dropdown menu or similar behavior. */\n @property({ type: Boolean, reflect: true }) caret = false;\n\n /** Disables the button. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Draws the button in a loading state. */\n @property({ type: Boolean, reflect: true }) loading = false;\n\n /**\n * The type of button. Note that the default value is `button` instead of `submit`, which is opposite of how native\n * `<button>` elements behave. When the type is `submit`, the button will submit the surrounding form.\n */\n @property() type: 'button' | 'submit' | 'reset' = 'button';\n\n /**\n * The name of the button, submitted as a name/value pair with form data, but only when this button is the submitter.\n * This attribute is ignored when `href` is present.\n */\n @property() name = '';\n\n /**\n * The value of the button, submitted as a pair with the button's name as part of the form data, but only when this\n * button is the submitter. This attribute is ignored when `href` is present.\n */\n @property() value = '';\n\n /** When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`. */\n @property() href = '';\n\n /** Tells the browser where to open the link. Only used when `href` is present. */\n @property() target: '_blank' | '_parent' | '_self' | '_top';\n\n /**\n * When using `href`, this attribute will map to the underlying link's `rel` attribute. Unlike regular links, the\n * default is `noreferrer noopener` to prevent security exploits. However, if you're using `target` to point to a\n * specific tab/window, this will prevent that from working correctly. You can remove or change the default value by\n * setting the attribute to an empty string or a value of your choice, respectively.\n */\n @property() rel = 'noreferrer noopener';\n\n /** Tells the browser to download the linked file as this filename. Only used when `href` is present. */\n @property() download?: string;\n\n /**\n * The \"form owner\" to associate the button with. If omitted, the closest containing form will be used instead. The\n * value of this attribute must be an id of a form in the same document or shadow root as the button.\n */\n @property() form: string;\n\n /** Used to override the form owner's `action` attribute. */\n @property({ attribute: 'formaction' }) formAction: string;\n\n /** Used to override the form owner's `enctype` attribute. */\n @property({ attribute: 'formenctype' })\n formEnctype: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';\n\n /** Used to override the form owner's `method` attribute. */\n @property({ attribute: 'formmethod' }) formMethod: 'post' | 'get';\n\n /** Used to override the form owner's `novalidate` attribute. */\n @property({ attribute: 'formnovalidate', type: Boolean }) formNoValidate: boolean;\n\n /** Used to override the form owner's `target` attribute. */\n @property({ attribute: 'formtarget' }) formTarget: '_self' | '_blank' | '_parent' | '_top' | string;\n\n /** Gets the validity state object */\n get validity() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).validity;\n }\n\n return validValidityState;\n }\n\n /** Gets the validation message */\n get validationMessage() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).validationMessage;\n }\n\n return '';\n }\n\n firstUpdated() {\n if (this.isButton()) {\n this.formControlController.updateValidity();\n }\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('syn-blur');\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('syn-focus');\n }\n\n private handleClick() {\n if (this.type === 'submit') {\n this.formControlController.submit(this);\n }\n\n if (this.type === 'reset') {\n this.formControlController.reset(this);\n }\n }\n\n private handleInvalid(event: Event) {\n this.formControlController.setValidity(false);\n this.formControlController.emitInvalidEvent(event);\n }\n\n private isButton() {\n return this.href ? false : true;\n }\n\n private isLink() {\n return this.href ? true : false;\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange() {\n if (this.isButton()) {\n // Disabled form controls are always valid\n this.formControlController.setValidity(this.disabled);\n }\n }\n\n /** Simulates a click on the button. */\n click() {\n this.button.click();\n }\n\n /** Sets focus on the button. */\n focus(options?: FocusOptions) {\n this.button.focus(options);\n }\n\n /** Removes focus from the button. */\n blur() {\n this.button.blur();\n }\n\n /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */\n checkValidity() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).checkValidity();\n }\n\n return true;\n }\n\n /** Gets the associated form, if one exists. */\n getForm(): HTMLFormElement | null {\n return this.formControlController.getForm();\n }\n\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n reportValidity() {\n if (this.isButton()) {\n return (this.button as HTMLButtonElement).reportValidity();\n }\n\n return true;\n }\n\n /** Sets a custom validation message. Pass an empty string to restore validity. */\n setCustomValidity(message: string) {\n if (this.isButton()) {\n (this.button as HTMLButtonElement).setCustomValidity(message);\n this.formControlController.updateValidity();\n }\n }\n\n render() {\n const isLink = this.isLink();\n const tag = isLink ? literal`a` : literal`button`;\n\n /* eslint-disable lit/no-invalid-html */\n /* eslint-disable lit/binding-positions */\n return html`\n <${tag}\n part=\"base\"\n class=${classMap({\n button: true,\n 'button--primary': true,\n 'button--text': this.variant === 'text',\n 'button--small': this.size === 'small',\n 'button--medium': this.size === 'medium',\n 'button--large': this.size === 'large',\n 'button--caret': this.caret,\n 'button--disabled': this.disabled,\n 'button--focused': this.hasFocus,\n 'button--loading': this.loading,\n 'button--filled': this.variant === 'filled',\n 'button--outline': this.variant === 'outline',\n 'button--rtl': this.localize.dir() === 'rtl',\n 'button--has-label': this.hasSlotController.test('[default]'),\n 'button--has-prefix': this.hasSlotController.test('prefix'),\n 'button--has-suffix': this.hasSlotController.test('suffix')\n })}\n ?disabled=${ifDefined(isLink ? undefined : this.disabled)}\n type=${ifDefined(isLink ? undefined : this.type)}\n title=${this.title /* An empty title prevents browser validation tooltips from appearing on hover */}\n name=${ifDefined(isLink ? undefined : this.name)}\n value=${ifDefined(isLink ? undefined : this.value)}\n href=${ifDefined(isLink ? this.href : undefined)}\n target=${ifDefined(isLink ? this.target : undefined)}\n download=${ifDefined(isLink ? this.download : undefined)}\n rel=${ifDefined(isLink ? this.rel : undefined)}\n role=${ifDefined(isLink ? undefined : 'button')}\n aria-disabled=${this.disabled ? 'true' : 'false'}\n tabindex=${this.disabled ? '-1' : '0'}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n @invalid=${this.isButton() ? this.handleInvalid : null}\n @click=${this.handleClick}\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"button__prefix\"></slot>\n <slot part=\"label\" class=\"button__label\"></slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"button__suffix\"></slot>\n ${\n this.caret ? html` <syn-icon part=\"caret\" class=\"button__caret\" library=\"system\" name=\"caret\"></syn-icon> ` : ''\n }\n ${this.loading ? html`<syn-spinner part=\"spinner\"></syn-spinner>` : ''}\n </${tag}>\n `;\n /* eslint-enable lit/no-invalid-html */\n /* eslint-enable lit/binding-positions */\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,SAAS,gBAAgB;AAGzB,SAAS,MAAM,eAAe;AAC9B,SAAS,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E,WAAW,aAAa,CAAC;AAAA,GAxFlB,UAwFoB;AAIvC;AAAA,EADC,SAAS,EAAE,WAAW,cAAc,CAAC;AAAA,GA3FnB,UA4FnB;AAGuC;AAAA,EAAtC,SAAS,EAAE,WAAW,aAAa,CAAC;AAAA,GA/FlB,UA+FoB;AAGmB;AAAA,EAAzD,SAAS,EAAE,WAAW,kBAAkB,MAAM,QAAQ,CAAC;AAAA,GAlGrC,UAkGuC;AAGnB;AAAA,EAAtC,SAAS,EAAE,WAAW,aAAa,CAAC;AAAA,GArGlB,UAqGoB;AA4DvC;AAAA,EADC,MAAM,YAAY,EAAE,sBAAsB,KAAK,CAAC;AAAA,GAhK9B,UAiKnB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// src/components/switch/switch.custom.styles.ts
|
|
2
|
+
import { css } from "lit";
|
|
3
|
+
var switch_custom_styles_default = css`
|
|
4
|
+
:host([size='small']) {
|
|
5
|
+
--height: calc(var(--syn-font-size-medium) + 2px);
|
|
6
|
+
--thumb-size: var(--syn-font-size-small);
|
|
7
|
+
--width: calc((var(--height) * 2) - 6px);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host([size='medium']) {
|
|
11
|
+
--height: var(--syn-font-size-large);
|
|
12
|
+
--thumb-size: var(--syn-font-size-medium);
|
|
13
|
+
--width: calc((var(--height) * 2) - 6px);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([size='large']) {
|
|
17
|
+
--height: calc(var(--syn-toggle-size-large) + 4px);
|
|
18
|
+
--thumb-size: var(--syn-toggle-size-large);
|
|
19
|
+
--width: calc((var(--height) * 2) - 6px);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.switch.switch--small {
|
|
23
|
+
padding: var(--syn-spacing-2x-small) 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.switch.switch--medium {
|
|
27
|
+
padding: var(--syn-spacing-2x-small) 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.switch.switch--large {
|
|
31
|
+
padding: var(--syn-spacing-3x-small) 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.switch__control {
|
|
35
|
+
background-color: var(--syn-color-neutral-600);
|
|
36
|
+
border: solid var(--syn-border-width-medium) var(--syn-color-neutral-600);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.switch__control .switch__thumb {
|
|
40
|
+
border: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Hover */
|
|
44
|
+
.switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover {
|
|
45
|
+
background-color: var(--syn-color-neutral-900);
|
|
46
|
+
border-color: var(--syn-color-neutral-900);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover .switch__thumb {
|
|
50
|
+
background-color: var(--syn-color-neutral-0);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Checked + hover */
|
|
54
|
+
.switch.switch--checked:not(.switch--disabled) .switch__control:hover {
|
|
55
|
+
background-color: var(--syn-color-primary-900);
|
|
56
|
+
border-color: var(--syn-color-primary-900);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb {
|
|
60
|
+
background-color: var(--syn-color-neutral-0);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Focus */
|
|
64
|
+
.switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {
|
|
65
|
+
background-color: var(--syn-color-neutral-600);
|
|
66
|
+
border-color: var(--syn-color-neutral-600);
|
|
67
|
+
outline: var(--syn-focus-ring);
|
|
68
|
+
outline-offset: var(--syn-focus-ring-offset);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {
|
|
72
|
+
background-color: var(--syn-color-neutral-0);
|
|
73
|
+
outline: none;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Checked + focus */
|
|
77
|
+
.switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {
|
|
78
|
+
background-color: var(--syn-color-primary-900);
|
|
79
|
+
border-color: var(--syn-color-primary-900);
|
|
80
|
+
outline: var(--syn-focus-ring);
|
|
81
|
+
outline-offset: var(--syn-focus-ring-offset);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {
|
|
85
|
+
background-color: var(--syn-color-neutral-0);
|
|
86
|
+
outline: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.switch__label {
|
|
90
|
+
margin-inline-start: var(--syn-spacing-x-small);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
:host([data-user-invalid]) .switch:not(.switch--checked):not(.switch--disabled) .switch__control {
|
|
94
|
+
background-color: var(--syn-color-error-700);
|
|
95
|
+
border-color: var(--syn-color-error-700);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:host([data-user-invalid]) .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover {
|
|
99
|
+
background-color: var(--syn-color-error-900);
|
|
100
|
+
border-color: var(--syn-color-error-900);
|
|
101
|
+
}
|
|
102
|
+
`;
|
|
103
|
+
|
|
104
|
+
export {
|
|
105
|
+
switch_custom_styles_default
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=chunk.AFEABUNX.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/switch/switch.custom.styles.ts"],
|
|
4
|
+
"sourcesContent": ["import { css } from 'lit';\n\nexport default css`\n:host([size='small']) {\n --height: calc(var(--syn-font-size-medium) + 2px);\n --thumb-size: var(--syn-font-size-small);\n --width: calc((var(--height) * 2) - 6px);\n }\n\n :host([size='medium']) {\n --height: var(--syn-font-size-large);\n --thumb-size: var(--syn-font-size-medium);\n --width: calc((var(--height) * 2) - 6px);\n }\n\n :host([size='large']) {\n --height: calc(var(--syn-toggle-size-large) + 4px);\n --thumb-size: var(--syn-toggle-size-large);\n --width: calc((var(--height) * 2) - 6px);\n }\n\n .switch.switch--small {\n padding: var(--syn-spacing-2x-small) 0;\n }\n\n .switch.switch--medium {\n padding: var(--syn-spacing-2x-small) 0;\n }\n\n .switch.switch--large {\n padding: var(--syn-spacing-3x-small) 0;\n }\n\n .switch__control {\n background-color: var(--syn-color-neutral-600);\n border: solid var(--syn-border-width-medium) var(--syn-color-neutral-600);\n }\n\n .switch__control .switch__thumb {\n border: none;\n }\n\n /* Hover */\n .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover {\n background-color: var(--syn-color-neutral-900);\n border-color: var(--syn-color-neutral-900);\n }\n\n .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover .switch__thumb {\n background-color: var(--syn-color-neutral-0);\n }\n\n /* Checked + hover */\n .switch.switch--checked:not(.switch--disabled) .switch__control:hover {\n background-color: var(--syn-color-primary-900);\n border-color: var(--syn-color-primary-900);\n }\n\n .switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb {\n background-color: var(--syn-color-neutral-0);\n }\n\n /* Focus */\n .switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {\n background-color: var(--syn-color-neutral-600);\n border-color: var(--syn-color-neutral-600);\n outline: var(--syn-focus-ring);\n outline-offset: var(--syn-focus-ring-offset);\n }\n\n .switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {\n background-color: var(--syn-color-neutral-0);\n outline: none;\n }\n\n /* Checked + focus */\n .switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {\n background-color: var(--syn-color-primary-900);\n border-color: var(--syn-color-primary-900);\n outline: var(--syn-focus-ring);\n outline-offset: var(--syn-focus-ring-offset);\n }\n\n .switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {\n background-color: var(--syn-color-neutral-0);\n outline: none;\n }\n\n .switch__label {\n margin-inline-start: var(--syn-spacing-x-small);\n }\n \n :host([data-user-invalid]) .switch:not(.switch--checked):not(.switch--disabled) .switch__control {\n background-color: var(--syn-color-error-700);\n border-color: var(--syn-color-error-700);\n }\n\n :host([data-user-invalid]) .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover {\n background-color: var(--syn-color-error-900);\n border-color: var(--syn-color-error-900);\n }\n `;\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,WAAW;AAEpB,IAAO,+BAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// src/utilities/base-path.ts
|
|
2
|
+
var basePath = "";
|
|
3
|
+
function setBasePath(path) {
|
|
4
|
+
basePath = path;
|
|
5
|
+
}
|
|
6
|
+
function getBasePath(subpath = "") {
|
|
7
|
+
if (!basePath) {
|
|
8
|
+
const scripts = [...document.getElementsByTagName("script")];
|
|
9
|
+
const configScript = scripts.find((script) => script.hasAttribute("data-synergy"));
|
|
10
|
+
if (configScript) {
|
|
11
|
+
setBasePath(configScript.getAttribute("data-synergy"));
|
|
12
|
+
} else {
|
|
13
|
+
const fallbackScript = scripts.find((s) => {
|
|
14
|
+
return /synergy(\.min)?\.js($|\?)/.test(s.src) || /synergy-autoloader(\.min)?\.js($|\?)/.test(s.src);
|
|
15
|
+
});
|
|
16
|
+
let path = "";
|
|
17
|
+
if (fallbackScript) {
|
|
18
|
+
path = fallbackScript.getAttribute("src");
|
|
19
|
+
}
|
|
20
|
+
setBasePath(path.split("/").slice(0, -1).join("/"));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return basePath.replace(/\/$/, "") + (subpath ? `/${subpath.replace(/^\//, "")}` : ``);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
setBasePath,
|
|
28
|
+
getBasePath
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=chunk.C7624ITA.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utilities/base-path.ts"],
|
|
4
|
+
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nlet basePath = '';\n\n/** Sets the library's base path to the specified directory. */\nexport function setBasePath(path: string) {\n basePath = path;\n}\n\n/**\n * Gets the library's base path.\n *\n * The base path is used to load assets such as icons and images, so it needs to be set for components to work properly.\n * By default, this script will look for a script ending in synergy.js or synergy-autoloader.js and set the base path\n * to the directory that contains that file. To override this behavior, you can add the data-synergy attribute to any\n * script on the page (it probably makes the most sense to attach it to the Synergy script, but it could also be on a\n * bundle). The value can be a local folder or it can point to a CORS-enabled endpoint such as a CDN.\n *\n * <script src=\"bundle.js\" data-synergy=\"/custom/base/path\"></script>\n *\n * Alternatively, you can set the base path manually using the exported setBasePath() function.\n *\n * @param subpath - An optional path to append to the base path.\n */\nexport function getBasePath(subpath = '') {\n if (!basePath) {\n const scripts = [...document.getElementsByTagName('script')] as HTMLScriptElement[];\n const configScript = scripts.find(script => script.hasAttribute('data-synergy'));\n\n if (configScript) {\n // Use the data-synergy attribute\n setBasePath(configScript.getAttribute('data-synergy')!);\n } else {\n const fallbackScript = scripts.find(s => {\n return /synergy(\\.min)?\\.js($|\\?)/.test(s.src) || /synergy-autoloader(\\.min)?\\.js($|\\?)/.test(s.src);\n });\n let path = '';\n\n if (fallbackScript) {\n path = fallbackScript.getAttribute('src')!;\n }\n\n setBasePath(path.split('/').slice(0, -1).join('/'));\n }\n }\n\n // Return the base path without a trailing slash. If one exists, append the subpath separated by a slash.\n return basePath.replace(/\\/$/, '') + (subpath ? `/${subpath.replace(/^\\//, '')}` : ``);\n}\n"],
|
|
5
|
+
"mappings": ";AAMA,IAAI,WAAW;AAGR,SAAS,YAAY,MAAc;AACxC,aAAW;AACb;AAiBO,SAAS,YAAY,UAAU,IAAI;AACxC,MAAI,CAAC,UAAU;AACb,UAAM,UAAU,CAAC,GAAG,SAAS,qBAAqB,QAAQ,CAAC;AAC3D,UAAM,eAAe,QAAQ,KAAK,YAAU,OAAO,aAAa,cAAc,CAAC;AAE/E,QAAI,cAAc;AAEhB,kBAAY,aAAa,aAAa,cAAc,CAAE;AAAA,IACxD,OAAO;AACL,YAAM,iBAAiB,QAAQ,KAAK,OAAK;AACvC,eAAO,4BAA4B,KAAK,EAAE,GAAG,KAAK,uCAAuC,KAAK,EAAE,GAAG;AAAA,MACrG,CAAC;AACD,UAAI,OAAO;AAEX,UAAI,gBAAgB;AAClB,eAAO,eAAe,aAAa,KAAK;AAAA,MAC1C;AAEA,kBAAY,KAAK,MAAM,GAAG,EAAE,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG,CAAC;AAAA,IACpD;AAAA,EACF;AAGA,SAAO,SAAS,QAAQ,OAAO,EAAE,KAAK,UAAU,IAAI,QAAQ,QAAQ,OAAO,EAAE,CAAC,KAAK;AACrF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|