Skip to content

Commit

Permalink
Merge branch 'development' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
lexasq authored Oct 17, 2024
2 parents 92d6ec8 + 83c3912 commit 75b557a
Show file tree
Hide file tree
Showing 52 changed files with 548 additions and 87 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ npm install ngx-bootstrap --save

Add wanted package to NgModule imports:

```
```ts
import { TooltipModule } from 'ngx-bootstrap/tooltip';

@NgModule({
Expand All @@ -113,7 +113,7 @@ import { TooltipModule } from 'ngx-bootstrap/tooltip';

Add component to your page:

```
```html
<button type="button" class="btn btn-primary"
tooltip="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
Simple demo
Expand All @@ -126,14 +126,14 @@ This can be done with the css file directly in the index.html, or alternatively

- `Bootstrap 5`

```
```html
<!--- index.html -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
```

- `Bootstrap 4`

```
```html
<!--- index.html -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2">
```
Expand All @@ -148,7 +148,7 @@ have a customized version of bootstrap. The consequence is that the process of d
be failed, which can break the UI. In that case, we can still set the bootstrap version manually in the bootstrapping
component (i.e. `AppComponent`):

```
```ts
import { setTheme } from 'ngx-bootstrap/utils';

@Component({...})
Expand Down
4 changes: 3 additions & 1 deletion apps/ngx-bootstrap-docs/src/assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
@import "bs-datepicker";

/* HEADER */

.bs-datepicker-head {
width: 150px;
}
header {
padding: 10px 50px 10px 30px;
height: $header-height;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "18.1.0"
"version": "18.1.1"
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-bootstrap-base",
"version": "18.1.0",
"version": "18.1.1",
"license": "MIT",
"author": "Dmitriy Shekhovtsov <valorkin@gmail.com>",
"schematics": "./schematics/src/collection.json",
Expand Down
9 changes: 6 additions & 3 deletions src/accordion/accordion.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';

import { AccordionComponent } from './accordion.component';
import { AccordionPanelComponent } from './accordion-group.component';
Expand All @@ -9,7 +9,10 @@ import { AccordionPanelComponent } from './accordion-group.component';
})
export class AccordionModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return AccordionModule;
static forRoot(): ModuleWithProviders<AccordionModule> {
return {
ngModule: AccordionModule,
providers: []
};
}
}
2 changes: 1 addition & 1 deletion src/accordion/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-bootstrap/accordion",
"version": "18.1.0",
"version": "18.1.1",
"author": "Dmitriy Shekhovtsov <valorkin@gmail.com>",
"license": "MIT"
}
9 changes: 6 additions & 3 deletions src/alert/alert.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';
import { AlertComponent } from './alert.component';

@NgModule({
Expand All @@ -7,7 +7,10 @@ import { AlertComponent } from './alert.component';
})
export class AlertModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return AlertModule;
static forRoot(): ModuleWithProviders<AlertModule> {
return {
ngModule: AlertModule,
providers: []
};
}
}
2 changes: 1 addition & 1 deletion src/alert/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-bootstrap/alert",
"version": "18.1.0",
"version": "18.1.1",
"author": "Dmitriy Shekhovtsov <valorkin@gmail.com>",
"license": "MIT"
}
9 changes: 6 additions & 3 deletions src/buttons/buttons.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';

import { ButtonCheckboxDirective } from './button-checkbox.directive';
import { ButtonRadioDirective } from './button-radio.directive';
Expand All @@ -10,7 +10,10 @@ import { ButtonRadioGroupDirective } from './button-radio-group.directive';
})
export class ButtonsModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return ButtonsModule;
static forRoot(): ModuleWithProviders<ButtonsModule> {
return {
ngModule: ButtonsModule,
providers: []
};
}
}
2 changes: 1 addition & 1 deletion src/buttons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-bootstrap/buttons",
"version": "18.1.0",
"version": "18.1.1",
"author": "Dmitriy Shekhovtsov <valorkin@gmail.com>",
"license": "MIT"
}
9 changes: 6 additions & 3 deletions src/carousel/carousel.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';

import { CarouselComponent } from './carousel.component';
import { SlideComponent } from './slide.component';
Expand All @@ -9,7 +9,10 @@ import { SlideComponent } from './slide.component';
})
export class CarouselModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return CarouselModule;
static forRoot(): ModuleWithProviders<CarouselModule> {
return {
ngModule: CarouselModule,
providers: []
};
}
}
2 changes: 1 addition & 1 deletion src/carousel/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-bootstrap/carousel",
"version": "18.1.0",
"version": "18.1.1",
"author": "Dmitriy Shekhovtsov <valorkin@gmail.com>",
"license": "MIT"
}
138 changes: 138 additions & 0 deletions src/chronos/i18n/fa.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
//! moment.js locale configuration
//! locale : Persian [fa]
//! author : Meysam Bahadori: https://github.com/MeysamBahadori

