Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@microsoft/atlas-js

Package Overview
Dependencies
Maintainers
4
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/atlas-js - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

3

dist/elements/form-behavior.d.ts

@@ -67,2 +67,3 @@ declare class FormBehaviorElement extends HTMLElement {

}
declare type NavigationSteps = 'follow' | 'hash-reload' | 'replace' | 'reload' | null;
export interface FormValidationError {

@@ -79,5 +80,5 @@ message: string;

declare type Validator = (input: HTMLValueElement, label: string) => string | null;
export declare function navigateAfterSubmit(href: string, navigationStep: string | null): void;
export declare function navigateAfterSubmit(href: string, navigationStep: NavigationSteps): void;
export declare function collectCustomElementsByName(form: HTMLFormElement): Element[];
export {};
//# sourceMappingURL=form-behavior.d.ts.map

@@ -396,12 +396,2 @@ import { generateElementId, kebabToCamelCase } from '../utilities/util';

a.classList.add('help', 'help-danger');
/* a.addEventListener('click', e => {
console.log('e', e.target);
if (isCustomElement) {
const link = (e.target as HTMLAnchorElement).getAttribute('href');
if (link) {
console.log('click', document.querySelector(link));
(document.querySelector(link) as HTMLElement).focus();
}
}
}); */
child.appendChild(a);

@@ -506,2 +496,12 @@ errorList.appendChild(child);

break;
case 'hash-reload':
if (href) {
const search = href.includes('?') ? '' : window.location.search;
if (href !== search + window.location.hash) {
const state = (history.state || {});
window.history.pushState(state, document.title, window.location.pathname + search + href); // prevents scrolling to spot until reload
}
location.reload();
}
break;
case 'replace':

@@ -508,0 +508,0 @@ if (href) {

{
"name": "@microsoft/atlas-js",
"version": "1.2.0",
"version": "1.3.0",
"public": true,

@@ -5,0 +5,0 @@ "description": "Scripts backing the Atlas Design System used by Microsoft's Developer Relations.",

@@ -127,3 +127,3 @@ import { generateElementId, kebabToCamelCase } from '../utilities/util';

if (href) {
navigateAfterSubmit(href, this.getAttribute('navigation'));
navigateAfterSubmit(href, this.getAttribute('navigation') as NavigationSteps);
}

@@ -511,13 +511,2 @@ }

/* a.addEventListener('click', e => {
console.log('e', e.target);
if (isCustomElement) {
const link = (e.target as HTMLAnchorElement).getAttribute('href');
if (link) {
console.log('click', document.querySelector(link));
(document.querySelector(link) as HTMLElement).focus();
}
}
}); */
child.appendChild(a);

@@ -574,2 +563,4 @@ errorList.appendChild(child);

type NavigationSteps = 'follow' | 'hash-reload' | 'replace' | 'reload' | null;
export interface FormValidationError {

@@ -687,3 +678,3 @@ message: string;

export function navigateAfterSubmit(href: string, navigationStep: string | null) {
export function navigateAfterSubmit(href: string, navigationStep: NavigationSteps) {
switch (navigationStep) {

@@ -698,2 +689,12 @@ case null:

break;
case 'hash-reload':
if (href) {
const search = href.includes('?') ? '' : window.location.search;
if (href !== search + window.location.hash) {
const state = (history.state || {}) as Record<string, any>;
window.history.pushState(state, document.title, window.location.pathname + search + href); // prevents scrolling to spot until reload
}
location.reload();
}
break;
case 'replace':

@@ -700,0 +701,0 @@ if (href) {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc