Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
@ssv/ngx.ux
Advanced tools
UX essentials for building apps, utilities which enables you writing richer apps easier.
UX essentials for building apps, utilities which enables you writing richer apps easier.
Quick links
Change logs | Project Repository
Get library via npm
npm install @ssv/ngx.ux
import { SsvUxModule } from "@ssv/ngx.ux";
@NgModule({
imports: [
SsvUxModule
]
}
export class AppModule {
}
Provides utilities to handle responsiveness easier based on the viewport (view size)
Operand | Description |
---|---|
= | Equals |
<> | Not equals |
< | Less than |
<= | Less than or equal |
> | Greater than |
>= | Greater Than or equal |
Size Type | Size Range |
---|---|
xsmall | <=450 |
small | 450-767 |
medium | 767-992 |
large | 992-1200 |
xlarge | 1200-1500 |
xxlarge | 1500-2000 |
Structural directive which loads components based on a viewport sizing condition e.g. show ONLY if viewport is greater than xlarge.
<!-- simple -->
<div *ssvViewportMatcher="'large'">
show only when large
</div>
<!-- expression based - tuple (shorthand) *recommended usage* -->
<div *ssvViewportMatcher="['>=', 'xlarge']"> (see all operands and sizes)
show when >= xlarge
</div>
<!-- expression based - object -->
<div *ssvViewportMatcher="{size: 'xlarge', operation: '<='}"> (see all operands and sizes)
show when >= xlarge
</div>
<!-- includes -->
<div *ssvViewportMatcher="['large', 'xlarge']">
show only when large, xlarge
</div>
<!-- excludes -->
<div *ssvViewportMatcher="''; exclude ['xsmall', 'small']">
hide only when xsmall, small
</div>
<!-- match/else -->
<div *ssvViewportMatcher="['>=', 'xlarge']; else otherwise">
show when >= xlarge
</div>
<ng-template #otherwise>
show when expression is falsy (< xlarge)
</ng-template>
<!-- non structure syntax -->
<ng-template ssvViewportMatcher [ssvViewportMatcherExclude]="'xsmall'">
(exclude xsmall)
</ng-template>
this.viewport.sizeType$
.pipe(
tap(x => console.log("Viewport - sizeType changed", x)), // { type: 4, name: "xlarge", widthThreshold: 1500 }
)
.subscribe();
Since in SSR there is no way to know the client viewport size, we should at least determine device type and handle provide
3 different sizes based on device type e.g. mobile
, tablet
or desktop
so the initial rendering will be closer based on device type.
The basic implemention allows to provide a device type mobile
, tablet
or desktop
and there are static sizes for those.
import { UX_VIEWPORT_SSR_DEVICE } from "@ssv/ngx.ux";
const deviceType = deviceTypeFromServer;
{ provide: UX_VIEWPORT_SSR_DEVICE, useValue: deviceType },
The default implementation can also be replaced by implementing a small class as following:
export class SuperViewportServerSizeService {
get(): ViewportSize {
// do your magic..
return size;
}
}
import { ViewportServerSizeService } from "@ssv/ngx.ux";
@NgModule( {
providers: [
{ provide: ViewportServerSizeService, useClass: SuperViewportServerSizeService }
]
}) export class AppModule {
}
In order to configure globally, you can do so as following:
import { SsvUxModule } from "@ssv/ngx.ux";
imports: [
SsvUxModule.forRoot({
viewport: { resizePollingSpeed: 66 }
}),
],
Install/setup the following:
npm install -g git gulp devtool
The following process need to be executed in order to get started.
npm install
npm run build
npm test
Handles compiling of changes.
npm start
Spawns test runner and keep watching for changes.
npm run tdd
Check out the release workflow guide in order to guide you creating a release and publishing it.
FAQs
UX essentials for building apps, utilities which enables you writing richer apps easier.
The npm package @ssv/ngx.ux receives a total of 14 weekly downloads. As such, @ssv/ngx.ux popularity was classified as not popular.
We found that @ssv/ngx.ux demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.