@degreesign/ui 1.0.4 → 1.0.6

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/README.md CHANGED
@@ -2,7 +2,10 @@
2
2
 
3
3
  A lightweight TypeScript library for managing UI elements in web applications.
4
4
 
5
- ## Installation
5
+
6
+
7
+
8
+ ## Setup
6
9
 
7
10
  Install the package via npm:
8
11
 
@@ -10,6 +13,12 @@ Install the package via npm:
10
13
  npm install @degreesign/ui
11
14
  ```
12
15
 
16
+ OR use in browsers through CDN
17
+
18
+ ```html
19
+ <script src="https://cdn.jsdelivr.net/npm/@degreesign/ui@1.0.5/dist/browser/degreesign.min.js"></script>
20
+ ```
21
+
13
22
  ## Usage
14
23
 
15
24
  Import the functions from the `@degreesign/ui` package in your TypeScript or JavaScript project:
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see degreesign.min.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.degreesign=t():e.degreesign=t()}(this,(()=>(()=>{"use strict";var e={};return(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0}),t.repeatElements=t.hideElement=t.showElement=t.selectAll=t.selectElement=void 0;const l=e=>("string"==typeof e&&(e=document.querySelector(e)),e);t.selectElement=(e,t)=>(l(t)||document)?.querySelector(e),t.selectAll=(e,t)=>(l(t)||document)?.querySelectorAll(e),t.showElement=e=>e&&(e.style.display="flex"),t.hideElement=e=>e&&(e.style.display="none"),t.repeatElements=({children:e,parent:t,targetCount:o})=>{try{const n=l(t);if(e?.length){const t=e?.length||0;if(o>t)for(let l=t;l<o;l++)n?.appendChild(e?.[0]?.cloneNode(!0));else if(o<t&&0!=o)for(let l=t-1;l>=o;l--)e[l]?.remove()}}catch(e){console.log("Error repeating elements",o,e)}}})(),e})()));
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.degreesign=t():e.degreesign=t()}(this,(()=>(()=>{"use strict";var e={};return(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0}),t.repeatElements=t.hideElement=t.showElement=t.selectAll=t.selectElement=void 0;const o=e=>("string"==typeof e&&(e=document.querySelector(e)),e);t.selectElement=(e,t)=>(o(t)||document)?.querySelector(e),t.selectAll=(e,t)=>(o(t)||document)?.querySelectorAll(e),t.showElement=e=>e&&(e.style.display="flex"),t.hideElement=e=>e&&(e.style.display="none"),t.repeatElements=({children:e,parent:t,targetCount:l})=>{try{const n=o(t);if(e=e||n?.children,e?.length){const t=e?.length||0;if(l>t){const o=e?.[0];if(o)for(let e=t;e<l;e++)n?n.appendChild(o.cloneNode(!0)):o?.after(o.cloneNode(!0))}else if(l<t&&0!=l)for(let o=t-1;o>=l;o--)e[o]?.remove()}}catch(e){console.log("Error repeating elements",l,e)}}})(),e})()));
package/dist/index.d.ts CHANGED
@@ -2,9 +2,9 @@ declare const selectElement: (id: string, parent?: Element | string) => HTMLElem
2
2
  /** Repeat Elements */
3
3
  repeatElements: ({ children, parent, targetCount, }: {
4
4
  /** Child Element Nodes */
5
- children?: NodeListOf<Element>;
5
+ children?: NodeListOf<Element> | HTMLCollection;
6
6
  /** Parent Element */
7
- parent: Element | string;
7
+ parent?: Element | HTMLElement | string;
8
8
  /** Target Count */
9
9
  targetCount: number;
10
10
  }) => void;
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see degreesign.node.min.js.LICENSE.txt */
2
- (()=>{"use strict";var e={};(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0}),t.repeatElements=t.hideElement=t.showElement=t.selectAll=t.selectElement=void 0;const l=e=>("string"==typeof e&&(e=document.querySelector(e)),e);t.selectElement=(e,t)=>(l(t)||document)?.querySelector(e),t.selectAll=(e,t)=>(l(t)||document)?.querySelectorAll(e),t.showElement=e=>e&&(e.style.display="flex"),t.hideElement=e=>e&&(e.style.display="none"),t.repeatElements=({children:e,parent:t,targetCount:o})=>{try{const r=l(t);if(e?.length){const t=e?.length||0;if(o>t)for(let l=t;l<o;l++)r?.appendChild(e?.[0]?.cloneNode(!0));else if(o<t&&0!=o)for(let l=t-1;l>=o;l--)e[l]?.remove()}}catch(e){console.log("Error repeating elements",o,e)}}})();var t=exports;for(var l in e)t[l]=e[l];e.__esModule&&Object.defineProperty(t,"__esModule",{value:!0})})();
2
+ (()=>{"use strict";var e={};(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0}),t.repeatElements=t.hideElement=t.showElement=t.selectAll=t.selectElement=void 0;const l=e=>("string"==typeof e&&(e=document.querySelector(e)),e);t.selectElement=(e,t)=>(l(t)||document)?.querySelector(e),t.selectAll=(e,t)=>(l(t)||document)?.querySelectorAll(e),t.showElement=e=>e&&(e.style.display="flex"),t.hideElement=e=>e&&(e.style.display="none"),t.repeatElements=({children:e,parent:t,targetCount:o})=>{try{const n=l(t);if(e=e||n?.children,e?.length){const t=e?.length||0;if(o>t){const l=e?.[0];if(l)for(let e=t;e<o;e++)n?n.appendChild(l.cloneNode(!0)):l?.after(l.cloneNode(!0))}else if(o<t&&0!=o)for(let l=t-1;l>=o;l--)e[l]?.remove()}}catch(e){console.log("Error repeating elements",o,e)}}})();var t=exports;for(var l in e)t[l]=e[l];e.__esModule&&Object.defineProperty(t,"__esModule",{value:!0})})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@degreesign/ui",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "DegreeSign UI Controls",
5
5
  "main": "dist/node/degreesign.node.min.js",
6
6
  "module": "dist/node/degreesign.node.min.js",