@ganpatiinfo/gids-web-dom-reference 2.0.9 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/components/GidsBaseCard/GidsBaseCard.d.ts +8 -0
- package/dist/components/GidsBaseCard/GidsBaseCard.d.ts.map +1 -0
- package/dist/components/GidsBaseCard/GidsBaseCard.js +12 -0
- package/dist/components/GidsBaseCard/GidsBaseCard.js.map +1 -0
- package/dist/components/GidsBox/GidsBox.d.ts +6 -0
- package/dist/components/GidsBox/GidsBox.d.ts.map +1 -0
- package/dist/components/GidsBox/GidsBox.js +14 -0
- package/dist/components/GidsBox/GidsBox.js.map +1 -0
- package/dist/components/GidsBreadcrumb/GidsBreadcrumb.d.ts +8 -0
- package/dist/components/GidsBreadcrumb/GidsBreadcrumb.d.ts.map +1 -0
- package/dist/components/GidsBreadcrumb/GidsBreadcrumb.js +15 -0
- package/dist/components/GidsBreadcrumb/GidsBreadcrumb.js.map +1 -0
- package/dist/components/GidsBreadcrumbItem/GidsBreadcrumbItem.d.ts +10 -0
- package/dist/components/GidsBreadcrumbItem/GidsBreadcrumbItem.d.ts.map +1 -0
- package/dist/components/GidsBreadcrumbItem/GidsBreadcrumbItem.js +45 -0
- package/dist/components/GidsBreadcrumbItem/GidsBreadcrumbItem.js.map +1 -0
- package/dist/components/GidsButton/GidsButton.js +1 -1
- package/dist/components/GidsButton/GidsButton.js.map +1 -1
- package/dist/components/GidsCard/GidsCard.d.ts +8 -0
- package/dist/components/GidsCard/GidsCard.d.ts.map +1 -0
- package/dist/components/GidsCard/GidsCard.js +81 -0
- package/dist/components/GidsCard/GidsCard.js.map +1 -0
- package/dist/components/GidsContainer/GidsContainer.d.ts +7 -0
- package/dist/components/GidsContainer/GidsContainer.d.ts.map +1 -0
- package/dist/components/GidsContainer/GidsContainer.js +12 -0
- package/dist/components/GidsContainer/GidsContainer.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/GidsBaseCard/GidsBaseCard.ts +35 -0
- package/src/components/GidsBox/GidsBox.ts +34 -0
- package/src/components/GidsBreadcrumb/GidsBreadcrumb.ts +31 -0
- package/src/components/GidsBreadcrumbItem/GidsBreadcrumbItem.ts +94 -0
- package/src/components/GidsButton/GidsButton.ts +4 -4
- package/src/components/GidsCard/GidsCard.ts +122 -0
- package/src/components/GidsContainer/GidsContainer.ts +32 -0
- package/src/index.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @ganpatiinfo/gids-web-dom-reference
|
|
2
2
|
|
|
3
|
+
## 2.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 95cebb9: Added `basecard` and `card` components
|
|
8
|
+
- Updated dependencies [95cebb9]
|
|
9
|
+
- Updated dependencies [95cebb9]
|
|
10
|
+
- @ganpatiinfo/gids-core-shared@2.1.1
|
|
11
|
+
- @ganpatiinfo/gids-web-shared@2.1.1
|
|
12
|
+
- @ganpatiinfo/gids-web-theme-interface@2.0.7
|
|
13
|
+
|
|
14
|
+
## 2.1.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- Added layout components
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
- @ganpatiinfo/gids-core-shared@2.1.0
|
|
25
|
+
- @ganpatiinfo/gids-web-shared@2.1.0
|
|
26
|
+
|
|
3
27
|
## 2.0.9
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type GidsBaseCardCommonProps } from '@ganpatiinfo/gids-core-shared';
|
|
2
|
+
import { type ClassValue } from '@ganpatiinfo/gids-web-shared';
|
|
3
|
+
import { type DomNodeOrString } from '../../utils/domUtils.js';
|
|
4
|
+
export interface GidsBaseCardDomProps extends GidsBaseCardCommonProps<DomNodeOrString> {
|
|
5
|
+
extraClasses?: ClassValue;
|
|
6
|
+
}
|
|
7
|
+
export declare const GidsBaseCardDom: ({ children, cardType, appearance, extraClasses, }: GidsBaseCardDomProps) => HTMLDivElement;
|
|
8
|
+
//# sourceMappingURL=GidsBaseCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsBaseCard.d.ts","sourceRoot":"","sources":["../../../src/components/GidsBaseCard/GidsBaseCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EACN,KAAK,UAAU,EAEf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEN,KAAK,eAAe,EACpB,MAAM,yBAAyB,CAAC;AAIjC,MAAM,WAAW,oBAChB,SAAQ,uBAAuB,CAAC,eAAe,CAAC;IAChD,YAAY,CAAC,EAAE,UAAU,CAAC;CAC1B;AAED,eAAO,MAAM,eAAe,GAAI,mDAK7B,oBAAoB,KAAG,cAYzB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GidsBaseCardWebUtils, } from '@ganpatiinfo/gids-web-shared';
|
|
2
|
+
import { appendAsChildren, } from '../../utils/domUtils.js';
|
|
3
|
+
const { getGidsBaseCardClassNames } = GidsBaseCardWebUtils;
|
|
4
|
+
export const GidsBaseCardDom = ({ children, cardType = 'empty', appearance = 'default', extraClasses, }) => {
|
|
5
|
+
const baseCard = document.createElement('div');
|
|
6
|
+
baseCard.className = getGidsBaseCardClassNames({ cardType, appearance }, extraClasses);
|
|
7
|
+
if (children) {
|
|
8
|
+
appendAsChildren(baseCard, children);
|
|
9
|
+
}
|
|
10
|
+
return baseCard;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=GidsBaseCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsBaseCard.js","sourceRoot":"","sources":["../../../src/components/GidsBaseCard/GidsBaseCard.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,oBAAoB,GACpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,gBAAgB,GAEhB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,EAAE,yBAAyB,EAAE,GAAG,oBAAoB,CAAC;AAO3D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC/B,QAAQ,EACR,QAAQ,GAAG,OAAO,EAClB,UAAU,GAAG,SAAS,EACtB,YAAY,GACU,EAAkB,EAAE;IAC1C,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC/C,QAAQ,CAAC,SAAS,GAAG,yBAAyB,CAC7C,EAAE,QAAQ,EAAE,UAAU,EAAE,EACxB,YAAY,CACZ,CAAC;IAEF,IAAI,QAAQ,EAAE,CAAC;QACd,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ClassValue, type GidsBoxWebProps, PermittedGidsBoxElements } from '@ganpatiinfo/gids-web-shared';
|
|
2
|
+
export type GidsBoxDomProps<ComponentType extends PermittedGidsBoxElements> = GidsBoxWebProps<Element, ComponentType> & {
|
|
3
|
+
className?: ClassValue;
|
|
4
|
+
};
|
|
5
|
+
export declare const GidsBoxDom: <ComponentType extends PermittedGidsBoxElements = "div">({ children, component, className, }: GidsBoxDomProps<ComponentType>) => HTMLElement;
|
|
6
|
+
//# sourceMappingURL=GidsBox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsBox.d.ts","sourceRoot":"","sources":["../../../src/components/GidsBox/GidsBox.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,UAAU,EACf,KAAK,eAAe,EAEpB,wBAAwB,EACxB,MAAM,8BAA8B,CAAC;AAKtC,MAAM,MAAM,eAAe,CAAC,aAAa,SAAS,wBAAwB,IACzE,eAAe,CAAC,OAAO,EAAE,aAAa,CAAC,GAAG;IACzC,SAAS,CAAC,EAAE,UAAU,CAAC;CACvB,CAAC;AAEH,eAAO,MAAM,UAAU,GACtB,aAAa,SAAS,wBAAwB,GAAG,KAAK,EACrD,qCAIC,eAAe,CAAC,aAAa,CAAC,KAAG,WAYnC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GidsBoxWebUtils, } from '@ganpatiinfo/gids-web-shared';
|
|
2
|
+
import { appendAsChildren } from '../../utils/domUtils.js';
|
|
3
|
+
const { getGidsBoxClassNames } = GidsBoxWebUtils;
|
|
4
|
+
export const GidsBoxDom = ({ children, component, className, }) => {
|
|
5
|
+
const box = document.createElement(
|
|
6
|
+
//@ts-expect-error: ex
|
|
7
|
+
component && component !== '' ? component : 'div');
|
|
8
|
+
box.className = getGidsBoxClassNames(className);
|
|
9
|
+
if (children) {
|
|
10
|
+
appendAsChildren(box, children);
|
|
11
|
+
}
|
|
12
|
+
return box;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=GidsBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsBox.js","sourceRoot":"","sources":["../../../src/components/GidsBox/GidsBox.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,eAAe,GAEf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,EAAE,oBAAoB,EAAE,GAAG,eAAe,CAAC;AAOjD,MAAM,CAAC,MAAM,UAAU,GAAG,CAExB,EACD,QAAQ,EACR,SAAS,EACT,SAAS,GACuB,EAAe,EAAE;IACjD,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa;IACjC,sBAAsB;IACtB,SAAS,IAAI,SAAS,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAClC,CAAC;IACjB,GAAG,CAAC,SAAS,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAEhD,IAAI,QAAQ,EAAE,CAAC;QACd,gBAAgB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,GAAG,CAAC;AACZ,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ClassValue } from '@ganpatiinfo/gids-web-shared';
|
|
2
|
+
import { type DomChildren } from '../../utils/domUtils.js';
|
|
3
|
+
import { type GidsBreadcrumbCommonProps } from '@ganpatiinfo/gids-core-shared';
|
|
4
|
+
export interface GidsBreadcrumbDomProps extends GidsBreadcrumbCommonProps<DomChildren> {
|
|
5
|
+
extraClasses?: ClassValue;
|
|
6
|
+
}
|
|
7
|
+
export declare const GidsBreadcrumbDom: ({ children, extraClasses, }: GidsBreadcrumbDomProps) => HTMLElement;
|
|
8
|
+
//# sourceMappingURL=GidsBreadcrumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsBreadcrumb.d.ts","sourceRoot":"","sources":["../../../src/components/GidsBreadcrumb/GidsBreadcrumb.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,UAAU,EAEf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAI/E,MAAM,WAAW,sBAChB,SAAQ,yBAAyB,CAAC,WAAW,CAAC;IAC9C,YAAY,CAAC,EAAE,UAAU,CAAC;CAC1B;AAED,eAAO,MAAM,iBAAiB,GAAI,6BAG/B,sBAAsB,KAAG,WAa3B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GidsBreadcrumbWebUtils, } from '@ganpatiinfo/gids-web-shared';
|
|
2
|
+
import { appendAsChildren } from '../../utils/domUtils.js';
|
|
3
|
+
const { getGidsBreadcrumbClassNames } = GidsBreadcrumbWebUtils;
|
|
4
|
+
export const GidsBreadcrumbDom = ({ children, extraClasses, }) => {
|
|
5
|
+
const breadcrumb = document.createElement('nav');
|
|
6
|
+
breadcrumb.className = getGidsBreadcrumbClassNames(extraClasses);
|
|
7
|
+
breadcrumb.setAttribute('aria-label', 'Breadcrumb');
|
|
8
|
+
if (children) {
|
|
9
|
+
const orderedList = document.createElement('ol');
|
|
10
|
+
appendAsChildren(orderedList, children);
|
|
11
|
+
breadcrumb.appendChild(orderedList);
|
|
12
|
+
}
|
|
13
|
+
return breadcrumb;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=GidsBreadcrumb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsBreadcrumb.js","sourceRoot":"","sources":["../../../src/components/GidsBreadcrumb/GidsBreadcrumb.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,sBAAsB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAoB,MAAM,yBAAyB,CAAC;AAG7E,MAAM,EAAE,2BAA2B,EAAE,GAAG,sBAAsB,CAAC;AAO/D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EACjC,QAAQ,EACR,YAAY,GACY,EAAe,EAAE;IACzC,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACjD,UAAU,CAAC,SAAS,GAAG,2BAA2B,CAAC,YAAY,CAAC,CAAC;IAEjE,UAAU,CAAC,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IAEpD,IAAI,QAAQ,EAAE,CAAC;QACd,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QACjD,gBAAgB,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;QACxC,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type GidsBreadcrumbItemCommonProps } from '@ganpatiinfo/gids-core-shared';
|
|
2
|
+
import { type ClassValue } from '@ganpatiinfo/gids-web-shared';
|
|
3
|
+
import { type DomNodeOrString } from '../../utils/domUtils.js';
|
|
4
|
+
export interface GidsBreadcrumbItemDomProps extends GidsBreadcrumbItemCommonProps<DomNodeOrString, DomNodeOrString, DomNodeOrString> {
|
|
5
|
+
className?: ClassValue;
|
|
6
|
+
href?: DomNodeOrString;
|
|
7
|
+
onClick?: (this: HTMLAnchorElement, event: Event) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const GidsBreadcrumbItemDom: ({ children, selected, leadingIcon, href, onClick, className, separator, isSeparatorVisible, renderingSystem, currentIndex, totalLength, }: GidsBreadcrumbItemDomProps) => HTMLLIElement;
|
|
10
|
+
//# sourceMappingURL=GidsBreadcrumbItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsBreadcrumbItem.d.ts","sourceRoot":"","sources":["../../../src/components/GidsBreadcrumbItem/GidsBreadcrumbItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO,EACN,KAAK,UAAU,EAEf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEN,KAAK,eAAe,EACpB,MAAM,yBAAyB,CAAC;AAMjC,MAAM,WAAW,0BAChB,SAAQ,6BAA6B,CACpC,eAAe,EACf,eAAe,EACf,eAAe,CACf;IACD,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAC1D;AAED,eAAO,MAAM,qBAAqB,GAAI,2IAYnC,0BAA0B,KAAG,aAwD/B,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { GidsBreadcrumbItemWebUtils, } from '@ganpatiinfo/gids-web-shared';
|
|
2
|
+
import { appendAsChildren, } from '../../utils/domUtils.js';
|
|
3
|
+
import { GidsIconDom } from '../GidsIcon/GidsIcon.js';
|
|
4
|
+
const { getGidsBreadcrumbItemClassNames } = GidsBreadcrumbItemWebUtils;
|
|
5
|
+
export const GidsBreadcrumbItemDom = ({ children, selected, leadingIcon, href, onClick, className, separator, isSeparatorVisible = true, renderingSystem = 'non-array', currentIndex = 0, totalLength = 0, }) => {
|
|
6
|
+
const breadcrumbItem = document.createElement('li');
|
|
7
|
+
breadcrumbItem.className = getGidsBreadcrumbItemClassNames({ selected }, className);
|
|
8
|
+
const breadcrumbAnchorItem = document.createElement('a');
|
|
9
|
+
breadcrumbAnchorItem.className = `gids-breadcrumb-item__anchor-label`;
|
|
10
|
+
if (href) {
|
|
11
|
+
breadcrumbAnchorItem.setAttribute('href', href);
|
|
12
|
+
}
|
|
13
|
+
if (leadingIcon && leadingIcon !== '' && leadingIcon !== '(none)') {
|
|
14
|
+
breadcrumbAnchorItem.appendChild(GidsIconDom({
|
|
15
|
+
name: leadingIcon,
|
|
16
|
+
appearance: 'regular',
|
|
17
|
+
alt: '',
|
|
18
|
+
size: 'md',
|
|
19
|
+
className: 'gids-breadcrumb-item__leading-icon',
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
if (children) {
|
|
23
|
+
appendAsChildren(breadcrumbAnchorItem, children);
|
|
24
|
+
}
|
|
25
|
+
breadcrumbItem.appendChild(breadcrumbAnchorItem);
|
|
26
|
+
if (isSeparatorVisible) {
|
|
27
|
+
if ((renderingSystem === 'array' && currentIndex < totalLength - 1) ||
|
|
28
|
+
renderingSystem === 'non-array') {
|
|
29
|
+
breadcrumbItem.appendChild(GidsIconDom({
|
|
30
|
+
name: separator && separator !== '' && separator !== '(none)'
|
|
31
|
+
? separator
|
|
32
|
+
: 'chevron-right',
|
|
33
|
+
appearance: 'filled',
|
|
34
|
+
alt: '',
|
|
35
|
+
size: 'md',
|
|
36
|
+
className: 'gids-breadcrumb-item__separator-icon',
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (onClick) {
|
|
41
|
+
breadcrumbItem.addEventListener('click', onClick);
|
|
42
|
+
}
|
|
43
|
+
return breadcrumbItem;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=GidsBreadcrumbItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsBreadcrumbItem.js","sourceRoot":"","sources":["../../../src/components/GidsBreadcrumbItem/GidsBreadcrumbItem.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,0BAA0B,GAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,gBAAgB,GAEhB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,MAAM,EAAE,+BAA+B,EAAE,GAAG,0BAA0B,CAAC;AAavE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EACrC,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,OAAO,EACP,SAAS,EACT,SAAS,EACT,kBAAkB,GAAG,IAAI,EACzB,eAAe,GAAG,WAAW,EAC7B,YAAY,GAAG,CAAC,EAChB,WAAW,GAAG,CAAC,GACa,EAAiB,EAAE;IAC/C,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACpD,cAAc,CAAC,SAAS,GAAG,+BAA+B,CACzD,EAAE,QAAQ,EAAE,EACZ,SAAS,CACT,CAAC;IACF,MAAM,oBAAoB,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACzD,oBAAoB,CAAC,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|
28
28
|
if (loading) {
|
|
29
29
|
button.appendChild(GidsSpinnerControlDom({
|
|
30
30
|
size: size === 'lg' || size === undefined ? 'md' : size,
|
|
31
|
-
indeterminate: true
|
|
31
|
+
indeterminate: true,
|
|
32
32
|
}));
|
|
33
33
|
}
|
|
34
34
|
if (onClick && !loading) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GidsButton.js","sourceRoot":"","sources":["../../../src/components/GidsButton/GidsButton.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,kBAAkB,EAClB,QAAQ,GAGR,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAoB,MAAM,yBAAyB,CAAC;AAE7E,MAAM,EAAE,uBAAuB,EAAE,GAAG,kBAAkB,CAAC;AAUvD,MAAM,CAAC,MAAM,aAAa,GAAG,CAE3B,EACD,EAAE,EACF,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,OAAO,EACP,KAAK,EACL,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,OAAO,GAC4B,EAEf,EAAE;IACtB,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CACpC,EAAE,IAAI,QAAQ,CAC4D,CAAC;IAE5E,MAAM,CAAC,SAAS,GAAG,uBAAuB,CACzC,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,EACjD,CAAC,QAAQ,IAAI,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAC7D,CAAC;IAEF,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;QAChB,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,IAAI,QAAQ,CAAC,CAAC;QAE9C,IAAI,QAAQ,EAAE,CAAC;YACd,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,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,CAAC;YACrB,IAAI,EAAE,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;YACvD,aAAa,EAAE,IAAI;SACnB,CAAC,CACF,CAAC;IACH,CAAC;IAED,IAAI,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;QACzB,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type GidsCardCommonProps } from '@ganpatiinfo/gids-core-shared';
|
|
2
|
+
import { type ClassValue } from '@ganpatiinfo/gids-web-shared';
|
|
3
|
+
import { type DomChildren } from '../../utils/domUtils.js';
|
|
4
|
+
export interface GidsCardDomProps extends GidsCardCommonProps<DomChildren, string, string> {
|
|
5
|
+
extraClasses?: ClassValue;
|
|
6
|
+
}
|
|
7
|
+
export declare const GidsCardDom: ({ cardHeaderType, cardHeaderSrc, children, heading, subHeading, description, baseCardAppearance, headerVisible, extraClasses, }: GidsCardDomProps) => HTMLDivElement;
|
|
8
|
+
//# sourceMappingURL=GidsCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsCard.d.ts","sourceRoot":"","sources":["../../../src/components/GidsCard/GidsCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,mBAAmB,EACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,KAAK,UAAU,EAEf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAO7E,MAAM,WAAW,gBAChB,SAAQ,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC;IACxD,YAAY,CAAC,EAAE,UAAU,CAAC;CAC1B;AAED,eAAO,MAAM,WAAW,GAAI,iIAUzB,gBAAgB,KAAG,cA2FrB,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { GidsCardCommonUtils, } from '@ganpatiinfo/gids-core-shared';
|
|
2
|
+
import { GidsCardWebUtils, } from '@ganpatiinfo/gids-web-shared';
|
|
3
|
+
import { appendAsChildren } from '../../utils/domUtils.js';
|
|
4
|
+
import { GidsAvatarDom } from '../GidsAvatar/GidsAvatar.js';
|
|
5
|
+
import { GidsBaseCardDom } from '../GidsBaseCard/GidsBaseCard.js';
|
|
6
|
+
const { getGidsCardClassNames } = GidsCardWebUtils;
|
|
7
|
+
const { isContentContainerVisible, isSimpleCard } = GidsCardCommonUtils;
|
|
8
|
+
export const GidsCardDom = ({ cardHeaderType = 'image', cardHeaderSrc, children, heading, subHeading, description, baseCardAppearance = 'default', headerVisible, extraClasses, }) => {
|
|
9
|
+
const card = document.createElement('div');
|
|
10
|
+
card.className = getGidsCardClassNames({ isSimpleCard: isSimpleCard({ cardHeaderSrc, headerVisible }) }, extraClasses);
|
|
11
|
+
const cardInnerContainer = document.createElement('div');
|
|
12
|
+
cardInnerContainer.className = isSimpleCard({ cardHeaderSrc, headerVisible })
|
|
13
|
+
? 'gids-card__simple-card-inner-container'
|
|
14
|
+
: 'gids-card__advanced-card-inner-container';
|
|
15
|
+
if (cardHeaderSrc && cardHeaderSrc !== '' && headerVisible) {
|
|
16
|
+
const headerContainer = document.createElement('div');
|
|
17
|
+
headerContainer.className =
|
|
18
|
+
cardHeaderType === 'avatar'
|
|
19
|
+
? 'gids-card__header-container-avatar'
|
|
20
|
+
: 'gids-card__header-container-image';
|
|
21
|
+
if (cardHeaderType === 'avatar') {
|
|
22
|
+
headerContainer.appendChild(GidsAvatarDom({
|
|
23
|
+
appearance: 'image',
|
|
24
|
+
size: 'xl',
|
|
25
|
+
imageSrc: cardHeaderSrc,
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
const image = document.createElement('img');
|
|
30
|
+
image.src = cardHeaderSrc;
|
|
31
|
+
image.setAttribute('alt', 'alt_text');
|
|
32
|
+
image.className = 'gids-card__image';
|
|
33
|
+
headerContainer.appendChild(image);
|
|
34
|
+
}
|
|
35
|
+
cardInnerContainer.appendChild(headerContainer);
|
|
36
|
+
}
|
|
37
|
+
const contentContainer = document.createElement('div');
|
|
38
|
+
contentContainer.className = 'gids-card__content-container';
|
|
39
|
+
if (heading && heading !== '') {
|
|
40
|
+
const headingElement = document.createElement('div');
|
|
41
|
+
headingElement.className = 'gids-card__heading';
|
|
42
|
+
appendAsChildren(headingElement, heading);
|
|
43
|
+
contentContainer.appendChild(headingElement);
|
|
44
|
+
}
|
|
45
|
+
if (subHeading && subHeading !== '') {
|
|
46
|
+
const subHeadingElement = document.createElement('div');
|
|
47
|
+
subHeadingElement.className = 'gids-card__subheading';
|
|
48
|
+
appendAsChildren(subHeadingElement, subHeading);
|
|
49
|
+
contentContainer.appendChild(subHeadingElement);
|
|
50
|
+
}
|
|
51
|
+
if (description && description !== '') {
|
|
52
|
+
const descriptionElement = document.createElement('p');
|
|
53
|
+
descriptionElement.className = 'gids-card__description';
|
|
54
|
+
appendAsChildren(descriptionElement, description);
|
|
55
|
+
contentContainer.appendChild(descriptionElement);
|
|
56
|
+
}
|
|
57
|
+
if (children) {
|
|
58
|
+
const childrenElement = document.createElement('div');
|
|
59
|
+
childrenElement.className = 'gids-card__children';
|
|
60
|
+
appendAsChildren(childrenElement, children);
|
|
61
|
+
contentContainer.appendChild(childrenElement);
|
|
62
|
+
}
|
|
63
|
+
if (isContentContainerVisible({
|
|
64
|
+
heading,
|
|
65
|
+
subHeading,
|
|
66
|
+
description,
|
|
67
|
+
children,
|
|
68
|
+
})) {
|
|
69
|
+
cardInnerContainer.appendChild(contentContainer);
|
|
70
|
+
}
|
|
71
|
+
card.appendChild(GidsBaseCardDom({
|
|
72
|
+
children: cardInnerContainer,
|
|
73
|
+
cardType: 'content',
|
|
74
|
+
appearance: baseCardAppearance,
|
|
75
|
+
extraClasses: isSimpleCard({ cardHeaderSrc, headerVisible })
|
|
76
|
+
? 'gids-card__base-card-simple'
|
|
77
|
+
: 'gids-card__base-card-advanced',
|
|
78
|
+
}));
|
|
79
|
+
return card;
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=GidsCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsCard.js","sourceRoot":"","sources":["../../../src/components/GidsCard/GidsCard.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,mBAAmB,GAEnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEN,gBAAgB,GAChB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAoB,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,MAAM,EAAE,qBAAqB,EAAE,GAAG,gBAAgB,CAAC;AACnD,MAAM,EAAE,yBAAyB,EAAE,YAAY,EAAE,GAAG,mBAAmB,CAAC;AAOxE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC3B,cAAc,GAAG,OAAO,EACxB,aAAa,EACb,QAAQ,EACR,OAAO,EACP,UAAU,EACV,WAAW,EACX,kBAAkB,GAAG,SAAS,EAC9B,aAAa,EACb,YAAY,GACM,EAAkB,EAAE;IACtC,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,CAAC,SAAS,GAAG,qBAAqB,CACrC,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC,EAAE,EAChE,YAAY,CACZ,CAAC;IAEF,MAAM,kBAAkB,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACzD,kBAAkB,CAAC,SAAS,GAAG,YAAY,CAAC,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC;QAC5E,C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,+BAA+B;KAClC,CAAC,CACF,CAAC;IAEF,OAAO,IAAI,CAAC;AACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ClassValue, type GidsContainerWebProps } from '@ganpatiinfo/gids-web-shared';
|
|
2
|
+
import { type DomChildren } from '../../utils/domUtils.js';
|
|
3
|
+
export interface GidsContainerDomProps extends GidsContainerWebProps<DomChildren> {
|
|
4
|
+
className?: ClassValue;
|
|
5
|
+
}
|
|
6
|
+
export declare const GidsContainerDom: ({ children, fixed, maxWidth, className, }: GidsContainerDomProps) => HTMLDivElement;
|
|
7
|
+
//# sourceMappingURL=GidsContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsContainer.d.ts","sourceRoot":"","sources":["../../../src/components/GidsContainer/GidsContainer.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,UAAU,EACf,KAAK,qBAAqB,EAE1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAI7E,MAAM,WAAW,qBAChB,SAAQ,qBAAqB,CAAC,WAAW,CAAC;IAC1C,SAAS,CAAC,EAAE,UAAU,CAAC;CACvB;AAED,eAAO,MAAM,gBAAgB,GAAI,2CAK9B,qBAAqB,KAAG,cAY1B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GidsContainerWebUtils, } from '@ganpatiinfo/gids-web-shared';
|
|
2
|
+
import { appendAsChildren } from '../../utils/domUtils.js';
|
|
3
|
+
const { getGidsContainerClassNames } = GidsContainerWebUtils;
|
|
4
|
+
export const GidsContainerDom = ({ children, fixed = false, maxWidth = 'lg', className, }) => {
|
|
5
|
+
const container = document.createElement('div');
|
|
6
|
+
container.className = getGidsContainerClassNames({ fixed, maxWidth }, className);
|
|
7
|
+
if (children) {
|
|
8
|
+
appendAsChildren(container, children);
|
|
9
|
+
}
|
|
10
|
+
return container;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=GidsContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsContainer.js","sourceRoot":"","sources":["../../../src/components/GidsContainer/GidsContainer.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,qBAAqB,GACrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAoB,MAAM,yBAAyB,CAAC;AAE7E,MAAM,EAAE,0BAA0B,EAAE,GAAG,qBAAqB,CAAC;AAO7D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAChC,QAAQ,EACR,KAAK,GAAG,KAAK,EACb,QAAQ,GAAG,IAAI,EACf,SAAS,GACc,EAAkB,EAAE;IAC3C,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAChD,SAAS,CAAC,SAAS,GAAG,0BAA0B,CAC/C,EAAE,KAAK,EAAE,QAAQ,EAAE,EACnB,SAAS,CACT,CAAC;IAEF,IAAI,QAAQ,EAAE,CAAC;QACd,gBAAgB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,12 @@ export * from './components/GidsButtonGroup/GidsButtonGroup.js';
|
|
|
30
30
|
export * from './components/GidsButtonDock/GidsButtonDock.js';
|
|
31
31
|
export * from './components/GidsSectionNotice/GidsSectionNotice.js';
|
|
32
32
|
export * from './components/GidsCompoundButton/GidsCompoundButton.js';
|
|
33
|
+
export * from './components/GidsBox/GidsBox.js';
|
|
34
|
+
export * from './components/GidsContainer/GidsContainer.js';
|
|
35
|
+
export * from './components/GidsBreadcrumbItem/GidsBreadcrumbItem.js';
|
|
36
|
+
export * from './components/GidsBreadcrumb/GidsBreadcrumb.js';
|
|
37
|
+
export * from './components/GidsBaseCard/GidsBaseCard.js';
|
|
38
|
+
export * from './components/GidsCard/GidsCard.js';
|
|
33
39
|
/**
|
|
34
40
|
* Utilities
|
|
35
41
|
*/
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mCAAmC,CAAC;AAClD,cAAc,uDAAuD,CAAC;AACtE,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,wDAAwD,CAAC;AACvE,cAAc,yCAAyC,CAAC;AACxD,cAAc,mDAAmD,CAAC;AAClE,cAAc,0DAA0D,CAAC;AACzE,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qDAAqD,CAAC;AACpE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iDAAiD,CAAC;AAChE,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qEAAqE,CAAC;AACpF,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qDAAqD,CAAC;AACpE,cAAc,uDAAuD,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mCAAmC,CAAC;AAClD,cAAc,uDAAuD,CAAC;AACtE,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,wDAAwD,CAAC;AACvE,cAAc,yCAAyC,CAAC;AACxD,cAAc,mDAAmD,CAAC;AAClE,cAAc,0DAA0D,CAAC;AACzE,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qDAAqD,CAAC;AACpE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iDAAiD,CAAC;AAChE,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qEAAqE,CAAC;AACpF,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qDAAqD,CAAC;AACpE,cAAc,uDAAuD,CAAC;AACtE,cAAc,iCAAiC,CAAC;AAChD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,uDAAuD,CAAC;AACtE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mCAAmC,CAAC;AAElD;;GAEG;AACH,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -30,6 +30,12 @@ export * from './components/GidsButtonGroup/GidsButtonGroup.js';
|
|
|
30
30
|
export * from './components/GidsButtonDock/GidsButtonDock.js';
|
|
31
31
|
export * from './components/GidsSectionNotice/GidsSectionNotice.js';
|
|
32
32
|
export * from './components/GidsCompoundButton/GidsCompoundButton.js';
|
|
33
|
+
export * from './components/GidsBox/GidsBox.js';
|
|
34
|
+
export * from './components/GidsContainer/GidsContainer.js';
|
|
35
|
+
export * from './components/GidsBreadcrumbItem/GidsBreadcrumbItem.js';
|
|
36
|
+
export * from './components/GidsBreadcrumb/GidsBreadcrumb.js';
|
|
37
|
+
export * from './components/GidsBaseCard/GidsBaseCard.js';
|
|
38
|
+
export * from './components/GidsCard/GidsCard.js';
|
|
33
39
|
/**
|
|
34
40
|
* Utilities
|
|
35
41
|
*/
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mCAAmC,CAAC;AAClD,cAAc,uDAAuD,CAAC;AACtE,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,wDAAwD,CAAC;AACvE,cAAc,yCAAyC,CAAC;AACxD,cAAc,mDAAmD,CAAC;AAClE,cAAc,0DAA0D,CAAC;AACzE,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qDAAqD,CAAC;AACpE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iDAAiD,CAAC;AAChE,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qEAAqE,CAAC;AACpF,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qDAAqD,CAAC;AACpE,cAAc,uDAAuD,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mCAAmC,CAAC;AAClD,cAAc,uDAAuD,CAAC;AACtE,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,wDAAwD,CAAC;AACvE,cAAc,yCAAyC,CAAC;AACxD,cAAc,mDAAmD,CAAC;AAClE,cAAc,0DAA0D,CAAC;AACzE,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qDAAqD,CAAC;AACpE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iDAAiD,CAAC;AAChE,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qEAAqE,CAAC;AACpF,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qDAAqD,CAAC;AACpE,cAAc,uDAAuD,CAAC;AACtE,cAAc,iCAAiC,CAAC;AAChD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,uDAAuD,CAAC;AACtE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mCAAmC,CAAC;AAElD;;GAEG;AACH,cAAc,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ganpatiinfo/gids-web-dom-reference",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "DOM for components reference implementations",
|
|
6
6
|
"homepage": "https://ganpatiinfosystem.vercel.app/",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"directory": "packages/private/web-dom-reference"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@ganpatiinfo/gids-core-shared": "2.
|
|
28
|
-
"@ganpatiinfo/gids-web-shared": "2.
|
|
27
|
+
"@ganpatiinfo/gids-core-shared": "2.1.1",
|
|
28
|
+
"@ganpatiinfo/gids-web-shared": "2.1.1"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@ganpatiinfo/gids-web-theme-interface": "2.0.7",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type GidsBaseCardCommonProps } from '@ganpatiinfo/gids-core-shared';
|
|
2
|
+
import {
|
|
3
|
+
type ClassValue,
|
|
4
|
+
GidsBaseCardWebUtils,
|
|
5
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
6
|
+
import {
|
|
7
|
+
appendAsChildren,
|
|
8
|
+
type DomNodeOrString,
|
|
9
|
+
} from '../../utils/domUtils.js';
|
|
10
|
+
|
|
11
|
+
const { getGidsBaseCardClassNames } = GidsBaseCardWebUtils;
|
|
12
|
+
|
|
13
|
+
export interface GidsBaseCardDomProps
|
|
14
|
+
extends GidsBaseCardCommonProps<DomNodeOrString> {
|
|
15
|
+
extraClasses?: ClassValue;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const GidsBaseCardDom = ({
|
|
19
|
+
children,
|
|
20
|
+
cardType = 'empty',
|
|
21
|
+
appearance = 'default',
|
|
22
|
+
extraClasses,
|
|
23
|
+
}: GidsBaseCardDomProps): HTMLDivElement => {
|
|
24
|
+
const baseCard = document.createElement('div');
|
|
25
|
+
baseCard.className = getGidsBaseCardClassNames(
|
|
26
|
+
{ cardType, appearance },
|
|
27
|
+
extraClasses,
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
if (children) {
|
|
31
|
+
appendAsChildren(baseCard, children);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return baseCard;
|
|
35
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ClassValue,
|
|
3
|
+
type GidsBoxWebProps,
|
|
4
|
+
GidsBoxWebUtils,
|
|
5
|
+
PermittedGidsBoxElements,
|
|
6
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
7
|
+
import { appendAsChildren } from '../../utils/domUtils.js';
|
|
8
|
+
|
|
9
|
+
const { getGidsBoxClassNames } = GidsBoxWebUtils;
|
|
10
|
+
|
|
11
|
+
export type GidsBoxDomProps<ComponentType extends PermittedGidsBoxElements> =
|
|
12
|
+
GidsBoxWebProps<Element, ComponentType> & {
|
|
13
|
+
className?: ClassValue;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const GidsBoxDom = <
|
|
17
|
+
ComponentType extends PermittedGidsBoxElements = 'div',
|
|
18
|
+
>({
|
|
19
|
+
children,
|
|
20
|
+
component,
|
|
21
|
+
className,
|
|
22
|
+
}: GidsBoxDomProps<ComponentType>): HTMLElement => {
|
|
23
|
+
const box = document.createElement(
|
|
24
|
+
//@ts-expect-error: ex
|
|
25
|
+
component && component !== '' ? component : 'div',
|
|
26
|
+
) as HTMLElement;
|
|
27
|
+
box.className = getGidsBoxClassNames(className);
|
|
28
|
+
|
|
29
|
+
if (children) {
|
|
30
|
+
appendAsChildren(box, children);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return box;
|
|
34
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ClassValue,
|
|
3
|
+
GidsBreadcrumbWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
import { appendAsChildren, type DomChildren } from '../../utils/domUtils.js';
|
|
6
|
+
import { type GidsBreadcrumbCommonProps } from '@ganpatiinfo/gids-core-shared';
|
|
7
|
+
|
|
8
|
+
const { getGidsBreadcrumbClassNames } = GidsBreadcrumbWebUtils;
|
|
9
|
+
|
|
10
|
+
export interface GidsBreadcrumbDomProps
|
|
11
|
+
extends GidsBreadcrumbCommonProps<DomChildren> {
|
|
12
|
+
extraClasses?: ClassValue;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const GidsBreadcrumbDom = ({
|
|
16
|
+
children,
|
|
17
|
+
extraClasses,
|
|
18
|
+
}: GidsBreadcrumbDomProps): HTMLElement => {
|
|
19
|
+
const breadcrumb = document.createElement('nav');
|
|
20
|
+
breadcrumb.className = getGidsBreadcrumbClassNames(extraClasses);
|
|
21
|
+
|
|
22
|
+
breadcrumb.setAttribute('aria-label', 'Breadcrumb');
|
|
23
|
+
|
|
24
|
+
if (children) {
|
|
25
|
+
const orderedList = document.createElement('ol');
|
|
26
|
+
appendAsChildren(orderedList, children);
|
|
27
|
+
breadcrumb.appendChild(orderedList);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return breadcrumb;
|
|
31
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { type GidsBreadcrumbItemCommonProps } from '@ganpatiinfo/gids-core-shared';
|
|
2
|
+
import {
|
|
3
|
+
type ClassValue,
|
|
4
|
+
GidsBreadcrumbItemWebUtils,
|
|
5
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
6
|
+
import {
|
|
7
|
+
appendAsChildren,
|
|
8
|
+
type DomNodeOrString,
|
|
9
|
+
} from '../../utils/domUtils.js';
|
|
10
|
+
import { GidsIconDom } from '../GidsIcon/GidsIcon.js';
|
|
11
|
+
import { IconName } from '@ganpatiinfo/gids-web-theme-interface';
|
|
12
|
+
|
|
13
|
+
const { getGidsBreadcrumbItemClassNames } = GidsBreadcrumbItemWebUtils;
|
|
14
|
+
|
|
15
|
+
export interface GidsBreadcrumbItemDomProps
|
|
16
|
+
extends GidsBreadcrumbItemCommonProps<
|
|
17
|
+
DomNodeOrString,
|
|
18
|
+
DomNodeOrString,
|
|
19
|
+
DomNodeOrString
|
|
20
|
+
> {
|
|
21
|
+
className?: ClassValue;
|
|
22
|
+
href?: DomNodeOrString;
|
|
23
|
+
onClick?: (this: HTMLAnchorElement, event: Event) => void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const GidsBreadcrumbItemDom = ({
|
|
27
|
+
children,
|
|
28
|
+
selected,
|
|
29
|
+
leadingIcon,
|
|
30
|
+
href,
|
|
31
|
+
onClick,
|
|
32
|
+
className,
|
|
33
|
+
separator,
|
|
34
|
+
isSeparatorVisible = true,
|
|
35
|
+
renderingSystem = 'non-array',
|
|
36
|
+
currentIndex = 0,
|
|
37
|
+
totalLength = 0,
|
|
38
|
+
}: GidsBreadcrumbItemDomProps): HTMLLIElement => {
|
|
39
|
+
const breadcrumbItem = document.createElement('li');
|
|
40
|
+
breadcrumbItem.className = getGidsBreadcrumbItemClassNames(
|
|
41
|
+
{ selected },
|
|
42
|
+
className,
|
|
43
|
+
);
|
|
44
|
+
const breadcrumbAnchorItem = document.createElement('a');
|
|
45
|
+
breadcrumbAnchorItem.className = `gids-breadcrumb-item__anchor-label`;
|
|
46
|
+
|
|
47
|
+
if (href) {
|
|
48
|
+
breadcrumbAnchorItem.setAttribute('href', href as string);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (leadingIcon && leadingIcon !== '' && leadingIcon !== '(none)') {
|
|
52
|
+
breadcrumbAnchorItem.appendChild(
|
|
53
|
+
GidsIconDom({
|
|
54
|
+
name: leadingIcon as IconName,
|
|
55
|
+
appearance: 'regular',
|
|
56
|
+
alt: '',
|
|
57
|
+
size: 'md',
|
|
58
|
+
className: 'gids-breadcrumb-item__leading-icon',
|
|
59
|
+
}),
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (children) {
|
|
64
|
+
appendAsChildren(breadcrumbAnchorItem, children);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
breadcrumbItem.appendChild(breadcrumbAnchorItem);
|
|
68
|
+
|
|
69
|
+
if (isSeparatorVisible) {
|
|
70
|
+
if (
|
|
71
|
+
(renderingSystem === 'array' && currentIndex < totalLength - 1) ||
|
|
72
|
+
renderingSystem === 'non-array'
|
|
73
|
+
) {
|
|
74
|
+
breadcrumbItem.appendChild(
|
|
75
|
+
GidsIconDom({
|
|
76
|
+
name:
|
|
77
|
+
separator && separator !== '' && separator !== '(none)'
|
|
78
|
+
? (separator as IconName)
|
|
79
|
+
: 'chevron-right',
|
|
80
|
+
appearance: 'filled',
|
|
81
|
+
alt: '',
|
|
82
|
+
size: 'md',
|
|
83
|
+
className: 'gids-breadcrumb-item__separator-icon',
|
|
84
|
+
}),
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (onClick) {
|
|
90
|
+
breadcrumbItem.addEventListener('click', onClick);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return breadcrumbItem;
|
|
94
|
+
};
|
|
@@ -76,14 +76,14 @@ export const GidsButtonDom = <
|
|
|
76
76
|
button.appendChild(
|
|
77
77
|
GidsSpinnerControlDom({
|
|
78
78
|
size: size === 'lg' || size === undefined ? 'md' : size,
|
|
79
|
-
|
|
79
|
+
indeterminate: true,
|
|
80
80
|
}),
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
if (onClick && !loading) {
|
|
85
|
+
button.addEventListener('click', onClick);
|
|
86
|
+
}
|
|
87
87
|
|
|
88
88
|
return button;
|
|
89
89
|
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsCardCommonUtils,
|
|
3
|
+
type GidsCardCommonProps,
|
|
4
|
+
} from '@ganpatiinfo/gids-core-shared';
|
|
5
|
+
import {
|
|
6
|
+
type ClassValue,
|
|
7
|
+
GidsCardWebUtils,
|
|
8
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
9
|
+
import { appendAsChildren, type DomChildren } from '../../utils/domUtils.js';
|
|
10
|
+
import { GidsAvatarDom } from '../GidsAvatar/GidsAvatar.js';
|
|
11
|
+
import { GidsBaseCardDom } from '../GidsBaseCard/GidsBaseCard.js';
|
|
12
|
+
|
|
13
|
+
const { getGidsCardClassNames } = GidsCardWebUtils;
|
|
14
|
+
const { isContentContainerVisible, isSimpleCard } = GidsCardCommonUtils;
|
|
15
|
+
|
|
16
|
+
export interface GidsCardDomProps
|
|
17
|
+
extends GidsCardCommonProps<DomChildren, string, string> {
|
|
18
|
+
extraClasses?: ClassValue;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const GidsCardDom = ({
|
|
22
|
+
cardHeaderType = 'image',
|
|
23
|
+
cardHeaderSrc,
|
|
24
|
+
children,
|
|
25
|
+
heading,
|
|
26
|
+
subHeading,
|
|
27
|
+
description,
|
|
28
|
+
baseCardAppearance = 'default',
|
|
29
|
+
headerVisible,
|
|
30
|
+
extraClasses,
|
|
31
|
+
}: GidsCardDomProps): HTMLDivElement => {
|
|
32
|
+
const card = document.createElement('div');
|
|
33
|
+
card.className = getGidsCardClassNames(
|
|
34
|
+
{ isSimpleCard: isSimpleCard({ cardHeaderSrc, headerVisible }) },
|
|
35
|
+
extraClasses,
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const cardInnerContainer = document.createElement('div');
|
|
39
|
+
cardInnerContainer.className = isSimpleCard({ cardHeaderSrc, headerVisible })
|
|
40
|
+
? 'gids-card__simple-card-inner-container'
|
|
41
|
+
: 'gids-card__advanced-card-inner-container';
|
|
42
|
+
|
|
43
|
+
if (cardHeaderSrc && cardHeaderSrc !== '' && headerVisible) {
|
|
44
|
+
const headerContainer = document.createElement('div');
|
|
45
|
+
headerContainer.className =
|
|
46
|
+
cardHeaderType === 'avatar'
|
|
47
|
+
? 'gids-card__header-container-avatar'
|
|
48
|
+
: 'gids-card__header-container-image';
|
|
49
|
+
if (cardHeaderType === 'avatar') {
|
|
50
|
+
headerContainer.appendChild(
|
|
51
|
+
GidsAvatarDom({
|
|
52
|
+
appearance: 'image',
|
|
53
|
+
size: 'xl',
|
|
54
|
+
imageSrc: cardHeaderSrc,
|
|
55
|
+
}),
|
|
56
|
+
);
|
|
57
|
+
} else {
|
|
58
|
+
const image = document.createElement('img');
|
|
59
|
+
image.src = cardHeaderSrc!;
|
|
60
|
+
image.setAttribute('alt', 'alt_text');
|
|
61
|
+
image.className = 'gids-card__image';
|
|
62
|
+
headerContainer.appendChild(image);
|
|
63
|
+
}
|
|
64
|
+
cardInnerContainer.appendChild(headerContainer);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const contentContainer = document.createElement('div');
|
|
68
|
+
contentContainer.className = 'gids-card__content-container';
|
|
69
|
+
|
|
70
|
+
if (heading && heading !== '') {
|
|
71
|
+
const headingElement = document.createElement('div');
|
|
72
|
+
headingElement.className = 'gids-card__heading';
|
|
73
|
+
appendAsChildren(headingElement, heading);
|
|
74
|
+
contentContainer.appendChild(headingElement);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (subHeading && subHeading !== '') {
|
|
78
|
+
const subHeadingElement = document.createElement('div');
|
|
79
|
+
subHeadingElement.className = 'gids-card__subheading';
|
|
80
|
+
appendAsChildren(subHeadingElement, subHeading);
|
|
81
|
+
contentContainer.appendChild(subHeadingElement);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (description && description !== '') {
|
|
85
|
+
const descriptionElement = document.createElement('p');
|
|
86
|
+
descriptionElement.className = 'gids-card__description';
|
|
87
|
+
appendAsChildren(descriptionElement, description);
|
|
88
|
+
contentContainer.appendChild(descriptionElement);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (children) {
|
|
92
|
+
const childrenElement = document.createElement('div');
|
|
93
|
+
childrenElement.className = 'gids-card__children';
|
|
94
|
+
|
|
95
|
+
appendAsChildren(childrenElement, children);
|
|
96
|
+
contentContainer.appendChild(childrenElement);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (
|
|
100
|
+
isContentContainerVisible({
|
|
101
|
+
heading,
|
|
102
|
+
subHeading,
|
|
103
|
+
description,
|
|
104
|
+
children,
|
|
105
|
+
})
|
|
106
|
+
) {
|
|
107
|
+
cardInnerContainer.appendChild(contentContainer);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
card.appendChild(
|
|
111
|
+
GidsBaseCardDom({
|
|
112
|
+
children: cardInnerContainer,
|
|
113
|
+
cardType: 'content',
|
|
114
|
+
appearance: baseCardAppearance,
|
|
115
|
+
extraClasses: isSimpleCard({ cardHeaderSrc, headerVisible })
|
|
116
|
+
? 'gids-card__base-card-simple'
|
|
117
|
+
: 'gids-card__base-card-advanced',
|
|
118
|
+
}),
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
return card;
|
|
122
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ClassValue,
|
|
3
|
+
type GidsContainerWebProps,
|
|
4
|
+
GidsContainerWebUtils,
|
|
5
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
6
|
+
import { appendAsChildren, type DomChildren } from '../../utils/domUtils.js';
|
|
7
|
+
|
|
8
|
+
const { getGidsContainerClassNames } = GidsContainerWebUtils;
|
|
9
|
+
|
|
10
|
+
export interface GidsContainerDomProps
|
|
11
|
+
extends GidsContainerWebProps<DomChildren> {
|
|
12
|
+
className?: ClassValue;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const GidsContainerDom = ({
|
|
16
|
+
children,
|
|
17
|
+
fixed = false,
|
|
18
|
+
maxWidth = 'lg',
|
|
19
|
+
className,
|
|
20
|
+
}: GidsContainerDomProps): HTMLDivElement => {
|
|
21
|
+
const container = document.createElement('div');
|
|
22
|
+
container.className = getGidsContainerClassNames(
|
|
23
|
+
{ fixed, maxWidth },
|
|
24
|
+
className,
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
if (children) {
|
|
28
|
+
appendAsChildren(container, children);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return container;
|
|
32
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -30,6 +30,12 @@ export * from './components/GidsButtonGroup/GidsButtonGroup.js';
|
|
|
30
30
|
export * from './components/GidsButtonDock/GidsButtonDock.js';
|
|
31
31
|
export * from './components/GidsSectionNotice/GidsSectionNotice.js';
|
|
32
32
|
export * from './components/GidsCompoundButton/GidsCompoundButton.js';
|
|
33
|
+
export * from './components/GidsBox/GidsBox.js';
|
|
34
|
+
export * from './components/GidsContainer/GidsContainer.js';
|
|
35
|
+
export * from './components/GidsBreadcrumbItem/GidsBreadcrumbItem.js';
|
|
36
|
+
export * from './components/GidsBreadcrumb/GidsBreadcrumb.js';
|
|
37
|
+
export * from './components/GidsBaseCard/GidsBaseCard.js';
|
|
38
|
+
export * from './components/GidsCard/GidsCard.js';
|
|
33
39
|
|
|
34
40
|
/**
|
|
35
41
|
* Utilities
|