Skip to content

Commit

Permalink
feat(numeric-stepper): first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Badisi committed Jun 10, 2024
1 parent 19e7393 commit f7b4413
Show file tree
Hide file tree
Showing 13 changed files with 634 additions and 96 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci_test_numeric-stepper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test numeric-stepper

on:
workflow_dispatch:
push:
branches:
- '**'
tags-ignore:
- '**'
paths:
- '.github/workflows/ci_test_numeric-stepper.yml'
- 'projects/numeric-stepper/**'

concurrency:
group: ci-test-numeric-stepper-group-${{ github.ref }}
cancel-in-progress: true

jobs:
ci_test_numeric-stepper:
uses: dsi-hug/action/.github/workflows/action.yml@v1
with:
working-directory: projects/numeric-stepper
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
9 changes: 8 additions & 1 deletion projects/numeric-stepper/ng-package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/numeric-stepper",
"assets": [
{
"input": "src/",
"glob": "_numeric-stepper-theme.scss",
"output": "."
}
],
"lib": {
"entryFile": "src/index.ts"
}
}
}
77 changes: 44 additions & 33 deletions projects/numeric-stepper/package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
{
"name": "@hug/ngx-numeric-stepper",
"version": "1.0.0",
"description": "",
"homepage": "https://github.com/dsi-hug/ngx-components",
"license": "GPL-3.0-only",
"author": "HUG - Hôpitaux Universitaires Genève",
"contributors": [
"badisi (https://github.com/badisi)",
"vapkse (https://github.com/vapkse)"
],
"repository": {
"type": "git",
"url": "https://github.com/dsi-hug/ngx-components.git"
},
"keywords": [
"angular",
"material",
"material design",
"components"
],
"sideEffects": false,
"scripts": {
"lint": "eslint . --fix",
"test": "ng test numeric-stepper",
"test:ci": "ng test numeric-stepper --watch=false --browsers=ChromeHeadless",
"build": "ng build numeric-stepper -c production"
},
"peerDependencies": {
"@angular/common": "^14.3.0",
"@angular/core": "^14.3.0"
},
"dependencies": {
"tslib": "^2.6.2"
"name": "@hug/ngx-numeric-stepper",
"version": "1.0.0",
"description": "",
"homepage": "https://github.com/dsi-hug/ngx-components",
"license": "GPL-3.0-only",
"author": "HUG - Hôpitaux Universitaires Genève",
"contributors": [
"badisi (https://github.com/badisi)",
"vapkse (https://github.com/vapkse)"
],
"repository": {
"type": "git",
"url": "https://github.com/dsi-hug/ngx-components.git"
},
"keywords": [
"angular",
"material",
"material design",
"components"
],
"sideEffects": false,
"exports": {
".": {
"sass": "./_numeric-stepper-theme.scss"
}
},
"scripts": {
"lint": "eslint . --fix",
"test": "ng test numeric-stepper",
"test:ci": "ng test numeric-stepper --watch=false --browsers=ChromeHeadless",
"build": "ng build numeric-stepper -c=production",
"release": "nx release -p=@hug/ngx-numeric-stepper",
"release:dry-run": "nx release -p=@hug/ngx-numeric-stepper --dry-run"
},
"peerDependencies": {
"@angular/common": ">= 14",
"@angular/core": ">= 14",
"@angular/cdk": ">= 14",
"@angular/material": ">= 14",
"rxjs": ">= 7.0.0",
"@hug/ngx-core": "1.1.0"
},
"dependencies": {
"tslib": "^2.6.2"
}
}
55 changes: 55 additions & 0 deletions projects/numeric-stepper/src/_numeric-stepper-theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
@use "@angular/material" as mat;

@mixin theme($theme) {
$primary: map-get($theme, primary);
$warn: map-get($theme, warn);
$background: map-get($theme, background);

[numeric-stepper-form-field] {
numeric-stepper {
.arrow {
color: mat.get-color-from-palette($primary);

&[disabled] {
color: rgba(#000, 0.3);
}
}

.shadow {
background-color: mat.get-color-from-palette($background, card);
}
}

&:not(.disabled) {
&.mat-form-field-invalid {
numeric-stepper {
.arrow:not([disabled]) {
color: mat.get-color-from-palette($warn);
}

.shadow {
box-shadow: 0px 2px 4px rgba(mat.get-color-from-palette($warn), 0.3);
}
}

.mat-form-field-flex {
background-color: mat.get-color-from-palette($background);
}
}

&:hover {
.mat-form-field-flex {
background-color: transparent;
}
}
}

&.mat-form-field-appearance-fill {
numeric-stepper {
.shadow::after {
background-color: rgba(0, 0, 0, 0.04);
}
}
}
}
}
22 changes: 0 additions & 22 deletions projects/numeric-stepper/src/example/example.component.spec.ts

This file was deleted.

11 changes: 0 additions & 11 deletions projects/numeric-stepper/src/example/example.component.ts

This file was deleted.

16 changes: 0 additions & 16 deletions projects/numeric-stepper/src/example/example.service.spec.ts

This file was deleted.

6 changes: 0 additions & 6 deletions projects/numeric-stepper/src/example/example.service.ts

This file was deleted.

7 changes: 1 addition & 6 deletions projects/numeric-stepper/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
/*
* Public API Surface of lib
*/

export * from './example/example.service';
export * from './example/example.component';
export * from './numeric-stepper.component';
3 changes: 3 additions & 0 deletions projects/numeric-stepper/src/numeric-stepper.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<mat-icon *ngIf="leftUp !== null" class="arrow noselect increment" [attr.disabled]="disableUp || null" [style.left.px]="leftUp" [style.top.px]="topUp" (click)="clickArrow$.next(true)">{{ (!arrowIcons && "add") || (layout==="vertical" && "keyboard_arrow_up") || "keyboard_arrow_right" }}</mat-icon>
<mat-icon *ngIf="leftDown !== null" class="arrow noselect decrement" [attr.disabled]="disableDown || null" [style.left.px]="leftDown" [style.top.px]="topDown" (click)="clickArrow$.next(false)">{{ (!arrowIcons && "remove") || (layout==="vertical" && "keyboard_arrow_down") || "keyboard_arrow_left" }}</mat-icon>
<div *ngIf="widthShadow !== null" class="shadow" [style.left.px]="leftShadow" [style.width.px]="widthShadow" [style.top.px]="topShadow" [style.height.px]="heightShadow"></div>
Loading

0 comments on commit f7b4413

Please sign in to comment.