Skip to content

Commit

Permalink
Merge branch 'hyoo-ru:master' into feature/add-mol-link-source-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyumih authored Oct 9, 2023
2 parents 7b40dbb + 65c34c8 commit 5ab40a9
Show file tree
Hide file tree
Showing 144 changed files with 2,925 additions and 397 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/mol_dump_lib.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: mol_dump_lib

on:
workflow_dispatch:
push:
branches:
- master
paths:
- '.github/workflows/mol_dump_lib.yml'
- 'dump/**'
- 'build/**'
pull_request:
schedule:
- cron: "0 7 * * *"

jobs:
build:

runs-on: ubuntu-latest

steps:

- name: Build apps
uses: hyoo-ru/mam_build@master2
with:
package: mol
modules: dump/lib

- uses: JS-DevTools/npm-publish@v1
if: ${{ github.ref == 'refs/heads/master' }}
with:
token: ${{ secrets.NPM_AUTH_TOKEN }}
package: ./mol/dump/lib/-/package.json
6 changes: 3 additions & 3 deletions app/supplies/card/card.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ $mol_app_supplies_card $mol_link
Content <= Group $mol_row
sub <= items /
<= Code_item $mol_labeler
title <= code_title @ \Code
title <= code_title \Code
content / <= code \
<= Cost_item $mol_labeler
title <= cost_title @ \Cost
title <= cost_title \Cost
content / <= Cost $mol_cost
value <= cost $mol_unit_money
valueOf 0
<= Provider_item $mol_labeler
title <= provider_title @ \Provider
title <= provider_title \Provider
content / <= provider_name \
4 changes: 2 additions & 2 deletions app/supplies/detail/detail.view.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
margin: .75rem 0;
}

[mol_app_supplies_detail_positions] > * {
margin: .25rem 0;
[mol_app_supplies_detail_positions] {
gap: .75rem;
}

[mol_app_supplies_detail_descr_deck] {
Expand Down
36 changes: 17 additions & 19 deletions app/supplies/detail/detail.view.tree
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$mol_app_supplies_detail $mol_page
supply null
title @ \Supply
title \Supply
tools /
<= Close $mol_link
sub / <= Close_icon $mol_icon_cross
Expand All @@ -13,55 +13,53 @@ $mol_app_supplies_detail $mol_page
Content <= Descr_deck $mol_deck
items /
<= Org $mol_row
title <= org_title @ \Organization
title <= org_title \Organization
sub <= org_items /
<= Provider $mol_labeler
title <= provider_title @ \Provider
title <= provider_title \Provider
content / <= provider_name \
<= Consumer $mol_labeler
title <= customer_label @ \Consumer
title <= customer_label \Consumer
content / <= consumer_name \
<= Supply_group $mol_labeler
title <= supply_group_title @ \Supply Group
title <= supply_group_title \Supply Group
content / <= supply_group_name \
<= Ballance_unit_item $mol_labeler
title <= ballance_unit_title @ \Ballance Unit
title <= ballance_unit_title \Ballance Unit
content / <= ballance_unit_name \
<= Cons $mol_row
title <= cons_title @ \Consumer
title <= cons_title \Consumer
sub <= cons_items /
<= Contract $mol_labeler
title <= contract_title @ \Contract
title <= contract_title \Contract
content / <= contract_id \
<= Pay_method $mol_labeler
title <= pay_method_title @ \Pay Method
title <= pay_method_title \Pay Method
content / <= pay_method_name \
<= Manager $mol_labeler
title <= manager_title @ \Manager
title <= manager_title \Manager
content / <= manager_name \
<= Debitor $mol_labeler
title <= debitod_title @ \Debitor
title <= debitod_title \Debitor
content / <= debitor_name \
<= Attach_section $mol_section
head / <= attach_title @ \Attachments
head / <= attach_title \Attachments
content /
<= Attach $mol_attach
items <= attachments /string
attach_new? <=> attach_new? null
<= Positions_section $mol_section
head <= positions_head /
<= positions_title @ \Positions
<= positions_title \Positions
<= Cost_value $mol_cost
value <= cost $mol_unit_money
valueOf 0
Content <= Positions $mol_list
rows <= positions /$mol_view
foot /
<= Actions $mol_row
sub <= actions /
<= Approve $mol_check_box
checked? <=> approved? false
title <= approved_title @ \Approved
foot <= actions /
<= Approve $mol_check_box
checked? <=> approved? false
title <= approved_title \Approved
-
Position* $mol_app_supplies_position
position <= position* null
6 changes: 3 additions & 3 deletions app/supplies/enter/enter.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ $mol_app_supplies_enter $mol_view
sub / <= form $mol_form
form_fields /
<= loginField $mol_form_field
name <= loginLabel @ \User name
name <= loginLabel \User name
control <= loginControl $mol_string value? <=> login? \
<= passwordField $mol_form_field
name <= passwordLabel @ \Pass word
name <= passwordLabel \Pass word
control <= passControl $mol_string
value? <=> password? \
type \password
buttons /
<= submit $mol_button_major
sub / <= submitLabel @ \Log In
sub / <= submitLabel \Log In
click? <=> event_submit? null
disabled <= submit_blocked false
2 changes: 1 addition & 1 deletion app/supplies/list/list.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $mol_app_supplies_list $mol_page
supplies /$mol_app_supplies_domain_supply
tools /
<= Search $mol_code
hint <= search_hint @ \Search supply by bar code
hint <= search_hint \Search supply by bar code
value? <=> search_query? \
body /
<= Supply_rows $mol_list
Expand Down
4 changes: 2 additions & 2 deletions app/supplies/position/position.view.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
}

[mol_app_supplies_position_supply_date_item] {
flex: 0 0 6rem;
flex: 0 0 9rem;
}

[mol_app_supplies_position_store_item] {
flex: 1 1 10rem;
flex: 1 1 12rem;
}
14 changes: 7 additions & 7 deletions app/supplies/position/position.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,37 @@ $mol_app_supplies_position $mol_card
<= Main_group $mol_row sub /

<= Product_item $mol_labeler
title <= product_title @ \Product
title <= product_title \Product
content / <= product_name \

<= Cost_item $mol_labeler
title <= cost_title @ \Cost
title <= cost_title \Cost
content / <= Cost $mol_cost
value <= cost $mol_unit_money
valueOf 0

<= Addon_group $mol_row sub /

<= Division_item $mol_labeler
title <= division_title @ \Division
title <= division_title \Division
content / <= division_name \

<= Price_item $mol_labeler
title <= price_label @ \Price
title <= price_label \Price
content / <= Price $mol_cost
value <= price $mol_unit_money
valueOf 0

<= Supply_group $mol_row sub /

<= Quantity_item $mol_labeler
title <= quantity_title @ \Quantity
title <= quantity_title \Quantity
content / <= quantity \

<= Supply_date_item $mol_labeler
title <= supply_date_title @ \Supply date
title <= supply_date_title \Supply date
content / <= supply_date \

<= Store_item $mol_labeler
title <= store_title @ \Store
title <= store_title \Store
content / <= store_name \
2 changes: 1 addition & 1 deletion app/supplies/supplies.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $mol_app_supplies $mol_book2
List $mol_app_supplies_list
supplies <= supplies /$mol_app_supplies_domain_supply
tools <= tools_root /
title <= list_title @ \Supplies
title <= list_title \Supplies
search_query? <=> supply_id? \
-
Detail* $mol_app_supplies_detail
Expand Down
12 changes: 12 additions & 0 deletions blob/uri/uri.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace $ {

export function $mol_blob_uri( blob: $mol_blob ) {
return new Promise< string >( ( done, fail )=> {
const reader = new FileReader
reader.onerror = fail
reader.onload = event => done( event.target!.result as string )
reader.readAsDataURL( blob )
} )
}

}
20 changes: 16 additions & 4 deletions book2/book2.view.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,29 @@
content: '';
position: absolute;
top: 1.5rem;
width: 1px;
width: 3px;
height: 1rem;
background: var(--mol_theme_special);
background: linear-gradient(
to bottom,
var(--mol_theme_focus) 0%,
var(--mol_theme_focus) 15%,
transparent 15%,
transparent 45%,
var(--mol_theme_focus) 45%,
var(--mol_theme_focus) 55%,
transparent 55%,
transparent 85%,
var(--mol_theme_focus) 85%,
var(--mol_theme_focus) 100%
);
border-radius: var(--mol_gap_round);
opacity: .5;
}
[mol_book2] > *:not(:first-of-type):before {
left: -1px;
left: -2px;
}
[mol_book2] > *:not(:last-of-type)::after {
right: -1px;
right: -2px;
}