import { LocaleData } from '../locale/locale.class';

const symbolMap: {[key: string]: string} = {
1: '١',
2: '٢',
3: '٣',
4: '٤',
5: '٥',
6: '٦',
7: '٧',
8: '٨',
9: '٩',
0: '٠'
};

const numberMap: {[key: string]: string} = {
'١': '1',
'٢': '2',
'٣': '3',
'٤': '4',
'٥': '5',
'٦': '6',
'٧': '7',
'٨': '8',
'٩': '9',
'٠': '0'
};

const pluralForm = function (num: number): number {
return num === 0 ? 0 : num === 1 ? 1 : num === 2 ? 2 : num % 100 >= 3 && num % 100 <= 10 ? 3 : num % 100 >= 11 ? 4 : 5;
};

var plurals : {[key: string]: [string, string, [string, string], string, string, string]} = {
s: ['کمتر از یک ثانیه', 'یک ثانیه', ['دو ثانیه', 'دو ثانیه'], '%d ثانیه', '%d ثانیه', '%d ثانیه'],
m: ['کمتر از یک دقیقه', 'یک دقیقه', ['دو دقیقه', 'دو دقیقه'], '%d دقیقه', '%d دقیقه', '%d دقیقه'],
h: ['کمتر از یک ساعت', 'یک ساعت', ['دو ساعت', 'دو ساعت'], '%d ساعت', '%d ساعت', '%d ساعت'],
d: ['کمتر از یک روز', 'یک روز', ['دو روز', 'دو روز'], '%d روز', '%d روز', '%d روز'],
M: ['کمتر از یک ماه', 'یک ماه', ['دو ماه', 'دو ماه'], '%d ماه', '%d ماه', '%d ماه'],
y: ['کمتر از یک سال', 'یک سال', ['دو سال', 'دو سال'], '%d سال', '%d سال', '%d سال']
};

const pluralize = function (u: string) {
return function (num: number, withoutSuffix: boolean): string {
const f = pluralForm(num);
let str = plurals[u][pluralForm(num)];
if (f === 2) {
str = str[withoutSuffix ? 0 : 1];
}

return (str as string).replace(/%d/i, num.toString());
};
};

const months: string[] = [
'ژانویه',
'فوریه',
'مارس',
'آوریل',
'می',
'ژوئن',
'جولای',
'آگوست',
'سپتامبر',
'اکتبر',
'نوامبر',
'دسامبر'
];

export const faLocale: LocaleData = {
abbr: 'fa',
months: months,
monthsShort: months,
weekdays: 'یکشنبه_دوشنبه_سه شنبه_چهارشنبه_پنج شنبه_جمعه_شنبه'.split('_'),
weekdaysShort: 'یکشنبه_دو‌شنبه_سه‌شنبه_چهار‌شنبه_پنج‌شنبه_جمعه_شنبه'.split('_'),
weekdaysMin: 'ی_د_س_چ_پ_ج_ش'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'D/\u200FM/\u200FYYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
meridiemParse: /ص|م/,
isPM(input) {
return 'م' === input;
},
meridiem(hour, minute, isLower) {
if (hour < 12) {
return 'ص';
} else {
return 'م';
}
},
calendar: {
sameDay: '[امروز در ساعت] LT',
nextDay: '[فردا در ساعت] LT',
nextWeek: 'dddd [در ساعت] LT',
lastDay: '[دیروز در ساعت] LT',
lastWeek: 'dddd [در ساعت] LT',
sameElse: 'L'
},
relativeTime: {
future: 'بعد %s',
past: 'پیش %s',
s: pluralize('s'),
ss: pluralize('s'),
m: pluralize('m'),
mm: pluralize('m'),
h: pluralize('h'),
hh: pluralize('h'),
d: pluralize('d'),
dd: pluralize('d'),
M: pluralize('M'),
MM: pluralize('M'),
y: pluralize('y'),
yy: pluralize('y')
},
preparse(str: string): string {
return str.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
return numberMap[match];
}).replace(/،/g, ',');
},
postformat(str: string) {
return str.replace(/\d/g, function (match) {
return symbolMap[match];
}).replace(/,/g, '،');
},
week: {
dow: 6, // Saturday is the first day of the week.
doy: 80 // The week that contains March 21th is the first week of the year.
}
};
2 changes: 1 addition & 1 deletion src/chronos/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-bootstrap/chronos",
"version": "18.1.0",
"version": "18.1.1",
"author": "Dmitriy Shekhovtsov <valorkin@gmail.com>",
"license": "MIT"
}
1 change: 1 addition & 0 deletions src/chronos/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ export { trLocale } from './i18n/tr';
export { ukLocale } from './i18n/uk';
export { viLocale } from './i18n/vi';
export { zhCnLocale } from './i18n/zh-cn';
export { faLocale } from './i18n/fa';
Loading

0 comments on commit 75b557a

Please sign in to comment.