@proximus/lavender-fieldset 1.0.0-alpha.2

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.
Files changed (2) hide show
  1. package/dist/index.js +35 -0
  2. package/package.json +41 -0
package/dist/index.js ADDED
@@ -0,0 +1,35 @@
1
+ import { PxElement as o } from "@proximus/lavender-common";
2
+ const d = "fieldset{margin:0;padding:0;border:0}", n = new CSSStyleSheet();
3
+ n.replaceSync(d);
4
+ const i = class i extends o {
5
+ constructor() {
6
+ var e;
7
+ super(n), this.template = () => `<fieldset>
8
+ <legend><slot name="legend"></slot></legend>
9
+ <slot></slot>
10
+ </fieldset>`, this.shadowRoot.innerHTML = this.template(), this.internals = (e = this.attachInternals) == null ? void 0 : e.call(this);
11
+ }
12
+ static get observedAttributes() {
13
+ return [...super.observedAttributes];
14
+ }
15
+ connectedCallback() {
16
+ var t;
17
+ const e = this.querySelector('[slot="legend"]');
18
+ (!e || !((t = e.textContent) != null && t.trim())) && console.error(
19
+ '<px-fieldset> requires a slot="legend" containing the description of the fieldset.'
20
+ );
21
+ }
22
+ attributeChangedCallback(e, t, l) {
23
+ t !== l && (e === "disabled" ? this.querySelectorAll(
24
+ "px-radio-group, px-radio, px-checkbox, px-fileupload, px-input, px-textarea, px-select, px-switch"
25
+ ).forEach((r) => {
26
+ r.setAttribute(e, "true");
27
+ }) : super.attributeChangedCallback(e, t, l));
28
+ }
29
+ };
30
+ i.nativeName = "fieldset";
31
+ let s = i;
32
+ customElements.define("px-fieldset", s);
33
+ export {
34
+ s as Fieldset
35
+ };
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@proximus/lavender-fieldset",
3
+ "version": "1.0.0-alpha.2",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./src/index.ts",
9
+ "development": "./src/index.ts",
10
+ "default": "./dist/index.js"
11
+ },
12
+ "./src/*.css": {
13
+ "development": "src/*.css"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "type": "module",
20
+ "scripts": {
21
+ "build": "rm -rf dist;tsc; vite build",
22
+ "test": "vitest run --coverage"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "gitHead": "bad89d519c6fc1d431ebc46bee89fcd80cf18b83",
28
+ "lerna": {
29
+ "command": {
30
+ "publish": {
31
+ "assets": [
32
+ "CHANGELOG.md",
33
+ "package.json",
34
+ "dist/*.js",
35
+ "dist/*.cjs",
36
+ "dist/css/**/*.css"
37
+ ]
38
+ }
39
+ }
40
+ }
41
+ }