:where([mol_book2]) > * {
Expand Down
7 changes: 5 additions & 2 deletions book2/catalog/catalog.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ $mol_book2_catalog $mol_book2
param \
spread? \
spreads *
Spread $mol_view
Spread* $mol_view
Spread_default null
spread_ids /string
menu_filter_enabled false
spread_ids_filtered /string
pages /
<= Menu $mol_page
Logo <= Menu_logo null
Title => Menu_title
title <= menu_title \
Tools => Menu_tools
Expand Down
44 changes: 31 additions & 13 deletions book2/catalog/catalog.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace $.$$ {

@ $mol_mem
pages() {
const spread = this.Spread()
const spread = this.spread() === '' ? this.Spread_default() : this.Spread(this.spread())
return [
this.Menu(),
... spread
Expand All @@ -18,41 +18,59 @@ namespace $.$$ {
: [],
]
}

@ $mol_mem
override spread_ids(): readonly string[] {
return Object.keys( this.spreads() )
}

@ $mol_mem
menu_body() {
override menu_body() {
return [
... Object.keys( this.spreads() ).length >= 10 ? [ this.Menu_filter() ] : [],
... this.menu_filter_enabled() ? [ this.Menu_filter() ] : [],
this.Menu_links(),
]
}

override menu_filter_enabled() {
return this.spread_ids().length >= 10
}

@ $mol_mem
menu_links() {
return Object.keys( this.spreads() )
.filter( $mol_match_text( this.menu_filter(), spread => [ this.spread_title( spread ) ] ) )
override menu_links() {
return this.spread_ids_filtered()
.map( spread => this.Menu_link( spread ) )
}

@ $mol_mem
override spread_ids_filtered() {
return this.spread_ids()
.filter( $mol_match_text( this.menu_filter(), spread => [ this.spread_title( spread ) ] ) )
}

Spread() {
return this.spreads()[ this.spread() ]
override Spread(id: string): $mol_view {
return this.spreads()[ id ]
}

override Spread_default() {
return this.spreads()['']
}

@ $mol_mem
spread( next?: string ) {
override spread( next?: string ) {
return this.$.$mol_state_arg.value( this.param(), next ) ?? ''
}

arg( spread: string ) {
override arg( spread: string ) {
return { [ this.param() ]: spread || null }
}

spread_close_arg() {
override spread_close_arg() {
return { [ this.param() ]: null }
}

spread_title( spread: string ) {
const page = this.spreads()[ spread ]
override spread_title( spread: string ) {
const page = this.Spread( spread )
return page instanceof $mol_book2
&& page.menu_title()
|| page.title()
Expand Down
Loading

0 comments on commit 5ab40a9

Please sign in to comment.