mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(monorepo): build with esm modules (#8729)
fixes https://github.com/NativeScript/NativeScript/issues/8739
This commit is contained in:
committed by
Nathan Walker
parent
5658e638d5
commit
fc64fc3ed9
105
packages/core/css/system-classes.d.ts
vendored
105
packages/core/css/system-classes.d.ts
vendored
@@ -1,61 +1,66 @@
|
||||
/**
|
||||
* String value "ns-" used for CSS system class prefix.
|
||||
* Various framework wide css utilities
|
||||
*/
|
||||
export const CLASS_PREFIX: string;
|
||||
export namespace CSSUtils {
|
||||
/**
|
||||
* String value "ns-" used for CSS system class prefix.
|
||||
*/
|
||||
export const CLASS_PREFIX: string;
|
||||
|
||||
/**
|
||||
* Gets CSS system class for modal root view.
|
||||
*/
|
||||
export const MODAL_ROOT_VIEW_CSS_CLASS;
|
||||
/**
|
||||
* Gets CSS system class for modal root view.
|
||||
*/
|
||||
export const MODAL_ROOT_VIEW_CSS_CLASS;
|
||||
|
||||
/**
|
||||
* Gets CSS system classes for root view.
|
||||
*/
|
||||
export const ROOT_VIEW_CSS_CLASS;
|
||||
/**
|
||||
* Gets CSS system classes for root view.
|
||||
*/
|
||||
export const ROOT_VIEW_CSS_CLASS;
|
||||
|
||||
/**
|
||||
* Gets a list of the current system classes.
|
||||
* Intended for internal use only
|
||||
*/
|
||||
export function getSystemCssClasses(): string[];
|
||||
/**
|
||||
* Gets a list of the current system classes.
|
||||
* Intended for internal use only
|
||||
*/
|
||||
export function getSystemCssClasses(): string[];
|
||||
|
||||
/**
|
||||
* Pushes to the list of the current system classes.
|
||||
* Intended for internal use only
|
||||
*/
|
||||
export function pushToSystemCssClasses(value: string): number;
|
||||
/**
|
||||
* Pushes to the list of the current system classes.
|
||||
* Intended for internal use only
|
||||
*/
|
||||
export function pushToSystemCssClasses(value: string): number;
|
||||
|
||||
/**
|
||||
* Removes value from the list of current system classes
|
||||
* Intended for internal use only
|
||||
* @param value
|
||||
*/
|
||||
export function removeSystemCssClass(value: string): string;
|
||||
/**
|
||||
* Removes value from the list of current system classes
|
||||
* Intended for internal use only
|
||||
* @param value
|
||||
*/
|
||||
export function removeSystemCssClass(value: string): string;
|
||||
|
||||
/**
|
||||
* Same as MODAL_ROOT_VIEW_CSS_CLASS
|
||||
*/
|
||||
export function getModalRootViewCssClass(): string;
|
||||
/**
|
||||
* Same as MODAL_ROOT_VIEW_CSS_CLASS
|
||||
*/
|
||||
export function getModalRootViewCssClass(): string;
|
||||
|
||||
/**
|
||||
* Gets CSS system classes for root view. Same as ROOT_VIEW_CSS_CLASS + _getCssClasses
|
||||
* Intended for internal use only
|
||||
* @deprecated Use ROOT_VIEW_CSS_CLASS or getCssClasses() instead
|
||||
*/
|
||||
export function getRootViewCssClasses(): string[];
|
||||
/**
|
||||
* Gets CSS system classes for root view. Same as ROOT_VIEW_CSS_CLASS + _getCssClasses
|
||||
* Intended for internal use only
|
||||
* @deprecated Use ROOT_VIEW_CSS_CLASS or getCssClasses() instead
|
||||
*/
|
||||
export function getRootViewCssClasses(): string[];
|
||||
|
||||
/**
|
||||
* Appends new CSS class to the system classes and returns the new length of the array.
|
||||
* Intended for internal use only
|
||||
* @deprecated Use pushToCssClasses() instead
|
||||
* @param value New CSS system class.
|
||||
*/
|
||||
export function pushToRootViewCssClasses(value: string): number;
|
||||
/**
|
||||
* Appends new CSS class to the system classes and returns the new length of the array.
|
||||
* Intended for internal use only
|
||||
* @deprecated Use pushToCssClasses() instead
|
||||
* @param value New CSS system class.
|
||||
*/
|
||||
export function pushToRootViewCssClasses(value: string): number;
|
||||
|
||||
/**
|
||||
* Removes CSS class from the system classes and returns it.
|
||||
* Intended for internal use only
|
||||
* @deprecated Use removeCssClass() instead
|
||||
* @param value
|
||||
*/
|
||||
export function removeFromRootViewCssClasses(value: string): string;
|
||||
/**
|
||||
* Removes CSS class from the system classes and returns it.
|
||||
* Intended for internal use only
|
||||
* @deprecated Use removeCssClass() instead
|
||||
* @param value
|
||||
*/
|
||||
export function removeFromRootViewCssClasses(value: string): string;
|
||||
}
|
||||
|
||||
@@ -2,43 +2,45 @@ const MODAL = 'modal';
|
||||
const ROOT = 'root';
|
||||
const cssClasses = [];
|
||||
|
||||
export const CLASS_PREFIX = 'ns-';
|
||||
export const MODAL_ROOT_VIEW_CSS_CLASS = `${CLASS_PREFIX}${MODAL}`;
|
||||
export const ROOT_VIEW_CSS_CLASS = `${CLASS_PREFIX}${ROOT}`;
|
||||
export namespace CSSUtils {
|
||||
export const CLASS_PREFIX = 'ns-';
|
||||
export const MODAL_ROOT_VIEW_CSS_CLASS = `${CLASS_PREFIX}${MODAL}`;
|
||||
export const ROOT_VIEW_CSS_CLASS = `${CLASS_PREFIX}${ROOT}`;
|
||||
|
||||
export function getSystemCssClasses(): string[] {
|
||||
return cssClasses;
|
||||
}
|
||||
|
||||
export function pushToSystemCssClasses(value: string): number {
|
||||
cssClasses.push(value);
|
||||
|
||||
return cssClasses.length;
|
||||
}
|
||||
|
||||
export function removeSystemCssClass(value: string): string {
|
||||
const index = cssClasses.indexOf(value);
|
||||
let removedElement;
|
||||
|
||||
if (index > -1) {
|
||||
removedElement = cssClasses.splice(index, 1);
|
||||
export function getSystemCssClasses(): string[] {
|
||||
return cssClasses;
|
||||
}
|
||||
|
||||
return removedElement;
|
||||
}
|
||||
export function pushToSystemCssClasses(value: string): number {
|
||||
cssClasses.push(value);
|
||||
|
||||
export function getModalRootViewCssClass(): string {
|
||||
return MODAL_ROOT_VIEW_CSS_CLASS;
|
||||
}
|
||||
return cssClasses.length;
|
||||
}
|
||||
|
||||
export function getRootViewCssClasses(): string[] {
|
||||
return [ROOT_VIEW_CSS_CLASS, ...cssClasses];
|
||||
}
|
||||
export function removeSystemCssClass(value: string): string {
|
||||
const index = cssClasses.indexOf(value);
|
||||
let removedElement;
|
||||
|
||||
export function pushToRootViewCssClasses(value: string): number {
|
||||
return pushToSystemCssClasses(value) + 1; // because of ROOT_VIEW_CSS_CLASS
|
||||
}
|
||||
if (index > -1) {
|
||||
removedElement = cssClasses.splice(index, 1);
|
||||
}
|
||||
|
||||
export function removeFromRootViewCssClasses(value: string): string {
|
||||
return removeSystemCssClass(value);
|
||||
return removedElement;
|
||||
}
|
||||
|
||||
export function getModalRootViewCssClass(): string {
|
||||
return MODAL_ROOT_VIEW_CSS_CLASS;
|
||||
}
|
||||
|
||||
export function getRootViewCssClasses(): string[] {
|
||||
return [ROOT_VIEW_CSS_CLASS, ...cssClasses];
|
||||
}
|
||||
|
||||
export function pushToRootViewCssClasses(value: string): number {
|
||||
return pushToSystemCssClasses(value) + 1; // because of ROOT_VIEW_CSS_CLASS
|
||||
}
|
||||
|
||||
export function removeFromRootViewCssClasses(value: string): string {
|
||||
return removeSystemCssClass(value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user